machinaos 0.0.1 → 0.0.7
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/.env.template +71 -71
- package/LICENSE +21 -21
- package/README.md +163 -87
- package/bin/cli.js +62 -106
- package/client/.dockerignore +45 -45
- package/client/Dockerfile +68 -68
- package/client/dist/assets/index-DFSC53FP.css +1 -0
- package/client/dist/assets/index-fJ-1gTf5.js +613 -0
- package/client/dist/index.html +14 -0
- package/client/eslint.config.js +34 -16
- package/client/nginx.conf +66 -66
- package/client/package.json +61 -48
- package/client/src/App.tsx +27 -27
- package/client/src/Dashboard.tsx +1200 -1172
- package/client/src/ParameterPanel.tsx +302 -300
- package/client/src/components/AIAgentNode.tsx +315 -321
- package/client/src/components/APIKeyValidator.tsx +117 -117
- package/client/src/components/ClaudeChatModelNode.tsx +17 -17
- package/client/src/components/CredentialsModal.tsx +1200 -306
- package/client/src/components/GeminiChatModelNode.tsx +17 -17
- package/client/src/components/GenericNode.tsx +356 -356
- package/client/src/components/LocationParameterPanel.tsx +153 -153
- package/client/src/components/ModelNode.tsx +285 -285
- package/client/src/components/OpenAIChatModelNode.tsx +17 -17
- package/client/src/components/OutputPanel.tsx +470 -470
- package/client/src/components/ParameterRenderer.tsx +1873 -1873
- package/client/src/components/SkillEditorModal.tsx +3 -3
- package/client/src/components/SquareNode.tsx +812 -796
- package/client/src/components/ToolkitNode.tsx +365 -365
- package/client/src/components/auth/LoginPage.tsx +247 -247
- package/client/src/components/auth/ProtectedRoute.tsx +59 -59
- package/client/src/components/base/BaseChatModelNode.tsx +270 -270
- package/client/src/components/icons/AIProviderIcons.tsx +50 -50
- package/client/src/components/maps/GoogleMapsPicker.tsx +136 -136
- package/client/src/components/maps/MapsPreviewPanel.tsx +109 -109
- package/client/src/components/maps/index.ts +25 -25
- package/client/src/components/parameterPanel/InputSection.tsx +1094 -1094
- package/client/src/components/parameterPanel/LocationPanelLayout.tsx +64 -64
- package/client/src/components/parameterPanel/MapsSection.tsx +91 -91
- package/client/src/components/parameterPanel/MiddleSection.tsx +867 -571
- package/client/src/components/parameterPanel/OutputSection.tsx +80 -80
- package/client/src/components/parameterPanel/ParameterPanelLayout.tsx +81 -81
- package/client/src/components/parameterPanel/ToolSchemaEditor.tsx +436 -436
- package/client/src/components/parameterPanel/index.ts +41 -41
- package/client/src/components/shared/DataPanel.tsx +142 -142
- package/client/src/components/shared/JSONTreeRenderer.tsx +105 -105
- package/client/src/components/ui/AIResultModal.tsx +203 -203
- package/client/src/components/ui/ApiKeyInput.tsx +93 -0
- package/client/src/components/ui/CodeEditor.tsx +81 -81
- package/client/src/components/ui/CollapsibleSection.tsx +87 -87
- package/client/src/components/ui/ComponentItem.tsx +153 -153
- package/client/src/components/ui/ComponentPalette.tsx +320 -320
- package/client/src/components/ui/ConsolePanel.tsx +151 -43
- package/client/src/components/ui/ErrorBoundary.tsx +195 -195
- package/client/src/components/ui/InputNodesPanel.tsx +203 -203
- package/client/src/components/ui/MapSelector.tsx +313 -313
- package/client/src/components/ui/Modal.tsx +151 -148
- package/client/src/components/ui/NodeOutputPanel.tsx +1150 -1150
- package/client/src/components/ui/OutputDisplayPanel.tsx +381 -381
- package/client/src/components/ui/QRCodeDisplay.tsx +182 -0
- package/client/src/components/ui/TopToolbar.tsx +736 -736
- package/client/src/components/ui/WorkflowSidebar.tsx +293 -293
- package/client/src/config/antdTheme.ts +186 -186
- package/client/src/contexts/AuthContext.tsx +221 -221
- package/client/src/contexts/ThemeContext.tsx +42 -42
- package/client/src/contexts/WebSocketContext.tsx +2144 -1971
- package/client/src/factories/baseChatModelFactory.ts +255 -255
- package/client/src/hooks/useAndroidOperations.ts +118 -164
- package/client/src/hooks/useApiKeyValidation.ts +106 -106
- package/client/src/hooks/useApiKeys.ts +238 -238
- package/client/src/hooks/useAppTheme.ts +17 -17
- package/client/src/hooks/useComponentPalette.ts +50 -50
- package/client/src/hooks/useDragAndDrop.ts +123 -123
- package/client/src/hooks/useDragVariable.ts +88 -88
- package/client/src/hooks/useExecution.ts +319 -313
- package/client/src/hooks/useParameterPanel.ts +176 -176
- package/client/src/hooks/useReactFlowNodes.ts +188 -188
- package/client/src/hooks/useToolSchema.ts +209 -209
- package/client/src/hooks/useWhatsApp.ts +196 -196
- package/client/src/hooks/useWorkflowManagement.ts +45 -45
- package/client/src/index.css +314 -314
- package/client/src/nodeDefinitions/aiAgentNodes.ts +335 -335
- package/client/src/nodeDefinitions/aiModelNodes.ts +340 -340
- package/client/src/nodeDefinitions/androidServiceNodes.ts +383 -383
- package/client/src/nodeDefinitions/chatNodes.ts +135 -135
- package/client/src/nodeDefinitions/codeNodes.ts +54 -54
- package/client/src/nodeDefinitions/index.ts +14 -14
- package/client/src/nodeDefinitions/locationNodes.ts +462 -462
- package/client/src/nodeDefinitions/schedulerNodes.ts +220 -220
- package/client/src/nodeDefinitions/skillNodes.ts +17 -5
- package/client/src/nodeDefinitions/utilityNodes.ts +284 -284
- package/client/src/nodeDefinitions/whatsappNodes.ts +821 -865
- package/client/src/nodeDefinitions.ts +101 -103
- package/client/src/services/dynamicParameterService.ts +95 -95
- package/client/src/services/execution/aiAgentExecutionService.ts +34 -34
- package/client/src/services/executionService.ts +227 -231
- package/client/src/services/workflowApi.ts +91 -91
- package/client/src/store/useAppStore.ts +578 -581
- package/client/src/styles/theme.ts +513 -508
- package/client/src/styles/zIndex.ts +16 -16
- package/client/src/types/ComponentTypes.ts +38 -38
- package/client/src/types/INodeProperties.ts +287 -287
- package/client/src/types/NodeTypes.ts +27 -27
- package/client/src/utils/formatters.ts +32 -32
- package/client/src/utils/googleMapsLoader.ts +139 -139
- package/client/src/utils/locationUtils.ts +84 -84
- package/client/src/utils/nodeUtils.ts +30 -30
- package/client/src/utils/workflow.ts +29 -29
- package/client/src/vite-env.d.ts +12 -12
- package/client/tailwind.config.js +59 -59
- package/client/tsconfig.json +25 -25
- package/client/vite.config.js +35 -35
- package/install.ps1 +308 -0
- package/install.sh +343 -0
- package/package.json +81 -70
- package/scripts/build.js +174 -51
- package/scripts/clean.js +40 -40
- package/scripts/start.js +234 -210
- package/scripts/stop.js +301 -325
- package/server/.dockerignore +44 -44
- package/server/Dockerfile +45 -45
- package/server/constants.py +244 -249
- package/server/core/cache.py +460 -460
- package/server/core/config.py +127 -127
- package/server/core/container.py +98 -98
- package/server/core/database.py +1296 -1210
- package/server/core/logging.py +313 -313
- package/server/main.py +288 -288
- package/server/middleware/__init__.py +5 -5
- package/server/middleware/auth.py +89 -89
- package/server/models/auth.py +52 -52
- package/server/models/cache.py +24 -24
- package/server/models/database.py +235 -210
- package/server/models/nodes.py +435 -455
- package/server/pyproject.toml +75 -72
- package/server/requirements.txt +83 -83
- package/server/routers/android.py +294 -294
- package/server/routers/auth.py +203 -203
- package/server/routers/database.py +150 -150
- package/server/routers/maps.py +141 -141
- package/server/routers/nodejs_compat.py +288 -288
- package/server/routers/webhook.py +90 -90
- package/server/routers/websocket.py +2239 -2127
- package/server/routers/whatsapp.py +761 -761
- package/server/routers/workflow.py +199 -199
- package/server/services/ai.py +2444 -2414
- package/server/services/android_service.py +588 -588
- package/server/services/auth.py +130 -130
- package/server/services/chat_client.py +160 -160
- package/server/services/deployment/manager.py +706 -706
- package/server/services/event_waiter.py +675 -785
- package/server/services/execution/executor.py +1351 -1351
- package/server/services/execution/models.py +1 -1
- package/server/services/handlers/__init__.py +122 -126
- package/server/services/handlers/ai.py +390 -355
- package/server/services/handlers/android.py +69 -260
- package/server/services/handlers/code.py +278 -278
- package/server/services/handlers/http.py +193 -193
- package/server/services/handlers/tools.py +146 -32
- package/server/services/handlers/triggers.py +107 -107
- package/server/services/handlers/utility.py +822 -822
- package/server/services/handlers/whatsapp.py +423 -476
- package/server/services/maps.py +288 -288
- package/server/services/memory_store.py +103 -103
- package/server/services/node_executor.py +372 -375
- package/server/services/scheduler.py +155 -155
- package/server/services/skill_loader.py +1 -1
- package/server/services/status_broadcaster.py +834 -826
- package/server/services/temporal/__init__.py +23 -23
- package/server/services/temporal/activities.py +344 -344
- package/server/services/temporal/client.py +76 -76
- package/server/services/temporal/executor.py +147 -147
- package/server/services/temporal/worker.py +251 -251
- package/server/services/temporal/workflow.py +355 -355
- package/server/services/temporal/ws_client.py +236 -236
- package/server/services/text.py +110 -110
- package/server/services/user_auth.py +172 -172
- package/server/services/websocket_client.py +29 -29
- package/server/services/workflow.py +597 -597
- package/server/skills/android-skill/SKILL.md +4 -4
- package/server/skills/code-skill/SKILL.md +123 -89
- package/server/skills/maps-skill/SKILL.md +3 -3
- package/server/skills/memory-skill/SKILL.md +1 -1
- package/server/skills/web-search-skill/SKILL.md +154 -0
- package/server/skills/whatsapp-skill/SKILL.md +3 -3
- package/server/uv.lock +461 -100
- package/server/whatsapp-rpc/.dockerignore +30 -30
- package/server/whatsapp-rpc/Dockerfile +44 -44
- package/server/whatsapp-rpc/Dockerfile.web +17 -17
- package/server/whatsapp-rpc/README.md +139 -139
- package/server/whatsapp-rpc/bin/whatsapp-rpc-server +0 -0
- package/server/whatsapp-rpc/cli.js +95 -95
- package/server/whatsapp-rpc/configs/config.yaml +6 -6
- package/server/whatsapp-rpc/docker-compose.yml +35 -35
- package/server/whatsapp-rpc/docs/API.md +410 -410
- package/server/whatsapp-rpc/node_modules/.package-lock.json +259 -0
- package/server/whatsapp-rpc/node_modules/chalk/license +9 -0
- package/server/whatsapp-rpc/node_modules/chalk/package.json +83 -0
- package/server/whatsapp-rpc/node_modules/chalk/readme.md +297 -0
- package/server/whatsapp-rpc/node_modules/chalk/source/index.d.ts +325 -0
- package/server/whatsapp-rpc/node_modules/chalk/source/index.js +225 -0
- package/server/whatsapp-rpc/node_modules/chalk/source/utilities.js +33 -0
- package/server/whatsapp-rpc/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +236 -0
- package/server/whatsapp-rpc/node_modules/chalk/source/vendor/ansi-styles/index.js +223 -0
- package/server/whatsapp-rpc/node_modules/chalk/source/vendor/supports-color/browser.d.ts +1 -0
- package/server/whatsapp-rpc/node_modules/chalk/source/vendor/supports-color/browser.js +34 -0
- package/server/whatsapp-rpc/node_modules/chalk/source/vendor/supports-color/index.d.ts +55 -0
- package/server/whatsapp-rpc/node_modules/chalk/source/vendor/supports-color/index.js +190 -0
- package/server/whatsapp-rpc/node_modules/commander/LICENSE +22 -0
- package/server/whatsapp-rpc/node_modules/commander/Readme.md +1148 -0
- package/server/whatsapp-rpc/node_modules/commander/esm.mjs +16 -0
- package/server/whatsapp-rpc/node_modules/commander/index.js +26 -0
- package/server/whatsapp-rpc/node_modules/commander/lib/argument.js +145 -0
- package/server/whatsapp-rpc/node_modules/commander/lib/command.js +2179 -0
- package/server/whatsapp-rpc/node_modules/commander/lib/error.js +43 -0
- package/server/whatsapp-rpc/node_modules/commander/lib/help.js +462 -0
- package/server/whatsapp-rpc/node_modules/commander/lib/option.js +329 -0
- package/server/whatsapp-rpc/node_modules/commander/lib/suggestSimilar.js +100 -0
- package/server/whatsapp-rpc/node_modules/commander/package-support.json +16 -0
- package/server/whatsapp-rpc/node_modules/commander/package.json +80 -0
- package/server/whatsapp-rpc/node_modules/commander/typings/esm.d.mts +3 -0
- package/server/whatsapp-rpc/node_modules/commander/typings/index.d.ts +884 -0
- package/server/whatsapp-rpc/node_modules/cross-spawn/LICENSE +21 -0
- package/server/whatsapp-rpc/node_modules/cross-spawn/README.md +89 -0
- package/server/whatsapp-rpc/node_modules/cross-spawn/index.js +39 -0
- package/server/whatsapp-rpc/node_modules/cross-spawn/lib/enoent.js +59 -0
- package/server/whatsapp-rpc/node_modules/cross-spawn/lib/parse.js +91 -0
- package/server/whatsapp-rpc/node_modules/cross-spawn/lib/util/escape.js +47 -0
- package/server/whatsapp-rpc/node_modules/cross-spawn/lib/util/readShebang.js +23 -0
- package/server/whatsapp-rpc/node_modules/cross-spawn/lib/util/resolveCommand.js +52 -0
- package/server/whatsapp-rpc/node_modules/cross-spawn/package.json +73 -0
- package/server/whatsapp-rpc/node_modules/execa/index.d.ts +955 -0
- package/server/whatsapp-rpc/node_modules/execa/index.js +309 -0
- package/server/whatsapp-rpc/node_modules/execa/lib/command.js +119 -0
- package/server/whatsapp-rpc/node_modules/execa/lib/error.js +87 -0
- package/server/whatsapp-rpc/node_modules/execa/lib/kill.js +102 -0
- package/server/whatsapp-rpc/node_modules/execa/lib/pipe.js +42 -0
- package/server/whatsapp-rpc/node_modules/execa/lib/promise.js +36 -0
- package/server/whatsapp-rpc/node_modules/execa/lib/stdio.js +49 -0
- package/server/whatsapp-rpc/node_modules/execa/lib/stream.js +133 -0
- package/server/whatsapp-rpc/node_modules/execa/lib/verbose.js +19 -0
- package/server/whatsapp-rpc/node_modules/execa/license +9 -0
- package/server/whatsapp-rpc/node_modules/execa/package.json +90 -0
- package/server/whatsapp-rpc/node_modules/execa/readme.md +822 -0
- package/server/whatsapp-rpc/node_modules/get-stream/license +9 -0
- package/server/whatsapp-rpc/node_modules/get-stream/package.json +53 -0
- package/server/whatsapp-rpc/node_modules/get-stream/readme.md +291 -0
- package/server/whatsapp-rpc/node_modules/get-stream/source/array-buffer.js +84 -0
- package/server/whatsapp-rpc/node_modules/get-stream/source/array.js +32 -0
- package/server/whatsapp-rpc/node_modules/get-stream/source/buffer.js +20 -0
- package/server/whatsapp-rpc/node_modules/get-stream/source/contents.js +101 -0
- package/server/whatsapp-rpc/node_modules/get-stream/source/index.d.ts +119 -0
- package/server/whatsapp-rpc/node_modules/get-stream/source/index.js +5 -0
- package/server/whatsapp-rpc/node_modules/get-stream/source/string.js +36 -0
- package/server/whatsapp-rpc/node_modules/get-stream/source/utils.js +11 -0
- package/server/whatsapp-rpc/node_modules/get-them-args/LICENSE +21 -0
- package/server/whatsapp-rpc/node_modules/get-them-args/README.md +95 -0
- package/server/whatsapp-rpc/node_modules/get-them-args/index.js +97 -0
- package/server/whatsapp-rpc/node_modules/get-them-args/package.json +36 -0
- package/server/whatsapp-rpc/node_modules/human-signals/LICENSE +201 -0
- package/server/whatsapp-rpc/node_modules/human-signals/README.md +168 -0
- package/server/whatsapp-rpc/node_modules/human-signals/build/src/core.js +273 -0
- package/server/whatsapp-rpc/node_modules/human-signals/build/src/main.d.ts +73 -0
- package/server/whatsapp-rpc/node_modules/human-signals/build/src/main.js +70 -0
- package/server/whatsapp-rpc/node_modules/human-signals/build/src/realtime.js +16 -0
- package/server/whatsapp-rpc/node_modules/human-signals/build/src/signals.js +34 -0
- package/server/whatsapp-rpc/node_modules/human-signals/package.json +61 -0
- package/server/whatsapp-rpc/node_modules/is-stream/index.d.ts +81 -0
- package/server/whatsapp-rpc/node_modules/is-stream/index.js +29 -0
- package/server/whatsapp-rpc/node_modules/is-stream/license +9 -0
- package/server/whatsapp-rpc/node_modules/is-stream/package.json +44 -0
- package/server/whatsapp-rpc/node_modules/is-stream/readme.md +60 -0
- package/server/whatsapp-rpc/node_modules/isexe/LICENSE +15 -0
- package/server/whatsapp-rpc/node_modules/isexe/README.md +51 -0
- package/server/whatsapp-rpc/node_modules/isexe/index.js +57 -0
- package/server/whatsapp-rpc/node_modules/isexe/mode.js +41 -0
- package/server/whatsapp-rpc/node_modules/isexe/package.json +31 -0
- package/server/whatsapp-rpc/node_modules/isexe/test/basic.js +221 -0
- package/server/whatsapp-rpc/node_modules/isexe/windows.js +42 -0
- package/server/whatsapp-rpc/node_modules/kill-port/.editorconfig +12 -0
- package/server/whatsapp-rpc/node_modules/kill-port/.gitattributes +1 -0
- package/server/whatsapp-rpc/node_modules/kill-port/LICENSE +21 -0
- package/server/whatsapp-rpc/node_modules/kill-port/README.md +140 -0
- package/server/whatsapp-rpc/node_modules/kill-port/cli.js +25 -0
- package/server/whatsapp-rpc/node_modules/kill-port/example.js +21 -0
- package/server/whatsapp-rpc/node_modules/kill-port/index.js +46 -0
- package/server/whatsapp-rpc/node_modules/kill-port/logo.png +0 -0
- package/server/whatsapp-rpc/node_modules/kill-port/package.json +41 -0
- package/server/whatsapp-rpc/node_modules/kill-port/pnpm-lock.yaml +4606 -0
- package/server/whatsapp-rpc/node_modules/kill-port/test.js +16 -0
- package/server/whatsapp-rpc/node_modules/merge-stream/LICENSE +21 -0
- package/server/whatsapp-rpc/node_modules/merge-stream/README.md +78 -0
- package/server/whatsapp-rpc/node_modules/merge-stream/index.js +41 -0
- package/server/whatsapp-rpc/node_modules/merge-stream/package.json +19 -0
- package/server/whatsapp-rpc/node_modules/mimic-fn/index.d.ts +52 -0
- package/server/whatsapp-rpc/node_modules/mimic-fn/index.js +71 -0
- package/server/whatsapp-rpc/node_modules/mimic-fn/license +9 -0
- package/server/whatsapp-rpc/node_modules/mimic-fn/package.json +45 -0
- package/server/whatsapp-rpc/node_modules/mimic-fn/readme.md +90 -0
- package/server/whatsapp-rpc/node_modules/npm-run-path/index.d.ts +90 -0
- package/server/whatsapp-rpc/node_modules/npm-run-path/index.js +52 -0
- package/server/whatsapp-rpc/node_modules/npm-run-path/license +9 -0
- package/server/whatsapp-rpc/node_modules/npm-run-path/node_modules/path-key/index.d.ts +31 -0
- package/server/whatsapp-rpc/node_modules/npm-run-path/node_modules/path-key/index.js +12 -0
- package/server/whatsapp-rpc/node_modules/npm-run-path/node_modules/path-key/license +9 -0
- package/server/whatsapp-rpc/node_modules/npm-run-path/node_modules/path-key/package.json +41 -0
- package/server/whatsapp-rpc/node_modules/npm-run-path/node_modules/path-key/readme.md +57 -0
- package/server/whatsapp-rpc/node_modules/npm-run-path/package.json +49 -0
- package/server/whatsapp-rpc/node_modules/npm-run-path/readme.md +104 -0
- package/server/whatsapp-rpc/node_modules/onetime/index.d.ts +59 -0
- package/server/whatsapp-rpc/node_modules/onetime/index.js +41 -0
- package/server/whatsapp-rpc/node_modules/onetime/license +9 -0
- package/server/whatsapp-rpc/node_modules/onetime/package.json +45 -0
- package/server/whatsapp-rpc/node_modules/onetime/readme.md +94 -0
- package/server/whatsapp-rpc/node_modules/path-key/index.d.ts +40 -0
- package/server/whatsapp-rpc/node_modules/path-key/index.js +16 -0
- package/server/whatsapp-rpc/node_modules/path-key/license +9 -0
- package/server/whatsapp-rpc/node_modules/path-key/package.json +39 -0
- package/server/whatsapp-rpc/node_modules/path-key/readme.md +61 -0
- package/server/whatsapp-rpc/node_modules/shebang-command/index.js +19 -0
- package/server/whatsapp-rpc/node_modules/shebang-command/license +9 -0
- package/server/whatsapp-rpc/node_modules/shebang-command/package.json +34 -0
- package/server/whatsapp-rpc/node_modules/shebang-command/readme.md +34 -0
- package/server/whatsapp-rpc/node_modules/shebang-regex/index.d.ts +22 -0
- package/server/whatsapp-rpc/node_modules/shebang-regex/index.js +2 -0
- package/server/whatsapp-rpc/node_modules/shebang-regex/license +9 -0
- package/server/whatsapp-rpc/node_modules/shebang-regex/package.json +35 -0
- package/server/whatsapp-rpc/node_modules/shebang-regex/readme.md +33 -0
- package/server/whatsapp-rpc/node_modules/shell-exec/LICENSE +21 -0
- package/server/whatsapp-rpc/node_modules/shell-exec/README.md +60 -0
- package/server/whatsapp-rpc/node_modules/shell-exec/index.js +47 -0
- package/server/whatsapp-rpc/node_modules/shell-exec/package.json +29 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/LICENSE.txt +16 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/README.md +74 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/browser.d.ts +12 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/browser.d.ts.map +1 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/browser.js +10 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/browser.js.map +1 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/index.d.ts +48 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/index.d.ts.map +1 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/index.js +279 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/index.js.map +1 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/package.json +3 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/signals.d.ts +29 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/signals.d.ts.map +1 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/signals.js +42 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/cjs/signals.js.map +1 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/browser.d.ts +12 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/browser.d.ts.map +1 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/browser.js +4 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/browser.js.map +1 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/index.d.ts +48 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/index.d.ts.map +1 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/index.js +275 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/index.js.map +1 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/package.json +3 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/signals.d.ts +29 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/signals.d.ts.map +1 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/signals.js +39 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/dist/mjs/signals.js.map +1 -0
- package/server/whatsapp-rpc/node_modules/signal-exit/package.json +106 -0
- package/server/whatsapp-rpc/node_modules/strip-final-newline/index.js +14 -0
- package/server/whatsapp-rpc/node_modules/strip-final-newline/license +9 -0
- package/server/whatsapp-rpc/node_modules/strip-final-newline/package.json +43 -0
- package/server/whatsapp-rpc/node_modules/strip-final-newline/readme.md +35 -0
- package/server/whatsapp-rpc/node_modules/which/CHANGELOG.md +166 -0
- package/server/whatsapp-rpc/node_modules/which/LICENSE +15 -0
- package/server/whatsapp-rpc/node_modules/which/README.md +54 -0
- package/server/whatsapp-rpc/node_modules/which/bin/node-which +52 -0
- package/server/whatsapp-rpc/node_modules/which/package.json +43 -0
- package/server/whatsapp-rpc/node_modules/which/which.js +125 -0
- package/server/whatsapp-rpc/package-lock.json +272 -0
- package/server/whatsapp-rpc/package.json +30 -30
- package/server/whatsapp-rpc/schema.json +1294 -1294
- package/server/whatsapp-rpc/scripts/clean.cjs +66 -66
- package/server/whatsapp-rpc/scripts/cli.js +162 -162
- package/server/whatsapp-rpc/src/go/whatsapp/history.go +166 -166
- package/server/whatsapp-rpc/src/python/pyproject.toml +15 -15
- package/server/whatsapp-rpc/src/python/whatsapp_rpc/__init__.py +4 -4
- package/server/whatsapp-rpc/src/python/whatsapp_rpc/client.py +427 -427
- package/server/whatsapp-rpc/web/app.py +609 -609
- package/server/whatsapp-rpc/web/requirements.txt +6 -6
- package/server/whatsapp-rpc/web/rpc_client.py +427 -427
- package/server/whatsapp-rpc/web/static/openapi.yaml +59 -59
- package/server/whatsapp-rpc/web/templates/base.html +149 -149
- package/server/whatsapp-rpc/web/templates/contacts.html +240 -240
- package/server/whatsapp-rpc/web/templates/dashboard.html +319 -319
- package/server/whatsapp-rpc/web/templates/groups.html +328 -328
- package/server/whatsapp-rpc/web/templates/messages.html +465 -465
- package/server/whatsapp-rpc/web/templates/messaging.html +680 -680
- package/server/whatsapp-rpc/web/templates/send.html +258 -258
- package/server/whatsapp-rpc/web/templates/settings.html +459 -459
- package/client/src/components/ui/AndroidSettingsPanel.tsx +0 -401
- package/client/src/components/ui/WhatsAppSettingsPanel.tsx +0 -345
- package/client/src/nodeDefinitions/androidDeviceNodes.ts +0 -140
- package/docker-compose.prod.yml +0 -107
- package/docker-compose.yml +0 -104
- package/docs-MachinaOs/README.md +0 -85
- package/docs-MachinaOs/deployment/docker.mdx +0 -228
- package/docs-MachinaOs/deployment/production.mdx +0 -345
- package/docs-MachinaOs/docs.json +0 -75
- package/docs-MachinaOs/faq.mdx +0 -309
- package/docs-MachinaOs/favicon.svg +0 -5
- package/docs-MachinaOs/installation.mdx +0 -160
- package/docs-MachinaOs/introduction.mdx +0 -114
- package/docs-MachinaOs/logo/dark.svg +0 -6
- package/docs-MachinaOs/logo/light.svg +0 -6
- package/docs-MachinaOs/nodes/ai-agent.mdx +0 -216
- package/docs-MachinaOs/nodes/ai-models.mdx +0 -240
- package/docs-MachinaOs/nodes/android.mdx +0 -411
- package/docs-MachinaOs/nodes/overview.mdx +0 -181
- package/docs-MachinaOs/nodes/schedulers.mdx +0 -316
- package/docs-MachinaOs/nodes/webhooks.mdx +0 -330
- package/docs-MachinaOs/nodes/whatsapp.mdx +0 -305
- package/docs-MachinaOs/quickstart.mdx +0 -119
- package/docs-MachinaOs/tutorials/ai-agent-workflow.mdx +0 -177
- package/docs-MachinaOs/tutorials/android-automation.mdx +0 -242
- package/docs-MachinaOs/tutorials/first-workflow.mdx +0 -134
- package/docs-MachinaOs/tutorials/whatsapp-automation.mdx +0 -185
- package/nul +0 -0
- package/scripts/check-ports.ps1 +0 -33
- package/scripts/kill-port.ps1 +0 -154
|
@@ -1,797 +1,813 @@
|
|
|
1
|
-
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
|
2
|
-
import { Handle, Position, NodeProps } from 'reactflow';
|
|
3
|
-
import { NodeData } from '../types/NodeTypes';
|
|
4
|
-
import { useAppStore } from '../store/useAppStore';
|
|
5
|
-
import { nodeDefinitions } from '../nodeDefinitions';
|
|
6
|
-
import { useAppTheme } from '../hooks/useAppTheme';
|
|
7
|
-
import { ANDROID_SERVICE_NODE_TYPES } from '../nodeDefinitions/androidServiceNodes';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
'
|
|
38
|
-
'
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const [
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
//
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
//
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
//
|
|
221
|
-
if (
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
if (
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
return '
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
? 'API key
|
|
283
|
-
:
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
//
|
|
463
|
-
if (
|
|
464
|
-
return
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
borderRadius:
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
}}
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
1
|
+
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
|
2
|
+
import { Handle, Position, NodeProps } from 'reactflow';
|
|
3
|
+
import { NodeData } from '../types/NodeTypes';
|
|
4
|
+
import { useAppStore } from '../store/useAppStore';
|
|
5
|
+
import { nodeDefinitions } from '../nodeDefinitions';
|
|
6
|
+
import { useAppTheme } from '../hooks/useAppTheme';
|
|
7
|
+
import { ANDROID_SERVICE_NODE_TYPES } from '../nodeDefinitions/androidServiceNodes';
|
|
8
|
+
import { useWebSocket, useWhatsAppStatus } from '../contexts/WebSocketContext';
|
|
9
|
+
import { useApiKeys } from '../hooks/useApiKeys';
|
|
10
|
+
import { getAIProviderIcon } from './icons/AIProviderIcons';
|
|
11
|
+
import { PlayCircleFilled, ScheduleOutlined } from '@ant-design/icons';
|
|
12
|
+
|
|
13
|
+
// Android service nodes that can connect to Android Toolkit as tools
|
|
14
|
+
const ANDROID_TOOL_CAPABLE_NODES = ANDROID_SERVICE_NODE_TYPES;
|
|
15
|
+
|
|
16
|
+
// Nodes with 'tool' in their group can connect to AI Agent/Zeenie tool handles
|
|
17
|
+
const hasToolGroup = (definition: any): boolean => {
|
|
18
|
+
const groups = definition?.group || [];
|
|
19
|
+
return groups.includes('tool');
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// Google Maps node types
|
|
23
|
+
const GOOGLE_MAPS_NODE_TYPES = ['createMap', 'addLocations', 'showNearbyPlaces'];
|
|
24
|
+
|
|
25
|
+
// WhatsApp node types
|
|
26
|
+
const WHATSAPP_NODE_TYPES = ['whatsappSend', 'whatsappReceive', 'whatsappDb'];
|
|
27
|
+
|
|
28
|
+
// Nodes that should not have output handles (input-only nodes)
|
|
29
|
+
const NO_OUTPUT_NODE_TYPES = ['console'];
|
|
30
|
+
|
|
31
|
+
// AI Model node types with their provider IDs
|
|
32
|
+
const AI_MODEL_NODE_TYPES: Record<string, string> = {
|
|
33
|
+
'openaiChatModel': 'openai',
|
|
34
|
+
'anthropicChatModel': 'anthropic',
|
|
35
|
+
'geminiChatModel': 'gemini',
|
|
36
|
+
'openrouterChatModel': 'openrouter',
|
|
37
|
+
'groqChatModel': 'groq',
|
|
38
|
+
'cerebrasChatModel': 'cerebras',
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const SquareNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnectable, selected }) => {
|
|
42
|
+
const theme = useAppTheme();
|
|
43
|
+
const { setSelectedNode, renamingNodeId, setRenamingNodeId, updateNodeData } = useAppStore();
|
|
44
|
+
const [hasApiKey, setHasApiKey] = useState(false);
|
|
45
|
+
const [isConfigured, setIsConfigured] = useState(false);
|
|
46
|
+
const isDisabled = data?.disabled === true;
|
|
47
|
+
|
|
48
|
+
// Inline rename state
|
|
49
|
+
const [isRenaming, setIsRenaming] = useState(false);
|
|
50
|
+
const [editLabel, setEditLabel] = useState('');
|
|
51
|
+
const inputRef = useRef<HTMLInputElement>(null);
|
|
52
|
+
|
|
53
|
+
// Get Android status, node status, and API key status from WebSocket context
|
|
54
|
+
const { androidStatus, getNodeStatus, getApiKeyStatus } = useWebSocket();
|
|
55
|
+
const { getStoredApiKey, isConnected: wsConnected } = useApiKeys();
|
|
56
|
+
const nodeStatus = getNodeStatus(id);
|
|
57
|
+
const executionStatus = nodeStatus?.status || 'idle';
|
|
58
|
+
|
|
59
|
+
// Minimum glow duration state - keeps glow visible for at least 500ms
|
|
60
|
+
const [isGlowing, setIsGlowing] = useState(false);
|
|
61
|
+
const glowTimeoutRef = useRef<NodeJS.Timeout | null>(null);
|
|
62
|
+
|
|
63
|
+
// Track when execution starts to ensure minimum glow duration
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
if (executionStatus === 'executing' || executionStatus === 'waiting') {
|
|
66
|
+
// Start glowing immediately
|
|
67
|
+
setIsGlowing(true);
|
|
68
|
+
// Clear any existing timeout that would stop the glow
|
|
69
|
+
if (glowTimeoutRef.current) {
|
|
70
|
+
clearTimeout(glowTimeoutRef.current);
|
|
71
|
+
glowTimeoutRef.current = null;
|
|
72
|
+
}
|
|
73
|
+
} else if (isGlowing) {
|
|
74
|
+
// Execution ended but we're still glowing - set timeout to stop after minimum duration
|
|
75
|
+
if (!glowTimeoutRef.current) {
|
|
76
|
+
glowTimeoutRef.current = setTimeout(() => {
|
|
77
|
+
setIsGlowing(false);
|
|
78
|
+
glowTimeoutRef.current = null;
|
|
79
|
+
}, 500);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return () => {
|
|
84
|
+
if (glowTimeoutRef.current) {
|
|
85
|
+
clearTimeout(glowTimeoutRef.current);
|
|
86
|
+
glowTimeoutRef.current = null;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}, [executionStatus, isGlowing]);
|
|
90
|
+
|
|
91
|
+
// Check if this is a Google Maps node
|
|
92
|
+
const isGoogleMapsNode = type ? GOOGLE_MAPS_NODE_TYPES.includes(type) : false;
|
|
93
|
+
const googleMapsKeyStatus = isGoogleMapsNode ? getApiKeyStatus('google_maps') : undefined;
|
|
94
|
+
|
|
95
|
+
// Check if this is an AI model node and get reactive API key status
|
|
96
|
+
const isAIModelNode = type ? type in AI_MODEL_NODE_TYPES : false;
|
|
97
|
+
const aiProviderId = type && AI_MODEL_NODE_TYPES[type] ? AI_MODEL_NODE_TYPES[type] : null;
|
|
98
|
+
const aiKeyStatus = aiProviderId ? getApiKeyStatus(aiProviderId) : undefined;
|
|
99
|
+
|
|
100
|
+
const definition = nodeDefinitions[type as keyof typeof nodeDefinitions];
|
|
101
|
+
|
|
102
|
+
// Check if this is an Android node
|
|
103
|
+
const isAndroidNode = type ? ANDROID_SERVICE_NODE_TYPES.includes(type) : false;
|
|
104
|
+
|
|
105
|
+
// Check if this node can be used as a tool (connects to Android Toolkit or AI Agent/Zeenie tool handle)
|
|
106
|
+
const isToolCapable = type ? (ANDROID_TOOL_CAPABLE_NODES.includes(type) || hasToolGroup(definition)) : false;
|
|
107
|
+
|
|
108
|
+
// Android connection status from WebSocket (real-time updates)
|
|
109
|
+
// Service nodes need a paired device to execute, not just relay connection
|
|
110
|
+
const isAndroidConnected = isAndroidNode && androidStatus.paired;
|
|
111
|
+
|
|
112
|
+
// Check if this is a WhatsApp node
|
|
113
|
+
const isWhatsAppNode = type ? WHATSAPP_NODE_TYPES.includes(type) : false;
|
|
114
|
+
|
|
115
|
+
// WhatsApp connection status from WebSocket (real-time updates)
|
|
116
|
+
const whatsappStatus = useWhatsAppStatus();
|
|
117
|
+
|
|
118
|
+
// Execution state - waiting is treated identically to executing
|
|
119
|
+
// Also respect minimum glow duration for fast-executing tools
|
|
120
|
+
const isExecuting = executionStatus === 'executing' || executionStatus === 'waiting' || isGlowing;
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
// Sync with global renaming state
|
|
124
|
+
useEffect(() => {
|
|
125
|
+
if (renamingNodeId === id) {
|
|
126
|
+
setIsRenaming(true);
|
|
127
|
+
setEditLabel(data?.label || definition?.displayName || type || '');
|
|
128
|
+
} else {
|
|
129
|
+
setIsRenaming(false);
|
|
130
|
+
}
|
|
131
|
+
}, [renamingNodeId, id, data?.label, definition?.displayName, type]);
|
|
132
|
+
|
|
133
|
+
// Focus and select input when entering rename mode
|
|
134
|
+
useEffect(() => {
|
|
135
|
+
if (isRenaming && inputRef.current) {
|
|
136
|
+
inputRef.current.focus();
|
|
137
|
+
inputRef.current.select();
|
|
138
|
+
}
|
|
139
|
+
}, [isRenaming]);
|
|
140
|
+
|
|
141
|
+
// Handle save rename
|
|
142
|
+
const handleSaveRename = useCallback(() => {
|
|
143
|
+
const newLabel = editLabel.trim();
|
|
144
|
+
const originalLabel = data?.label || definition?.displayName || type || '';
|
|
145
|
+
|
|
146
|
+
// Only save if label changed and is not empty
|
|
147
|
+
if (newLabel && newLabel !== originalLabel) {
|
|
148
|
+
updateNodeData(id, { ...data, label: newLabel });
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
setIsRenaming(false);
|
|
152
|
+
setRenamingNodeId(null);
|
|
153
|
+
}, [editLabel, data, definition?.displayName, type, id, updateNodeData, setRenamingNodeId]);
|
|
154
|
+
|
|
155
|
+
// Handle cancel rename
|
|
156
|
+
const handleCancelRename = useCallback(() => {
|
|
157
|
+
setIsRenaming(false);
|
|
158
|
+
setRenamingNodeId(null);
|
|
159
|
+
}, [setRenamingNodeId]);
|
|
160
|
+
|
|
161
|
+
// Handle double-click to rename
|
|
162
|
+
const handleLabelDoubleClick = useCallback(() => {
|
|
163
|
+
setRenamingNodeId(id);
|
|
164
|
+
}, [id, setRenamingNodeId]);
|
|
165
|
+
|
|
166
|
+
// Check API key and configuration status
|
|
167
|
+
useEffect(() => {
|
|
168
|
+
// Only run when WebSocket is connected
|
|
169
|
+
if (!wsConnected) return;
|
|
170
|
+
|
|
171
|
+
const checkConfiguration = async () => {
|
|
172
|
+
try {
|
|
173
|
+
// Determine provider from node definition credentials
|
|
174
|
+
let provider = '';
|
|
175
|
+
const credentials = definition?.credentials?.[0];
|
|
176
|
+
if (credentials?.name) {
|
|
177
|
+
// Map credential names to provider keys
|
|
178
|
+
const credentialToProvider: Record<string, string> = {
|
|
179
|
+
'googleMapsApi': 'google_maps',
|
|
180
|
+
'openaiApi': 'openai',
|
|
181
|
+
'anthropicApi': 'anthropic',
|
|
182
|
+
'googleAiApi': 'gemini'
|
|
183
|
+
};
|
|
184
|
+
provider = credentialToProvider[credentials.name] || '';
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Fallback: extract provider from node type if not found in credentials
|
|
188
|
+
if (!provider) {
|
|
189
|
+
if (type?.includes('map') || type?.includes('location')) provider = 'google_maps';
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Check if API key exists via WebSocket
|
|
193
|
+
const apiKey = provider ? await getStoredApiKey(provider) : null;
|
|
194
|
+
setHasApiKey(!!apiKey);
|
|
195
|
+
|
|
196
|
+
// Check if service is configured (has required parameters)
|
|
197
|
+
const hasRequiredParams = data && Object.keys(data).length > 0;
|
|
198
|
+
setIsConfigured(hasRequiredParams && !!apiKey);
|
|
199
|
+
|
|
200
|
+
if (!apiKey && provider) {
|
|
201
|
+
console.warn(`[SquareNode] ${definition?.displayName} ${id}: No API key configured for ${provider}`);
|
|
202
|
+
}
|
|
203
|
+
} catch (error) {
|
|
204
|
+
console.error('Configuration check error:', error);
|
|
205
|
+
setHasApiKey(false);
|
|
206
|
+
setIsConfigured(false);
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
checkConfiguration();
|
|
211
|
+
}, [data, id, type, definition?.displayName, definition?.credentials, isGoogleMapsNode, getStoredApiKey, wsConnected]);
|
|
212
|
+
|
|
213
|
+
const handleParametersClick = (e: React.MouseEvent) => {
|
|
214
|
+
e.stopPropagation();
|
|
215
|
+
setSelectedNode({ id, type, data, position: { x: 0, y: 0 } });
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
// Get status indicator color based on execution state
|
|
219
|
+
const getStatusIndicatorColor = () => {
|
|
220
|
+
// For executing or waiting state, show blue/cyan
|
|
221
|
+
if (executionStatus === 'executing' || executionStatus === 'waiting') {
|
|
222
|
+
return theme.dracula.cyan;
|
|
223
|
+
}
|
|
224
|
+
if (executionStatus === 'success') {
|
|
225
|
+
return theme.dracula.green;
|
|
226
|
+
}
|
|
227
|
+
if (executionStatus === 'error') {
|
|
228
|
+
return theme.dracula.red;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// Idle state - use Android or configuration status
|
|
232
|
+
if (isAndroidNode) {
|
|
233
|
+
return isAndroidConnected ? theme.dracula.green : theme.dracula.red;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// WhatsApp nodes - use WebSocket connection status
|
|
237
|
+
if (isWhatsAppNode) {
|
|
238
|
+
if (whatsappStatus.connected) return theme.dracula.green;
|
|
239
|
+
if (whatsappStatus.pairing) return theme.dracula.orange;
|
|
240
|
+
return theme.dracula.red;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// Google Maps nodes - use WebSocket API key validation status
|
|
244
|
+
if (isGoogleMapsNode && googleMapsKeyStatus) {
|
|
245
|
+
return googleMapsKeyStatus.valid ? theme.dracula.green : theme.dracula.red;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// AI Model nodes - use reactive WebSocket API key status
|
|
249
|
+
if (isAIModelNode) {
|
|
250
|
+
if (aiKeyStatus?.valid && aiKeyStatus?.hasKey) return theme.dracula.green;
|
|
251
|
+
if (aiKeyStatus?.hasKey) return theme.dracula.orange;
|
|
252
|
+
return theme.dracula.red;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
return isConfigured ? theme.dracula.green : hasApiKey ? theme.dracula.orange : theme.dracula.red;
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
const getStatusTitle = () => {
|
|
259
|
+
switch (executionStatus) {
|
|
260
|
+
case 'executing':
|
|
261
|
+
return 'Executing...';
|
|
262
|
+
case 'waiting':
|
|
263
|
+
return nodeStatus?.message || 'Waiting for event...';
|
|
264
|
+
case 'success':
|
|
265
|
+
return 'Execution successful';
|
|
266
|
+
case 'error':
|
|
267
|
+
return `Error: ${nodeStatus?.data?.error || 'Unknown error'}`;
|
|
268
|
+
default:
|
|
269
|
+
if (isAndroidNode) {
|
|
270
|
+
return isAndroidConnected ? 'Android device connected' : 'Android device not connected';
|
|
271
|
+
}
|
|
272
|
+
// WhatsApp nodes - use WebSocket connection status
|
|
273
|
+
if (isWhatsAppNode) {
|
|
274
|
+
if (whatsappStatus.connected) return 'WhatsApp connected';
|
|
275
|
+
if (whatsappStatus.pairing) return 'Pairing in progress...';
|
|
276
|
+
if (whatsappStatus.running) return 'WhatsApp service running';
|
|
277
|
+
return 'WhatsApp not connected';
|
|
278
|
+
}
|
|
279
|
+
// Google Maps nodes - use WebSocket API key validation status
|
|
280
|
+
if (isGoogleMapsNode && googleMapsKeyStatus) {
|
|
281
|
+
return googleMapsKeyStatus.valid
|
|
282
|
+
? 'Google Maps API key validated'
|
|
283
|
+
: `API key invalid: ${googleMapsKeyStatus.message || 'Validation failed'}`;
|
|
284
|
+
}
|
|
285
|
+
// AI Model nodes - use reactive WebSocket API key status
|
|
286
|
+
if (isAIModelNode) {
|
|
287
|
+
if (aiKeyStatus?.valid && aiKeyStatus?.hasKey) {
|
|
288
|
+
return `${aiProviderId?.charAt(0).toUpperCase()}${aiProviderId?.slice(1)} API key validated`;
|
|
289
|
+
}
|
|
290
|
+
if (aiKeyStatus?.hasKey) {
|
|
291
|
+
return 'API key found, validation pending';
|
|
292
|
+
}
|
|
293
|
+
return 'API key required - configure in Credentials';
|
|
294
|
+
}
|
|
295
|
+
return isConfigured
|
|
296
|
+
? 'Service configured and ready'
|
|
297
|
+
: hasApiKey
|
|
298
|
+
? 'API key found, service needs configuration'
|
|
299
|
+
: 'API key required';
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
// Common icon name to emoji mapping for fallback
|
|
304
|
+
const iconNameToEmoji: Record<string, string> = {
|
|
305
|
+
brain: '🧠',
|
|
306
|
+
memory: '🧠',
|
|
307
|
+
robot: '🤖',
|
|
308
|
+
ai: '🤖',
|
|
309
|
+
agent: '🤖',
|
|
310
|
+
chat: '💬',
|
|
311
|
+
message: '💬',
|
|
312
|
+
whatsapp: '📱',
|
|
313
|
+
phone: '📱',
|
|
314
|
+
email: '📧',
|
|
315
|
+
mail: '📧',
|
|
316
|
+
webhook: '🔗',
|
|
317
|
+
http: '🌐',
|
|
318
|
+
api: '🔌',
|
|
319
|
+
database: '🗄️',
|
|
320
|
+
file: '📄',
|
|
321
|
+
folder: '📁',
|
|
322
|
+
code: '💻',
|
|
323
|
+
python: '🐍',
|
|
324
|
+
javascript: '📜',
|
|
325
|
+
settings: '⚙️',
|
|
326
|
+
config: '⚙️',
|
|
327
|
+
clock: '⏰',
|
|
328
|
+
schedule: '📅',
|
|
329
|
+
location: '📍',
|
|
330
|
+
map: '🗺️',
|
|
331
|
+
search: '🔍',
|
|
332
|
+
filter: '🔍',
|
|
333
|
+
play: '▶️',
|
|
334
|
+
start: '▶️',
|
|
335
|
+
stop: '⏹️',
|
|
336
|
+
pause: '⏸️',
|
|
337
|
+
send: '📤',
|
|
338
|
+
receive: '📥',
|
|
339
|
+
upload: '⬆️',
|
|
340
|
+
download: '⬇️',
|
|
341
|
+
sync: '🔄',
|
|
342
|
+
refresh: '🔄',
|
|
343
|
+
warning: '⚠️',
|
|
344
|
+
error: '❌',
|
|
345
|
+
success: '✅',
|
|
346
|
+
info: '💡',
|
|
347
|
+
help: '❓',
|
|
348
|
+
user: '👤',
|
|
349
|
+
users: '👥',
|
|
350
|
+
key: '🔑',
|
|
351
|
+
lock: '🔒',
|
|
352
|
+
unlock: '🔓',
|
|
353
|
+
star: '⭐',
|
|
354
|
+
heart: '❤️',
|
|
355
|
+
thunder: '⚡',
|
|
356
|
+
lightning: '⚡',
|
|
357
|
+
fire: '🔥',
|
|
358
|
+
water: '💧',
|
|
359
|
+
cloud: '☁️',
|
|
360
|
+
sun: '☀️',
|
|
361
|
+
moon: '🌙',
|
|
362
|
+
camera: '📷',
|
|
363
|
+
image: '🖼️',
|
|
364
|
+
video: '🎬',
|
|
365
|
+
audio: '🔊',
|
|
366
|
+
music: '🎵',
|
|
367
|
+
bell: '🔔',
|
|
368
|
+
notification: '🔔',
|
|
369
|
+
link: '🔗',
|
|
370
|
+
chain: '🔗',
|
|
371
|
+
tool: '🔧',
|
|
372
|
+
wrench: '🔧',
|
|
373
|
+
hammer: '🔨',
|
|
374
|
+
gear: '⚙️',
|
|
375
|
+
cog: '⚙️',
|
|
376
|
+
bug: '🐛',
|
|
377
|
+
debug: '🐛',
|
|
378
|
+
test: '🧪',
|
|
379
|
+
experiment: '🧪',
|
|
380
|
+
lab: '🧪',
|
|
381
|
+
book: '📖',
|
|
382
|
+
docs: '📚',
|
|
383
|
+
note: '📝',
|
|
384
|
+
edit: '✏️',
|
|
385
|
+
pencil: '✏️',
|
|
386
|
+
trash: '🗑️',
|
|
387
|
+
delete: '🗑️',
|
|
388
|
+
copy: '📋',
|
|
389
|
+
paste: '📋',
|
|
390
|
+
cut: '✂️',
|
|
391
|
+
scissors: '✂️',
|
|
392
|
+
tag: '🏷️',
|
|
393
|
+
label: '🏷️',
|
|
394
|
+
flag: '🚩',
|
|
395
|
+
bookmark: '🔖',
|
|
396
|
+
pin: '📌',
|
|
397
|
+
target: '🎯',
|
|
398
|
+
goal: '🎯',
|
|
399
|
+
trophy: '🏆',
|
|
400
|
+
medal: '🏅',
|
|
401
|
+
gift: '🎁',
|
|
402
|
+
package: '📦',
|
|
403
|
+
box: '📦',
|
|
404
|
+
truck: '🚚',
|
|
405
|
+
shipping: '🚚',
|
|
406
|
+
cart: '🛒',
|
|
407
|
+
shop: '🛍️',
|
|
408
|
+
store: '🏪',
|
|
409
|
+
money: '💰',
|
|
410
|
+
dollar: '💵',
|
|
411
|
+
credit: '💳',
|
|
412
|
+
payment: '💳',
|
|
413
|
+
chart: '📊',
|
|
414
|
+
graph: '📈',
|
|
415
|
+
analytics: '📊',
|
|
416
|
+
stats: '📊',
|
|
417
|
+
dashboard: '📊',
|
|
418
|
+
terminal: '💻',
|
|
419
|
+
console: '💻',
|
|
420
|
+
server: '🖥️',
|
|
421
|
+
computer: '💻',
|
|
422
|
+
mobile: '📱',
|
|
423
|
+
tablet: '📱',
|
|
424
|
+
battery: '🔋',
|
|
425
|
+
wifi: '📶',
|
|
426
|
+
bluetooth: '📶',
|
|
427
|
+
antenna: '📡',
|
|
428
|
+
satellite: '🛰️',
|
|
429
|
+
rocket: '🚀',
|
|
430
|
+
plane: '✈️',
|
|
431
|
+
car: '🚗',
|
|
432
|
+
bike: '🚲',
|
|
433
|
+
train: '🚂',
|
|
434
|
+
ship: '🚢',
|
|
435
|
+
home: '🏠',
|
|
436
|
+
house: '🏠',
|
|
437
|
+
building: '🏢',
|
|
438
|
+
office: '🏢',
|
|
439
|
+
factory: '🏭',
|
|
440
|
+
hospital: '🏥',
|
|
441
|
+
school: '🏫',
|
|
442
|
+
university: '🎓',
|
|
443
|
+
graduation: '🎓',
|
|
444
|
+
world: '🌍',
|
|
445
|
+
globe: '🌐',
|
|
446
|
+
earth: '🌍',
|
|
447
|
+
android: '🤖',
|
|
448
|
+
apple: '🍎',
|
|
449
|
+
windows: '🪟',
|
|
450
|
+
linux: '🐧',
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
// Check if string is likely an emoji (contains emoji characters)
|
|
454
|
+
const isEmoji = (str: string): boolean => {
|
|
455
|
+
// Emoji regex pattern - matches most common emojis
|
|
456
|
+
const emojiRegex = /[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|[\u{1F600}-\u{1F64F}]|[\u{1F680}-\u{1F6FF}]|[\u{1F1E0}-\u{1F1FF}]|[\u{2300}-\u{23FF}]|[\u{2B50}]|[\u{231A}-\u{231B}]|[\u{25AA}-\u{25AB}]|[\u{25B6}]|[\u{25C0}]|[\u{25FB}-\u{25FE}]|[\u{2614}-\u{2615}]|[\u{2648}-\u{2653}]|[\u{267F}]|[\u{2693}]|[\u{26A1}]|[\u{26AA}-\u{26AB}]|[\u{26BD}-\u{26BE}]|[\u{26C4}-\u{26C5}]|[\u{26CE}]|[\u{26D4}]|[\u{26EA}]|[\u{26F2}-\u{26F3}]|[\u{26F5}]|[\u{26FA}]|[\u{26FD}]|[\u{2702}]|[\u{2705}]|[\u{2708}-\u{270D}]|[\u{270F}]|[\u{2712}]|[\u{2714}]|[\u{2716}]|[\u{271D}]|[\u{2721}]|[\u{2728}]|[\u{2733}-\u{2734}]|[\u{2744}]|[\u{2747}]|[\u{274C}]|[\u{274E}]|[\u{2753}-\u{2755}]|[\u{2757}]|[\u{2763}-\u{2764}]|[\u{2795}-\u{2797}]|[\u{27A1}]|[\u{27B0}]|[\u{27BF}]|[\u{E000}-\u{F8FF}]/u;
|
|
457
|
+
return emojiRegex.test(str);
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
// Helper to render icon (handles URLs, emojis, and icon names)
|
|
461
|
+
const renderIcon = (icon: string) => {
|
|
462
|
+
// Handle image URLs
|
|
463
|
+
if (icon.startsWith('http') || icon.startsWith('data:') || icon.startsWith('/')) {
|
|
464
|
+
return (
|
|
465
|
+
<img
|
|
466
|
+
src={icon}
|
|
467
|
+
alt="icon"
|
|
468
|
+
style={{
|
|
469
|
+
width: '28px',
|
|
470
|
+
height: '28px',
|
|
471
|
+
objectFit: 'contain',
|
|
472
|
+
borderRadius: '4px'
|
|
473
|
+
}}
|
|
474
|
+
/>
|
|
475
|
+
);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
// If it's already an emoji, return it directly
|
|
479
|
+
if (isEmoji(icon)) {
|
|
480
|
+
return icon;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
// Check if it's a known icon name and convert to emoji
|
|
484
|
+
const lowerIcon = icon.toLowerCase().trim();
|
|
485
|
+
if (iconNameToEmoji[lowerIcon]) {
|
|
486
|
+
return iconNameToEmoji[lowerIcon];
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
// Fallback: return a generic icon instead of plain text
|
|
490
|
+
console.warn(`[SquareNode] Unknown icon name "${icon}" - using fallback. Add emoji directly or update iconNameToEmoji mapping.`);
|
|
491
|
+
return '📦';
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
// Get service icon for display
|
|
495
|
+
const getServiceIcon = () => {
|
|
496
|
+
// Priority 0: Start node - use PlayCircleFilled icon with cyan color (neutral "begin" color)
|
|
497
|
+
if (type === 'start') {
|
|
498
|
+
return <PlayCircleFilled style={{ fontSize: 28, color: theme.dracula.cyan }} />;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
// Cron Scheduler node - use ScheduleOutlined with node definition color
|
|
502
|
+
if (type === 'cronScheduler') {
|
|
503
|
+
return <ScheduleOutlined style={{ fontSize: 28, color: definition?.defaults?.color || nodeColor }} />;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
// Priority 1: Check if this is an AI model node - use official provider icons
|
|
507
|
+
if (type && AI_MODEL_NODE_TYPES[type]) {
|
|
508
|
+
const providerId = AI_MODEL_NODE_TYPES[type];
|
|
509
|
+
const IconComponent = getAIProviderIcon(providerId);
|
|
510
|
+
if (IconComponent) {
|
|
511
|
+
return <IconComponent size={28} />;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
// Priority 2: Custom icon set on the node instance (via data.customIcon)
|
|
516
|
+
if (data?.customIcon && typeof data.customIcon === 'string') {
|
|
517
|
+
return renderIcon(data.customIcon);
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
// Priority 3: Use the icon from the node definition if available
|
|
521
|
+
if (definition?.icon && typeof definition.icon === 'string') {
|
|
522
|
+
return renderIcon(definition.icon);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
// Fallback logic based on node type
|
|
526
|
+
if (type?.includes('createMap')) return '🗺️';
|
|
527
|
+
if (type?.includes('addLocations')) return '🌍';
|
|
528
|
+
if (type?.includes('showNearbyPlaces')) return '🔍';
|
|
529
|
+
|
|
530
|
+
return '📍';
|
|
531
|
+
};
|
|
532
|
+
|
|
533
|
+
// Get the node color from definition or use default
|
|
534
|
+
const nodeColor = definition?.defaults?.color || '#1A73E8';
|
|
535
|
+
|
|
536
|
+
return (
|
|
537
|
+
<div
|
|
538
|
+
style={{
|
|
539
|
+
position: 'relative',
|
|
540
|
+
display: 'flex',
|
|
541
|
+
flexDirection: 'column',
|
|
542
|
+
alignItems: 'center',
|
|
543
|
+
fontFamily: 'system-ui, -apple-system, sans-serif',
|
|
544
|
+
fontSize: '11px',
|
|
545
|
+
cursor: 'pointer',
|
|
546
|
+
}}
|
|
547
|
+
>
|
|
548
|
+
{/* Main Square Node */}
|
|
549
|
+
<div
|
|
550
|
+
style={{
|
|
551
|
+
position: 'relative',
|
|
552
|
+
width: theme.nodeSize.square,
|
|
553
|
+
height: theme.nodeSize.square,
|
|
554
|
+
borderRadius: theme.borderRadius.lg,
|
|
555
|
+
background: theme.isDarkMode
|
|
556
|
+
? `linear-gradient(135deg, ${nodeColor}25 0%, ${theme.colors.background} 100%)`
|
|
557
|
+
: `linear-gradient(145deg, #ffffff 0%, ${nodeColor}08 100%)`,
|
|
558
|
+
border: `2px solid ${isExecuting
|
|
559
|
+
? (theme.isDarkMode ? theme.dracula.cyan : '#2563eb')
|
|
560
|
+
: selected
|
|
561
|
+
? theme.colors.focus
|
|
562
|
+
: theme.isDarkMode ? nodeColor + '80' : `${nodeColor}40`}`,
|
|
563
|
+
display: 'flex',
|
|
564
|
+
alignItems: 'center',
|
|
565
|
+
justifyContent: 'center',
|
|
566
|
+
color: theme.colors.text,
|
|
567
|
+
fontSize: theme.nodeSize.squareIcon,
|
|
568
|
+
fontWeight: '600',
|
|
569
|
+
transition: 'all 0.2s ease',
|
|
570
|
+
boxShadow: isExecuting
|
|
571
|
+
? theme.isDarkMode
|
|
572
|
+
? `0 4px 12px ${theme.dracula.cyan}66, 0 0 0 3px ${theme.dracula.cyan}4D`
|
|
573
|
+
: `0 0 0 3px rgba(37, 99, 235, 0.5), 0 4px 16px rgba(37, 99, 235, 0.35)`
|
|
574
|
+
: selected
|
|
575
|
+
? `0 4px 12px ${theme.colors.focusRing}, 0 0 0 1px ${theme.colors.focusRing}`
|
|
576
|
+
: theme.isDarkMode
|
|
577
|
+
? `0 2px 8px ${nodeColor}40`
|
|
578
|
+
: `0 2px 8px ${nodeColor}20, 0 4px 12px rgba(0,0,0,0.06)`,
|
|
579
|
+
animation: isExecuting ? 'pulse 1.5s ease-in-out infinite' : 'none',
|
|
580
|
+
opacity: isDisabled ? 0.5 : 1,
|
|
581
|
+
}}
|
|
582
|
+
>
|
|
583
|
+
{/* Disabled Overlay */}
|
|
584
|
+
{isDisabled && (
|
|
585
|
+
<div style={{
|
|
586
|
+
position: 'absolute',
|
|
587
|
+
top: 0,
|
|
588
|
+
left: 0,
|
|
589
|
+
right: 0,
|
|
590
|
+
bottom: 0,
|
|
591
|
+
backgroundColor: 'rgba(128, 128, 128, 0.4)',
|
|
592
|
+
borderRadius: 'inherit',
|
|
593
|
+
zIndex: 35,
|
|
594
|
+
display: 'flex',
|
|
595
|
+
alignItems: 'center',
|
|
596
|
+
justifyContent: 'center',
|
|
597
|
+
pointerEvents: 'none',
|
|
598
|
+
}}>
|
|
599
|
+
<span style={{ fontSize: '20px', opacity: 0.8, color: theme.colors.textSecondary }}>||</span>
|
|
600
|
+
</div>
|
|
601
|
+
)}
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
{/* Service Icon */}
|
|
605
|
+
{getServiceIcon()}
|
|
606
|
+
|
|
607
|
+
{/* Parameters Button */}
|
|
608
|
+
<button
|
|
609
|
+
onClick={handleParametersClick}
|
|
610
|
+
style={{
|
|
611
|
+
position: 'absolute',
|
|
612
|
+
top: '-8px',
|
|
613
|
+
right: '-8px',
|
|
614
|
+
width: theme.nodeSize.paramButton,
|
|
615
|
+
height: theme.nodeSize.paramButton,
|
|
616
|
+
borderRadius: theme.borderRadius.sm,
|
|
617
|
+
backgroundColor: theme.isDarkMode ? theme.colors.backgroundAlt : '#ffffff',
|
|
618
|
+
border: `1px solid ${theme.isDarkMode ? theme.colors.border : '#d1d5db'}`,
|
|
619
|
+
cursor: 'pointer',
|
|
620
|
+
display: 'flex',
|
|
621
|
+
alignItems: 'center',
|
|
622
|
+
justifyContent: 'center',
|
|
623
|
+
fontSize: theme.fontSize.xs,
|
|
624
|
+
color: theme.colors.textSecondary,
|
|
625
|
+
fontWeight: '400',
|
|
626
|
+
transition: theme.transitions.fast,
|
|
627
|
+
zIndex: 30,
|
|
628
|
+
boxShadow: theme.isDarkMode
|
|
629
|
+
? `0 1px 3px ${theme.colors.shadow}`
|
|
630
|
+
: '0 1px 4px rgba(0,0,0,0.1)'
|
|
631
|
+
}}
|
|
632
|
+
title="Edit Service Parameters"
|
|
633
|
+
>
|
|
634
|
+
⚙️
|
|
635
|
+
</button>
|
|
636
|
+
|
|
637
|
+
{/* Configuration/Execution Status Indicator */}
|
|
638
|
+
<div
|
|
639
|
+
style={{
|
|
640
|
+
position: 'absolute',
|
|
641
|
+
top: '-4px',
|
|
642
|
+
left: '-4px',
|
|
643
|
+
width: theme.nodeSize.statusIndicator,
|
|
644
|
+
height: theme.nodeSize.statusIndicator,
|
|
645
|
+
borderRadius: '50%',
|
|
646
|
+
backgroundColor: getStatusIndicatorColor(),
|
|
647
|
+
border: `2px solid ${theme.isDarkMode ? theme.colors.background : '#ffffff'}`,
|
|
648
|
+
boxShadow: isExecuting
|
|
649
|
+
? theme.isDarkMode
|
|
650
|
+
? `0 0 6px ${theme.dracula.cyan}80`
|
|
651
|
+
: '0 0 4px rgba(37, 99, 235, 0.5)'
|
|
652
|
+
: theme.isDarkMode
|
|
653
|
+
? `0 1px 2px ${theme.colors.shadow}`
|
|
654
|
+
: '0 1px 3px rgba(0,0,0,0.15)',
|
|
655
|
+
zIndex: 30,
|
|
656
|
+
animation: isExecuting ? 'pulse 1s ease-in-out infinite' : 'none',
|
|
657
|
+
}}
|
|
658
|
+
title={getStatusTitle()}
|
|
659
|
+
/>
|
|
660
|
+
|
|
661
|
+
{/* Square Input Handle */}
|
|
662
|
+
<Handle
|
|
663
|
+
id="input-main"
|
|
664
|
+
type="target"
|
|
665
|
+
position={Position.Left}
|
|
666
|
+
isConnectable={isConnectable}
|
|
667
|
+
style={{
|
|
668
|
+
position: 'absolute',
|
|
669
|
+
left: '-6px',
|
|
670
|
+
top: '50%',
|
|
671
|
+
transform: 'translateY(-50%)',
|
|
672
|
+
width: theme.nodeSize.handle,
|
|
673
|
+
height: theme.nodeSize.handle,
|
|
674
|
+
backgroundColor: theme.isDarkMode ? theme.colors.background : '#ffffff',
|
|
675
|
+
border: `2px solid ${theme.isDarkMode ? theme.colors.textSecondary : '#6b7280'}`,
|
|
676
|
+
borderRadius: '50%',
|
|
677
|
+
zIndex: 20
|
|
678
|
+
}}
|
|
679
|
+
title="Service Input"
|
|
680
|
+
/>
|
|
681
|
+
|
|
682
|
+
{/* Square Output Handle - hidden for input-only nodes like console */}
|
|
683
|
+
{!NO_OUTPUT_NODE_TYPES.includes(type || '') && (
|
|
684
|
+
<Handle
|
|
685
|
+
id="output-main"
|
|
686
|
+
type="source"
|
|
687
|
+
position={Position.Right}
|
|
688
|
+
isConnectable={isConnectable}
|
|
689
|
+
style={{
|
|
690
|
+
position: 'absolute',
|
|
691
|
+
right: '-6px',
|
|
692
|
+
top: '50%',
|
|
693
|
+
transform: 'translateY(-50%)',
|
|
694
|
+
width: theme.nodeSize.handle,
|
|
695
|
+
height: theme.nodeSize.handle,
|
|
696
|
+
backgroundColor: isConfigured ? nodeColor : theme.colors.textSecondary,
|
|
697
|
+
border: `2px solid ${theme.isDarkMode ? theme.colors.background : '#ffffff'}`,
|
|
698
|
+
borderRadius: '50%',
|
|
699
|
+
zIndex: 20
|
|
700
|
+
}}
|
|
701
|
+
title="Service Output"
|
|
702
|
+
/>
|
|
703
|
+
)}
|
|
704
|
+
|
|
705
|
+
{/* Top Tool Output Handle - for nodes that can connect to AI Agent/Zeenie tool handle */}
|
|
706
|
+
{isToolCapable && (
|
|
707
|
+
<Handle
|
|
708
|
+
id="output-tool"
|
|
709
|
+
type="source"
|
|
710
|
+
position={Position.Top}
|
|
711
|
+
isConnectable={isConnectable}
|
|
712
|
+
style={{
|
|
713
|
+
position: 'absolute',
|
|
714
|
+
top: '-6px',
|
|
715
|
+
left: '50%',
|
|
716
|
+
transform: 'translateX(-50%)',
|
|
717
|
+
width: theme.nodeSize.handle,
|
|
718
|
+
height: theme.nodeSize.handle,
|
|
719
|
+
backgroundColor: ANDROID_TOOL_CAPABLE_NODES.includes(type || '') ? '#3DDC84' : nodeColor, // Android green for Android nodes, node color for others
|
|
720
|
+
border: `2px solid ${theme.isDarkMode ? theme.colors.background : '#ffffff'}`,
|
|
721
|
+
borderRadius: '50%',
|
|
722
|
+
zIndex: 20
|
|
723
|
+
}}
|
|
724
|
+
title={ANDROID_TOOL_CAPABLE_NODES.includes(type || '') ? 'Connect to Android Toolkit' : 'Connect to AI Agent/Zeenie tool handle'}
|
|
725
|
+
/>
|
|
726
|
+
)}
|
|
727
|
+
|
|
728
|
+
{/* Output Data Indicator - shows when node has execution output */}
|
|
729
|
+
{executionStatus === 'success' && nodeStatus?.data && (
|
|
730
|
+
<div
|
|
731
|
+
style={{
|
|
732
|
+
position: 'absolute',
|
|
733
|
+
bottom: '-4px',
|
|
734
|
+
right: '-4px',
|
|
735
|
+
width: theme.nodeSize.outputBadge,
|
|
736
|
+
height: theme.nodeSize.outputBadge,
|
|
737
|
+
borderRadius: theme.borderRadius.sm,
|
|
738
|
+
backgroundColor: theme.dracula.green,
|
|
739
|
+
border: `1px solid ${theme.isDarkMode ? theme.colors.background : '#ffffff'}`,
|
|
740
|
+
display: 'flex',
|
|
741
|
+
alignItems: 'center',
|
|
742
|
+
justifyContent: 'center',
|
|
743
|
+
fontSize: theme.fontSize.xs,
|
|
744
|
+
color: 'white',
|
|
745
|
+
fontWeight: 'bold',
|
|
746
|
+
zIndex: 30,
|
|
747
|
+
boxShadow: theme.isDarkMode
|
|
748
|
+
? '0 1px 3px rgba(0,0,0,0.2)'
|
|
749
|
+
: '0 1px 3px rgba(0,0,0,0.15)',
|
|
750
|
+
}}
|
|
751
|
+
title="Output data available - click node to view"
|
|
752
|
+
>
|
|
753
|
+
<span style={{ lineHeight: 1 }}>D</span>
|
|
754
|
+
</div>
|
|
755
|
+
)}
|
|
756
|
+
</div>
|
|
757
|
+
|
|
758
|
+
{/* Service Name Below Square */}
|
|
759
|
+
{isRenaming ? (
|
|
760
|
+
<input
|
|
761
|
+
ref={inputRef}
|
|
762
|
+
type="text"
|
|
763
|
+
value={editLabel}
|
|
764
|
+
onChange={(e) => setEditLabel(e.target.value)}
|
|
765
|
+
onKeyDown={(e) => {
|
|
766
|
+
if (e.key === 'Enter') {
|
|
767
|
+
handleSaveRename();
|
|
768
|
+
} else if (e.key === 'Escape') {
|
|
769
|
+
handleCancelRename();
|
|
770
|
+
}
|
|
771
|
+
e.stopPropagation();
|
|
772
|
+
}}
|
|
773
|
+
onBlur={handleSaveRename}
|
|
774
|
+
onClick={(e) => e.stopPropagation()}
|
|
775
|
+
style={{
|
|
776
|
+
marginTop: theme.spacing.sm,
|
|
777
|
+
width: '100%',
|
|
778
|
+
maxWidth: '120px',
|
|
779
|
+
padding: '2px 4px',
|
|
780
|
+
fontSize: theme.fontSize.sm,
|
|
781
|
+
fontWeight: theme.fontWeight.medium,
|
|
782
|
+
color: theme.colors.text,
|
|
783
|
+
backgroundColor: theme.colors.backgroundElevated,
|
|
784
|
+
border: `1px solid ${theme.dracula.purple}`,
|
|
785
|
+
borderRadius: theme.borderRadius.sm,
|
|
786
|
+
outline: 'none',
|
|
787
|
+
textAlign: 'center',
|
|
788
|
+
}}
|
|
789
|
+
/>
|
|
790
|
+
) : (
|
|
791
|
+
<div
|
|
792
|
+
onDoubleClick={handleLabelDoubleClick}
|
|
793
|
+
style={{
|
|
794
|
+
marginTop: theme.spacing.sm,
|
|
795
|
+
fontSize: theme.fontSize.sm,
|
|
796
|
+
fontWeight: theme.fontWeight.medium,
|
|
797
|
+
color: theme.colors.text,
|
|
798
|
+
lineHeight: '1.2',
|
|
799
|
+
textAlign: 'center',
|
|
800
|
+
maxWidth: '120px',
|
|
801
|
+
cursor: 'text',
|
|
802
|
+
}}
|
|
803
|
+
title="Double-click to rename"
|
|
804
|
+
>
|
|
805
|
+
{data?.label || definition?.displayName}
|
|
806
|
+
</div>
|
|
807
|
+
)}
|
|
808
|
+
|
|
809
|
+
</div>
|
|
810
|
+
);
|
|
811
|
+
};
|
|
812
|
+
|
|
797
813
|
export default SquareNode;
|