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,571 +1,867 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import ParameterRenderer from '../ParameterRenderer';
|
|
3
|
-
import ToolSchemaEditor from './ToolSchemaEditor';
|
|
4
|
-
import { useAppTheme } from '../../hooks/useAppTheme';
|
|
5
|
-
import { useAppStore } from '../../store/useAppStore';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
const [
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const
|
|
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
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
//
|
|
127
|
-
const
|
|
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
|
-
|
|
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
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
color: theme.
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
</
|
|
316
|
-
</div>
|
|
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
|
-
|
|
464
|
-
|
|
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
|
-
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import ParameterRenderer from '../ParameterRenderer';
|
|
3
|
+
import ToolSchemaEditor from './ToolSchemaEditor';
|
|
4
|
+
import { useAppTheme } from '../../hooks/useAppTheme';
|
|
5
|
+
import { useAppStore } from '../../store/useAppStore';
|
|
6
|
+
import { useWebSocket } from '../../contexts/WebSocketContext';
|
|
7
|
+
import { nodeDefinitions } from '../../nodeDefinitions';
|
|
8
|
+
import { INodeTypeDescription, INodeProperties } from '../../types/INodeProperties';
|
|
9
|
+
import { ExecutionResult } from '../../services/executionService';
|
|
10
|
+
import { Edge } from 'reactflow';
|
|
11
|
+
import { SKILL_NODE_TYPES } from '../../nodeDefinitions/skillNodes';
|
|
12
|
+
|
|
13
|
+
// Tool node types that support schema editing
|
|
14
|
+
const TOOL_NODE_TYPES = ['androidTool', 'calculatorTool', 'currentTimeTool', 'webSearchTool'];
|
|
15
|
+
|
|
16
|
+
interface ConnectedSkill {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
type: string;
|
|
20
|
+
icon: string;
|
|
21
|
+
description: string;
|
|
22
|
+
color: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface MiddleSectionProps {
|
|
26
|
+
nodeId: string;
|
|
27
|
+
nodeDefinition: INodeTypeDescription;
|
|
28
|
+
parameters: Record<string, any>;
|
|
29
|
+
onParameterChange: (paramName: string, value: any) => void;
|
|
30
|
+
isLoadingParameters?: boolean;
|
|
31
|
+
executionResults?: ExecutionResult[];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const shouldShowParameter = (param: INodeProperties, allParameters: Record<string, any>): boolean => {
|
|
35
|
+
if (!param.displayOptions?.show) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const showConditions = param.displayOptions.show;
|
|
40
|
+
|
|
41
|
+
for (const [paramName, allowedValues] of Object.entries(showConditions)) {
|
|
42
|
+
const currentValue = allParameters[paramName];
|
|
43
|
+
|
|
44
|
+
if (Array.isArray(allowedValues)) {
|
|
45
|
+
if (!allowedValues.includes(currentValue)) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
} else {
|
|
49
|
+
if (currentValue !== allowedValues) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return true;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const MiddleSection: React.FC<MiddleSectionProps> = ({
|
|
59
|
+
nodeId,
|
|
60
|
+
nodeDefinition,
|
|
61
|
+
parameters,
|
|
62
|
+
onParameterChange,
|
|
63
|
+
isLoadingParameters = false,
|
|
64
|
+
executionResults = []
|
|
65
|
+
}) => {
|
|
66
|
+
const theme = useAppTheme();
|
|
67
|
+
const { currentWorkflow } = useAppStore();
|
|
68
|
+
const { clearMemory, resetSkill } = useWebSocket();
|
|
69
|
+
const [isConsoleExpanded, setIsConsoleExpanded] = useState(true);
|
|
70
|
+
const [connectedSkills, setConnectedSkills] = useState<ConnectedSkill[]>([]);
|
|
71
|
+
const [isSkillsExpanded, setIsSkillsExpanded] = useState(true);
|
|
72
|
+
|
|
73
|
+
// Clear/Reset dialog state
|
|
74
|
+
const [showClearMemoryDialog, setShowClearMemoryDialog] = useState(false);
|
|
75
|
+
const [showResetSkillDialog, setShowResetSkillDialog] = useState(false);
|
|
76
|
+
const [clearLongTermMemory, setClearLongTermMemory] = useState(false);
|
|
77
|
+
const [isProcessing, setIsProcessing] = useState(false);
|
|
78
|
+
|
|
79
|
+
// Clear memory handler
|
|
80
|
+
const handleClearMemory = async () => {
|
|
81
|
+
setIsProcessing(true);
|
|
82
|
+
try {
|
|
83
|
+
const sessionId = parameters.sessionId || 'default';
|
|
84
|
+
const result = await clearMemory(sessionId, clearLongTermMemory);
|
|
85
|
+
if (result.success && result.default_content) {
|
|
86
|
+
onParameterChange('memoryContent', result.default_content);
|
|
87
|
+
}
|
|
88
|
+
} finally {
|
|
89
|
+
setIsProcessing(false);
|
|
90
|
+
setShowClearMemoryDialog(false);
|
|
91
|
+
setClearLongTermMemory(false);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// Reset skill handler
|
|
96
|
+
const handleResetSkill = async () => {
|
|
97
|
+
setIsProcessing(true);
|
|
98
|
+
try {
|
|
99
|
+
const skillName = parameters.skillName;
|
|
100
|
+
if (!skillName) return;
|
|
101
|
+
const result = await resetSkill(skillName);
|
|
102
|
+
if (result.success && result.original_content) {
|
|
103
|
+
onParameterChange('instructions', result.original_content);
|
|
104
|
+
}
|
|
105
|
+
} finally {
|
|
106
|
+
setIsProcessing(false);
|
|
107
|
+
setShowResetSkillDialog(false);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const visibleParams = (nodeDefinition.properties || [])
|
|
112
|
+
.filter((param: INodeProperties) => shouldShowParameter(param, parameters));
|
|
113
|
+
|
|
114
|
+
// Check if this is a code executor node (Python or JavaScript)
|
|
115
|
+
const isCodeExecutorNode = nodeDefinition.name === 'pythonExecutor' || nodeDefinition.name === 'javascriptExecutor';
|
|
116
|
+
|
|
117
|
+
// Check if this is a skill node with code editor (needs similar flex layout)
|
|
118
|
+
const isSkillNode = SKILL_NODE_TYPES.includes(nodeDefinition.name) && nodeDefinition.name !== 'customSkill';
|
|
119
|
+
|
|
120
|
+
// Check if this is a memory node with markdown editor
|
|
121
|
+
const isMemoryNode = nodeDefinition.name === 'simpleMemory';
|
|
122
|
+
|
|
123
|
+
// Nodes that need flexible code editor layout
|
|
124
|
+
const needsCodeEditorLayout = isCodeExecutorNode || isSkillNode || isMemoryNode;
|
|
125
|
+
|
|
126
|
+
// Check if this is a tool node that supports schema editing
|
|
127
|
+
const isToolNode = TOOL_NODE_TYPES.includes(nodeDefinition.name);
|
|
128
|
+
|
|
129
|
+
// Check if this is a Zeenie node
|
|
130
|
+
const isChatAgentNode = nodeDefinition.name === 'chatAgent';
|
|
131
|
+
|
|
132
|
+
// Get connected skills for Zeenie nodes
|
|
133
|
+
useEffect(() => {
|
|
134
|
+
if (!isChatAgentNode || !currentWorkflow) {
|
|
135
|
+
setConnectedSkills([]);
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const nodes = currentWorkflow.nodes || [];
|
|
140
|
+
const edges = currentWorkflow.edges || [];
|
|
141
|
+
|
|
142
|
+
// Find edges connecting to this node's input-skill handle
|
|
143
|
+
const skillEdges = edges.filter((edge: Edge) =>
|
|
144
|
+
edge.target === nodeId && edge.targetHandle === 'input-skill'
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
// Get skill node data
|
|
148
|
+
const skills: ConnectedSkill[] = skillEdges.map((edge: Edge) => {
|
|
149
|
+
const sourceNode = nodes.find((n: any) => n.id === edge.source);
|
|
150
|
+
const nodeType = sourceNode?.type || '';
|
|
151
|
+
const nodeDef = nodeDefinitions[nodeType];
|
|
152
|
+
|
|
153
|
+
return {
|
|
154
|
+
id: edge.source,
|
|
155
|
+
name: sourceNode?.data?.label || nodeDef?.displayName || nodeType,
|
|
156
|
+
type: nodeType,
|
|
157
|
+
icon: nodeDef?.icon || '',
|
|
158
|
+
description: nodeDef?.description || '',
|
|
159
|
+
color: nodeDef?.defaults?.color as string || '#6366F1',
|
|
160
|
+
};
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
setConnectedSkills(skills);
|
|
164
|
+
}, [nodeId, isChatAgentNode, currentWorkflow]);
|
|
165
|
+
|
|
166
|
+
// Extract console output from execution results
|
|
167
|
+
const getConsoleOutput = (): string => {
|
|
168
|
+
if (executionResults.length === 0) return '';
|
|
169
|
+
|
|
170
|
+
const latestResult = executionResults[0];
|
|
171
|
+
const outputs = latestResult.outputs || latestResult.data || latestResult.nodeData?.[0]?.[0]?.json;
|
|
172
|
+
|
|
173
|
+
if (!outputs) return '';
|
|
174
|
+
|
|
175
|
+
// Check for console_output or stdout in the result
|
|
176
|
+
if (outputs.console_output) return outputs.console_output;
|
|
177
|
+
if (outputs.stdout) return outputs.stdout;
|
|
178
|
+
if (outputs.result?.console_output) return outputs.result.console_output;
|
|
179
|
+
if (outputs.result?.stdout) return outputs.result.stdout;
|
|
180
|
+
|
|
181
|
+
// Check for error output
|
|
182
|
+
if (latestResult.error) return `Error: ${latestResult.error}`;
|
|
183
|
+
if (outputs.error) return `Error: ${outputs.error}`;
|
|
184
|
+
if (outputs.stderr) return `Error: ${outputs.stderr}`;
|
|
185
|
+
|
|
186
|
+
return '';
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
const consoleOutput = isCodeExecutorNode ? getConsoleOutput() : '';
|
|
190
|
+
|
|
191
|
+
return (
|
|
192
|
+
<div style={{
|
|
193
|
+
flex: 1,
|
|
194
|
+
display: 'flex',
|
|
195
|
+
flexDirection: 'column',
|
|
196
|
+
height: '100%',
|
|
197
|
+
overflow: 'hidden',
|
|
198
|
+
position: 'relative'
|
|
199
|
+
}}>
|
|
200
|
+
{/* Description - hide for code editor nodes (Python, Skill) */}
|
|
201
|
+
{!needsCodeEditorLayout && (
|
|
202
|
+
<div style={{
|
|
203
|
+
padding: `${theme.spacing.lg} ${theme.spacing.xl} ${theme.spacing.sm}`,
|
|
204
|
+
borderBottom: `1px solid ${theme.colors.border}`,
|
|
205
|
+
backgroundColor: theme.colors.backgroundAlt,
|
|
206
|
+
flexShrink: 0
|
|
207
|
+
}}>
|
|
208
|
+
<p style={{
|
|
209
|
+
margin: 0,
|
|
210
|
+
fontSize: theme.fontSize.base,
|
|
211
|
+
color: theme.colors.textSecondary,
|
|
212
|
+
lineHeight: '1.5',
|
|
213
|
+
}}>
|
|
214
|
+
{nodeDefinition.description}
|
|
215
|
+
</p>
|
|
216
|
+
</div>
|
|
217
|
+
)}
|
|
218
|
+
|
|
219
|
+
{/* Main Content Area - Flexible */}
|
|
220
|
+
<div style={{ flex: 1, display: 'flex', flexDirection: 'column', minHeight: 0, overflow: 'hidden' }}>
|
|
221
|
+
{/* Parameters */}
|
|
222
|
+
<div style={{
|
|
223
|
+
padding: theme.spacing.xl,
|
|
224
|
+
flex: needsCodeEditorLayout ? '3' : 1,
|
|
225
|
+
overflowY: needsCodeEditorLayout ? 'hidden' : 'auto',
|
|
226
|
+
overflowX: 'hidden',
|
|
227
|
+
width: '100%',
|
|
228
|
+
boxSizing: 'border-box',
|
|
229
|
+
minHeight: 0,
|
|
230
|
+
display: needsCodeEditorLayout ? 'flex' : 'block',
|
|
231
|
+
flexDirection: 'column'
|
|
232
|
+
}}>
|
|
233
|
+
{/* Parameters Container */}
|
|
234
|
+
<div style={{
|
|
235
|
+
backgroundColor: theme.colors.background,
|
|
236
|
+
border: `1px solid ${theme.colors.border}`,
|
|
237
|
+
borderRadius: theme.borderRadius.md,
|
|
238
|
+
padding: theme.spacing.lg,
|
|
239
|
+
boxShadow: `0 1px 3px ${theme.colors.shadowLight}`,
|
|
240
|
+
height: needsCodeEditorLayout ? '100%' : 'auto',
|
|
241
|
+
display: needsCodeEditorLayout ? 'flex' : 'block',
|
|
242
|
+
flexDirection: 'column',
|
|
243
|
+
boxSizing: 'border-box'
|
|
244
|
+
}}>
|
|
245
|
+
{/* All Parameters - standard n8n style */}
|
|
246
|
+
{visibleParams.map((param: INodeProperties, index: number) => {
|
|
247
|
+
// Check if this parameter is a code editor - give it more flex space
|
|
248
|
+
const isCodeParam = (param as any).typeOptions?.editor === 'code';
|
|
249
|
+
return (
|
|
250
|
+
<div
|
|
251
|
+
key={param.name}
|
|
252
|
+
style={{
|
|
253
|
+
paddingBottom: index < visibleParams.length - 1 ? theme.spacing.md : 0,
|
|
254
|
+
marginBottom: index < visibleParams.length - 1 ? theme.spacing.md : 0,
|
|
255
|
+
borderBottom: index < visibleParams.length - 1 ? `1px solid ${theme.colors.border}` : 'none',
|
|
256
|
+
flex: needsCodeEditorLayout && isCodeParam ? 1 : 'none',
|
|
257
|
+
display: needsCodeEditorLayout ? 'flex' : 'block',
|
|
258
|
+
flexDirection: 'column',
|
|
259
|
+
minHeight: needsCodeEditorLayout && isCodeParam ? '300px' : 0
|
|
260
|
+
}}
|
|
261
|
+
>
|
|
262
|
+
<ParameterRenderer
|
|
263
|
+
parameter={param}
|
|
264
|
+
value={parameters[param.name]}
|
|
265
|
+
onChange={(value) => onParameterChange(param.name, value)}
|
|
266
|
+
allParameters={parameters}
|
|
267
|
+
onParameterChange={onParameterChange}
|
|
268
|
+
onClosePanel={() => {}}
|
|
269
|
+
isLoadingParameters={isLoadingParameters}
|
|
270
|
+
/>
|
|
271
|
+
</div>
|
|
272
|
+
);
|
|
273
|
+
})}
|
|
274
|
+
|
|
275
|
+
{/* Tool Schema Editor - Only for tool nodes */}
|
|
276
|
+
{isToolNode && (
|
|
277
|
+
<ToolSchemaEditor
|
|
278
|
+
nodeId={nodeId}
|
|
279
|
+
toolName={parameters.toolName || nodeDefinition.name}
|
|
280
|
+
toolDescription={parameters.toolDescription || nodeDefinition.description || ''}
|
|
281
|
+
/>
|
|
282
|
+
)}
|
|
283
|
+
|
|
284
|
+
{/* Clear Memory Button - Only for memory nodes */}
|
|
285
|
+
{isMemoryNode && (
|
|
286
|
+
<div style={{
|
|
287
|
+
display: 'flex',
|
|
288
|
+
justifyContent: 'flex-end',
|
|
289
|
+
paddingTop: theme.spacing.md,
|
|
290
|
+
marginTop: theme.spacing.md,
|
|
291
|
+
borderTop: `1px solid ${theme.colors.border}`
|
|
292
|
+
}}>
|
|
293
|
+
<button
|
|
294
|
+
onClick={() => setShowClearMemoryDialog(true)}
|
|
295
|
+
style={{
|
|
296
|
+
display: 'flex',
|
|
297
|
+
alignItems: 'center',
|
|
298
|
+
gap: '6px',
|
|
299
|
+
padding: '6px 12px',
|
|
300
|
+
backgroundColor: `${theme.dracula.red}20`,
|
|
301
|
+
color: theme.dracula.red,
|
|
302
|
+
border: `1px solid ${theme.dracula.red}50`,
|
|
303
|
+
borderRadius: theme.borderRadius.sm,
|
|
304
|
+
fontSize: theme.fontSize.sm,
|
|
305
|
+
fontWeight: theme.fontWeight.medium,
|
|
306
|
+
cursor: 'pointer',
|
|
307
|
+
transition: 'all 0.15s ease'
|
|
308
|
+
}}
|
|
309
|
+
>
|
|
310
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
311
|
+
<polyline points="3 6 5 6 21 6" />
|
|
312
|
+
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />
|
|
313
|
+
</svg>
|
|
314
|
+
Clear Memory
|
|
315
|
+
</button>
|
|
316
|
+
</div>
|
|
317
|
+
)}
|
|
318
|
+
|
|
319
|
+
{/* Reset Skill Button - Only for built-in skill nodes */}
|
|
320
|
+
{isSkillNode && (
|
|
321
|
+
<div style={{
|
|
322
|
+
display: 'flex',
|
|
323
|
+
justifyContent: 'flex-end',
|
|
324
|
+
paddingTop: theme.spacing.md,
|
|
325
|
+
marginTop: theme.spacing.md,
|
|
326
|
+
borderTop: `1px solid ${theme.colors.border}`
|
|
327
|
+
}}>
|
|
328
|
+
<button
|
|
329
|
+
onClick={() => setShowResetSkillDialog(true)}
|
|
330
|
+
style={{
|
|
331
|
+
display: 'flex',
|
|
332
|
+
alignItems: 'center',
|
|
333
|
+
gap: '6px',
|
|
334
|
+
padding: '6px 12px',
|
|
335
|
+
backgroundColor: `${theme.dracula.orange}20`,
|
|
336
|
+
color: theme.dracula.orange,
|
|
337
|
+
border: `1px solid ${theme.dracula.orange}50`,
|
|
338
|
+
borderRadius: theme.borderRadius.sm,
|
|
339
|
+
fontSize: theme.fontSize.sm,
|
|
340
|
+
fontWeight: theme.fontWeight.medium,
|
|
341
|
+
cursor: 'pointer',
|
|
342
|
+
transition: 'all 0.15s ease'
|
|
343
|
+
}}
|
|
344
|
+
>
|
|
345
|
+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
346
|
+
<polyline points="1 4 1 10 7 10" />
|
|
347
|
+
<path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10" />
|
|
348
|
+
</svg>
|
|
349
|
+
Reset to Default
|
|
350
|
+
</button>
|
|
351
|
+
</div>
|
|
352
|
+
)}
|
|
353
|
+
</div>
|
|
354
|
+
|
|
355
|
+
{/* Clear Memory Confirmation Dialog */}
|
|
356
|
+
{showClearMemoryDialog && (
|
|
357
|
+
<div style={{
|
|
358
|
+
position: 'fixed',
|
|
359
|
+
top: 0,
|
|
360
|
+
left: 0,
|
|
361
|
+
right: 0,
|
|
362
|
+
bottom: 0,
|
|
363
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
364
|
+
display: 'flex',
|
|
365
|
+
alignItems: 'center',
|
|
366
|
+
justifyContent: 'center',
|
|
367
|
+
zIndex: 9999
|
|
368
|
+
}}>
|
|
369
|
+
<div style={{
|
|
370
|
+
backgroundColor: theme.colors.background,
|
|
371
|
+
borderRadius: theme.borderRadius.lg,
|
|
372
|
+
border: `1px solid ${theme.colors.border}`,
|
|
373
|
+
padding: theme.spacing.xl,
|
|
374
|
+
maxWidth: '400px',
|
|
375
|
+
width: '90%',
|
|
376
|
+
boxShadow: '0 10px 40px rgba(0, 0, 0, 0.3)'
|
|
377
|
+
}}>
|
|
378
|
+
<h3 style={{
|
|
379
|
+
margin: `0 0 ${theme.spacing.md}`,
|
|
380
|
+
fontSize: theme.fontSize.lg,
|
|
381
|
+
fontWeight: theme.fontWeight.semibold,
|
|
382
|
+
color: theme.colors.text
|
|
383
|
+
}}>
|
|
384
|
+
Clear Conversation Memory
|
|
385
|
+
</h3>
|
|
386
|
+
<p style={{
|
|
387
|
+
margin: `0 0 ${theme.spacing.lg}`,
|
|
388
|
+
fontSize: theme.fontSize.sm,
|
|
389
|
+
color: theme.colors.textSecondary,
|
|
390
|
+
lineHeight: 1.5
|
|
391
|
+
}}>
|
|
392
|
+
This will reset the conversation history to its initial state. This action cannot be undone.
|
|
393
|
+
</p>
|
|
394
|
+
|
|
395
|
+
{/* Long-term memory checkbox */}
|
|
396
|
+
{parameters.longTermEnabled && (
|
|
397
|
+
<label style={{
|
|
398
|
+
display: 'flex',
|
|
399
|
+
alignItems: 'center',
|
|
400
|
+
gap: '8px',
|
|
401
|
+
marginBottom: theme.spacing.lg,
|
|
402
|
+
fontSize: theme.fontSize.sm,
|
|
403
|
+
color: theme.colors.text,
|
|
404
|
+
cursor: 'pointer'
|
|
405
|
+
}}>
|
|
406
|
+
<input
|
|
407
|
+
type="checkbox"
|
|
408
|
+
checked={clearLongTermMemory}
|
|
409
|
+
onChange={(e) => setClearLongTermMemory(e.target.checked)}
|
|
410
|
+
style={{ width: 16, height: 16 }}
|
|
411
|
+
/>
|
|
412
|
+
Also clear long-term memory (vector store)
|
|
413
|
+
</label>
|
|
414
|
+
)}
|
|
415
|
+
|
|
416
|
+
<div style={{ display: 'flex', justifyContent: 'flex-end', gap: theme.spacing.sm }}>
|
|
417
|
+
<button
|
|
418
|
+
onClick={() => {
|
|
419
|
+
setShowClearMemoryDialog(false);
|
|
420
|
+
setClearLongTermMemory(false);
|
|
421
|
+
}}
|
|
422
|
+
disabled={isProcessing}
|
|
423
|
+
style={{
|
|
424
|
+
padding: '8px 16px',
|
|
425
|
+
backgroundColor: theme.colors.backgroundAlt,
|
|
426
|
+
color: theme.colors.text,
|
|
427
|
+
border: `1px solid ${theme.colors.border}`,
|
|
428
|
+
borderRadius: theme.borderRadius.sm,
|
|
429
|
+
fontSize: theme.fontSize.sm,
|
|
430
|
+
fontWeight: theme.fontWeight.medium,
|
|
431
|
+
cursor: isProcessing ? 'not-allowed' : 'pointer'
|
|
432
|
+
}}
|
|
433
|
+
>
|
|
434
|
+
Cancel
|
|
435
|
+
</button>
|
|
436
|
+
<button
|
|
437
|
+
onClick={handleClearMemory}
|
|
438
|
+
disabled={isProcessing}
|
|
439
|
+
style={{
|
|
440
|
+
padding: '8px 16px',
|
|
441
|
+
backgroundColor: theme.dracula.red,
|
|
442
|
+
color: '#fff',
|
|
443
|
+
border: 'none',
|
|
444
|
+
borderRadius: theme.borderRadius.sm,
|
|
445
|
+
fontSize: theme.fontSize.sm,
|
|
446
|
+
fontWeight: theme.fontWeight.medium,
|
|
447
|
+
cursor: isProcessing ? 'not-allowed' : 'pointer',
|
|
448
|
+
opacity: isProcessing ? 0.7 : 1
|
|
449
|
+
}}
|
|
450
|
+
>
|
|
451
|
+
{isProcessing ? 'Clearing...' : 'Clear Memory'}
|
|
452
|
+
</button>
|
|
453
|
+
</div>
|
|
454
|
+
</div>
|
|
455
|
+
</div>
|
|
456
|
+
)}
|
|
457
|
+
|
|
458
|
+
{/* Reset Skill Confirmation Dialog */}
|
|
459
|
+
{showResetSkillDialog && (
|
|
460
|
+
<div style={{
|
|
461
|
+
position: 'fixed',
|
|
462
|
+
top: 0,
|
|
463
|
+
left: 0,
|
|
464
|
+
right: 0,
|
|
465
|
+
bottom: 0,
|
|
466
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
467
|
+
display: 'flex',
|
|
468
|
+
alignItems: 'center',
|
|
469
|
+
justifyContent: 'center',
|
|
470
|
+
zIndex: 9999
|
|
471
|
+
}}>
|
|
472
|
+
<div style={{
|
|
473
|
+
backgroundColor: theme.colors.background,
|
|
474
|
+
borderRadius: theme.borderRadius.lg,
|
|
475
|
+
border: `1px solid ${theme.colors.border}`,
|
|
476
|
+
padding: theme.spacing.xl,
|
|
477
|
+
maxWidth: '400px',
|
|
478
|
+
width: '90%',
|
|
479
|
+
boxShadow: '0 10px 40px rgba(0, 0, 0, 0.3)'
|
|
480
|
+
}}>
|
|
481
|
+
<h3 style={{
|
|
482
|
+
margin: `0 0 ${theme.spacing.md}`,
|
|
483
|
+
fontSize: theme.fontSize.lg,
|
|
484
|
+
fontWeight: theme.fontWeight.semibold,
|
|
485
|
+
color: theme.colors.text
|
|
486
|
+
}}>
|
|
487
|
+
Reset Skill to Default
|
|
488
|
+
</h3>
|
|
489
|
+
<p style={{
|
|
490
|
+
margin: `0 0 ${theme.spacing.lg}`,
|
|
491
|
+
fontSize: theme.fontSize.sm,
|
|
492
|
+
color: theme.colors.textSecondary,
|
|
493
|
+
lineHeight: 1.5
|
|
494
|
+
}}>
|
|
495
|
+
This will restore the skill instructions to their original content. Any customizations will be lost.
|
|
496
|
+
</p>
|
|
497
|
+
|
|
498
|
+
<div style={{ display: 'flex', justifyContent: 'flex-end', gap: theme.spacing.sm }}>
|
|
499
|
+
<button
|
|
500
|
+
onClick={() => setShowResetSkillDialog(false)}
|
|
501
|
+
disabled={isProcessing}
|
|
502
|
+
style={{
|
|
503
|
+
padding: '8px 16px',
|
|
504
|
+
backgroundColor: theme.colors.backgroundAlt,
|
|
505
|
+
color: theme.colors.text,
|
|
506
|
+
border: `1px solid ${theme.colors.border}`,
|
|
507
|
+
borderRadius: theme.borderRadius.sm,
|
|
508
|
+
fontSize: theme.fontSize.sm,
|
|
509
|
+
fontWeight: theme.fontWeight.medium,
|
|
510
|
+
cursor: isProcessing ? 'not-allowed' : 'pointer'
|
|
511
|
+
}}
|
|
512
|
+
>
|
|
513
|
+
Cancel
|
|
514
|
+
</button>
|
|
515
|
+
<button
|
|
516
|
+
onClick={handleResetSkill}
|
|
517
|
+
disabled={isProcessing}
|
|
518
|
+
style={{
|
|
519
|
+
padding: '8px 16px',
|
|
520
|
+
backgroundColor: theme.dracula.orange,
|
|
521
|
+
color: '#fff',
|
|
522
|
+
border: 'none',
|
|
523
|
+
borderRadius: theme.borderRadius.sm,
|
|
524
|
+
fontSize: theme.fontSize.sm,
|
|
525
|
+
fontWeight: theme.fontWeight.medium,
|
|
526
|
+
cursor: isProcessing ? 'not-allowed' : 'pointer',
|
|
527
|
+
opacity: isProcessing ? 0.7 : 1
|
|
528
|
+
}}
|
|
529
|
+
>
|
|
530
|
+
{isProcessing ? 'Resetting...' : 'Reset to Default'}
|
|
531
|
+
</button>
|
|
532
|
+
</div>
|
|
533
|
+
</div>
|
|
534
|
+
</div>
|
|
535
|
+
)}
|
|
536
|
+
|
|
537
|
+
{/* Connected Skills Section - Only for Zeenie nodes */}
|
|
538
|
+
{isChatAgentNode && (
|
|
539
|
+
<div style={{
|
|
540
|
+
marginTop: theme.spacing.lg,
|
|
541
|
+
backgroundColor: theme.colors.background,
|
|
542
|
+
border: `1px solid ${theme.colors.border}`,
|
|
543
|
+
borderRadius: theme.borderRadius.md,
|
|
544
|
+
boxShadow: `0 1px 3px ${theme.colors.shadowLight}`,
|
|
545
|
+
overflow: 'hidden'
|
|
546
|
+
}}>
|
|
547
|
+
{/* Skills Header */}
|
|
548
|
+
<div
|
|
549
|
+
onClick={() => setIsSkillsExpanded(!isSkillsExpanded)}
|
|
550
|
+
style={{
|
|
551
|
+
display: 'flex',
|
|
552
|
+
alignItems: 'center',
|
|
553
|
+
justifyContent: 'space-between',
|
|
554
|
+
padding: `${theme.spacing.sm} ${theme.spacing.md}`,
|
|
555
|
+
backgroundColor: theme.colors.backgroundAlt,
|
|
556
|
+
borderBottom: isSkillsExpanded ? `1px solid ${theme.colors.border}` : 'none',
|
|
557
|
+
cursor: 'pointer',
|
|
558
|
+
userSelect: 'none'
|
|
559
|
+
}}
|
|
560
|
+
>
|
|
561
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: theme.spacing.sm }}>
|
|
562
|
+
<svg
|
|
563
|
+
width="14"
|
|
564
|
+
height="14"
|
|
565
|
+
viewBox="0 0 24 24"
|
|
566
|
+
fill="none"
|
|
567
|
+
stroke={theme.colors.textSecondary}
|
|
568
|
+
strokeWidth="2"
|
|
569
|
+
strokeLinecap="round"
|
|
570
|
+
strokeLinejoin="round"
|
|
571
|
+
style={{
|
|
572
|
+
transform: isSkillsExpanded ? 'rotate(90deg)' : 'rotate(0deg)',
|
|
573
|
+
transition: 'transform 0.2s ease'
|
|
574
|
+
}}
|
|
575
|
+
>
|
|
576
|
+
<polyline points="9 18 15 12 9 6" />
|
|
577
|
+
</svg>
|
|
578
|
+
<svg
|
|
579
|
+
width="14"
|
|
580
|
+
height="14"
|
|
581
|
+
viewBox="0 0 24 24"
|
|
582
|
+
fill="none"
|
|
583
|
+
stroke={theme.dracula.purple}
|
|
584
|
+
strokeWidth="2"
|
|
585
|
+
strokeLinecap="round"
|
|
586
|
+
strokeLinejoin="round"
|
|
587
|
+
>
|
|
588
|
+
<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" />
|
|
589
|
+
</svg>
|
|
590
|
+
<span style={{
|
|
591
|
+
fontSize: theme.fontSize.sm,
|
|
592
|
+
fontWeight: theme.fontWeight.medium,
|
|
593
|
+
color: theme.colors.text
|
|
594
|
+
}}>
|
|
595
|
+
Connected Skills
|
|
596
|
+
</span>
|
|
597
|
+
</div>
|
|
598
|
+
<span style={{
|
|
599
|
+
fontSize: theme.fontSize.xs,
|
|
600
|
+
color: connectedSkills.length > 0 ? theme.dracula.purple : theme.colors.textMuted,
|
|
601
|
+
padding: `2px ${theme.spacing.sm}`,
|
|
602
|
+
backgroundColor: connectedSkills.length > 0 ? theme.dracula.purple + '20' : theme.colors.backgroundAlt,
|
|
603
|
+
borderRadius: theme.borderRadius.sm,
|
|
604
|
+
fontWeight: theme.fontWeight.medium
|
|
605
|
+
}}>
|
|
606
|
+
{connectedSkills.length}
|
|
607
|
+
</span>
|
|
608
|
+
</div>
|
|
609
|
+
|
|
610
|
+
{/* Skills Content */}
|
|
611
|
+
{isSkillsExpanded && (
|
|
612
|
+
<div style={{ padding: theme.spacing.md }}>
|
|
613
|
+
{connectedSkills.length === 0 ? (
|
|
614
|
+
<div style={{
|
|
615
|
+
display: 'flex',
|
|
616
|
+
flexDirection: 'column',
|
|
617
|
+
alignItems: 'center',
|
|
618
|
+
justifyContent: 'center',
|
|
619
|
+
padding: theme.spacing.lg,
|
|
620
|
+
color: theme.colors.textMuted,
|
|
621
|
+
textAlign: 'center'
|
|
622
|
+
}}>
|
|
623
|
+
<svg
|
|
624
|
+
width="32"
|
|
625
|
+
height="32"
|
|
626
|
+
viewBox="0 0 24 24"
|
|
627
|
+
fill="none"
|
|
628
|
+
stroke={theme.colors.textMuted}
|
|
629
|
+
strokeWidth="1.5"
|
|
630
|
+
strokeLinecap="round"
|
|
631
|
+
strokeLinejoin="round"
|
|
632
|
+
style={{ marginBottom: theme.spacing.sm, opacity: 0.5 }}
|
|
633
|
+
>
|
|
634
|
+
<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" />
|
|
635
|
+
</svg>
|
|
636
|
+
<span style={{ fontSize: theme.fontSize.sm, marginBottom: theme.spacing.xs }}>
|
|
637
|
+
No skills connected
|
|
638
|
+
</span>
|
|
639
|
+
<span style={{ fontSize: theme.fontSize.xs }}>
|
|
640
|
+
Connect skill nodes to the Skill handle to add capabilities
|
|
641
|
+
</span>
|
|
642
|
+
</div>
|
|
643
|
+
) : (
|
|
644
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: theme.spacing.sm }}>
|
|
645
|
+
{connectedSkills.map((skill) => (
|
|
646
|
+
<div
|
|
647
|
+
key={skill.id}
|
|
648
|
+
style={{
|
|
649
|
+
display: 'flex',
|
|
650
|
+
alignItems: 'flex-start',
|
|
651
|
+
gap: theme.spacing.md,
|
|
652
|
+
padding: theme.spacing.md,
|
|
653
|
+
backgroundColor: theme.colors.backgroundAlt,
|
|
654
|
+
borderRadius: theme.borderRadius.md,
|
|
655
|
+
border: `1px solid ${theme.colors.border}`,
|
|
656
|
+
borderLeft: `3px solid ${skill.color}`
|
|
657
|
+
}}
|
|
658
|
+
>
|
|
659
|
+
{/* Skill Icon */}
|
|
660
|
+
<div style={{
|
|
661
|
+
width: 36,
|
|
662
|
+
height: 36,
|
|
663
|
+
borderRadius: theme.borderRadius.md,
|
|
664
|
+
backgroundColor: skill.color + '20',
|
|
665
|
+
display: 'flex',
|
|
666
|
+
alignItems: 'center',
|
|
667
|
+
justifyContent: 'center',
|
|
668
|
+
flexShrink: 0
|
|
669
|
+
}}>
|
|
670
|
+
{skill.icon.startsWith('data:') ? (
|
|
671
|
+
<img src={skill.icon} alt={skill.name} style={{ width: 20, height: 20 }} />
|
|
672
|
+
) : (
|
|
673
|
+
<span style={{ fontSize: 18 }}>{skill.icon}</span>
|
|
674
|
+
)}
|
|
675
|
+
</div>
|
|
676
|
+
|
|
677
|
+
{/* Skill Info */}
|
|
678
|
+
<div style={{ flex: 1, minWidth: 0 }}>
|
|
679
|
+
<div style={{
|
|
680
|
+
fontSize: theme.fontSize.sm,
|
|
681
|
+
fontWeight: theme.fontWeight.semibold,
|
|
682
|
+
color: theme.colors.text,
|
|
683
|
+
marginBottom: 2
|
|
684
|
+
}}>
|
|
685
|
+
{skill.name}
|
|
686
|
+
</div>
|
|
687
|
+
<div style={{
|
|
688
|
+
fontSize: theme.fontSize.xs,
|
|
689
|
+
color: theme.colors.textMuted,
|
|
690
|
+
overflow: 'hidden',
|
|
691
|
+
textOverflow: 'ellipsis',
|
|
692
|
+
display: '-webkit-box',
|
|
693
|
+
WebkitLineClamp: 2,
|
|
694
|
+
WebkitBoxOrient: 'vertical'
|
|
695
|
+
}}>
|
|
696
|
+
{skill.description}
|
|
697
|
+
</div>
|
|
698
|
+
</div>
|
|
699
|
+
|
|
700
|
+
{/* Active Badge */}
|
|
701
|
+
<div style={{
|
|
702
|
+
fontSize: '10px',
|
|
703
|
+
fontWeight: theme.fontWeight.medium,
|
|
704
|
+
color: theme.dracula.green,
|
|
705
|
+
padding: `2px ${theme.spacing.xs}`,
|
|
706
|
+
backgroundColor: theme.dracula.green + '20',
|
|
707
|
+
borderRadius: theme.borderRadius.sm,
|
|
708
|
+
flexShrink: 0
|
|
709
|
+
}}>
|
|
710
|
+
Active
|
|
711
|
+
</div>
|
|
712
|
+
</div>
|
|
713
|
+
))}
|
|
714
|
+
</div>
|
|
715
|
+
)}
|
|
716
|
+
</div>
|
|
717
|
+
)}
|
|
718
|
+
</div>
|
|
719
|
+
)}
|
|
720
|
+
</div>
|
|
721
|
+
|
|
722
|
+
{/* Console Output Section - Only for Python nodes */}
|
|
723
|
+
{isCodeExecutorNode && (
|
|
724
|
+
<div style={{
|
|
725
|
+
padding: `0 ${theme.spacing.xl} ${theme.spacing.xl}`,
|
|
726
|
+
flex: '1',
|
|
727
|
+
minHeight: 0,
|
|
728
|
+
display: 'flex',
|
|
729
|
+
flexDirection: 'column'
|
|
730
|
+
}}>
|
|
731
|
+
<div style={{
|
|
732
|
+
backgroundColor: theme.colors.background,
|
|
733
|
+
border: `1px solid ${theme.colors.border}`,
|
|
734
|
+
borderRadius: theme.borderRadius.md,
|
|
735
|
+
boxShadow: `0 1px 3px ${theme.colors.shadowLight}`,
|
|
736
|
+
overflow: 'hidden',
|
|
737
|
+
flex: 1,
|
|
738
|
+
display: 'flex',
|
|
739
|
+
flexDirection: 'column',
|
|
740
|
+
minHeight: 0
|
|
741
|
+
}}>
|
|
742
|
+
{/* Console Header */}
|
|
743
|
+
<div
|
|
744
|
+
onClick={() => setIsConsoleExpanded(!isConsoleExpanded)}
|
|
745
|
+
style={{
|
|
746
|
+
display: 'flex',
|
|
747
|
+
alignItems: 'center',
|
|
748
|
+
justifyContent: 'space-between',
|
|
749
|
+
padding: `${theme.spacing.sm} ${theme.spacing.md}`,
|
|
750
|
+
backgroundColor: theme.colors.backgroundAlt,
|
|
751
|
+
borderBottom: isConsoleExpanded ? `1px solid ${theme.colors.border}` : 'none',
|
|
752
|
+
cursor: 'pointer',
|
|
753
|
+
userSelect: 'none'
|
|
754
|
+
}}
|
|
755
|
+
>
|
|
756
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: theme.spacing.sm }}>
|
|
757
|
+
<svg
|
|
758
|
+
width="14"
|
|
759
|
+
height="14"
|
|
760
|
+
viewBox="0 0 24 24"
|
|
761
|
+
fill="none"
|
|
762
|
+
stroke={theme.colors.textSecondary}
|
|
763
|
+
strokeWidth="2"
|
|
764
|
+
strokeLinecap="round"
|
|
765
|
+
strokeLinejoin="round"
|
|
766
|
+
style={{
|
|
767
|
+
transform: isConsoleExpanded ? 'rotate(90deg)' : 'rotate(0deg)',
|
|
768
|
+
transition: 'transform 0.2s ease'
|
|
769
|
+
}}
|
|
770
|
+
>
|
|
771
|
+
<polyline points="9 18 15 12 9 6" />
|
|
772
|
+
</svg>
|
|
773
|
+
<svg
|
|
774
|
+
width="14"
|
|
775
|
+
height="14"
|
|
776
|
+
viewBox="0 0 24 24"
|
|
777
|
+
fill="none"
|
|
778
|
+
stroke={theme.dracula.cyan}
|
|
779
|
+
strokeWidth="2"
|
|
780
|
+
strokeLinecap="round"
|
|
781
|
+
strokeLinejoin="round"
|
|
782
|
+
>
|
|
783
|
+
<polyline points="4 17 10 11 4 5" />
|
|
784
|
+
<line x1="12" y1="19" x2="20" y2="19" />
|
|
785
|
+
</svg>
|
|
786
|
+
<span style={{
|
|
787
|
+
fontSize: theme.fontSize.sm,
|
|
788
|
+
fontWeight: theme.fontWeight.medium,
|
|
789
|
+
color: theme.colors.text
|
|
790
|
+
}}>
|
|
791
|
+
Console
|
|
792
|
+
</span>
|
|
793
|
+
</div>
|
|
794
|
+
{consoleOutput && (
|
|
795
|
+
<span style={{
|
|
796
|
+
fontSize: theme.fontSize.xs,
|
|
797
|
+
color: theme.dracula.green,
|
|
798
|
+
padding: `2px ${theme.spacing.sm}`,
|
|
799
|
+
backgroundColor: theme.dracula.green + '20',
|
|
800
|
+
borderRadius: theme.borderRadius.sm
|
|
801
|
+
}}>
|
|
802
|
+
Output
|
|
803
|
+
</span>
|
|
804
|
+
)}
|
|
805
|
+
</div>
|
|
806
|
+
|
|
807
|
+
{/* Console Content */}
|
|
808
|
+
{isConsoleExpanded && (
|
|
809
|
+
<div style={{
|
|
810
|
+
padding: theme.spacing.sm,
|
|
811
|
+
backgroundColor: '#1a1a2e',
|
|
812
|
+
flex: 1,
|
|
813
|
+
minHeight: 0,
|
|
814
|
+
overflowY: 'auto',
|
|
815
|
+
fontFamily: 'Monaco, Menlo, "Ubuntu Mono", monospace',
|
|
816
|
+
fontSize: theme.fontSize.sm,
|
|
817
|
+
lineHeight: '1.4'
|
|
818
|
+
}}>
|
|
819
|
+
{consoleOutput ? (
|
|
820
|
+
<pre style={{
|
|
821
|
+
margin: 0,
|
|
822
|
+
whiteSpace: 'pre-wrap',
|
|
823
|
+
wordBreak: 'break-word',
|
|
824
|
+
color: consoleOutput.startsWith('Error') ? theme.dracula.red : theme.dracula.green
|
|
825
|
+
}}>
|
|
826
|
+
{consoleOutput}
|
|
827
|
+
</pre>
|
|
828
|
+
) : (
|
|
829
|
+
<div style={{
|
|
830
|
+
display: 'flex',
|
|
831
|
+
flexDirection: 'column',
|
|
832
|
+
alignItems: 'center',
|
|
833
|
+
justifyContent: 'center',
|
|
834
|
+
height: '100%',
|
|
835
|
+
minHeight: '40px',
|
|
836
|
+
color: theme.colors.textMuted
|
|
837
|
+
}}>
|
|
838
|
+
<svg
|
|
839
|
+
width="24"
|
|
840
|
+
height="24"
|
|
841
|
+
viewBox="0 0 24 24"
|
|
842
|
+
fill="none"
|
|
843
|
+
stroke={theme.colors.textMuted}
|
|
844
|
+
strokeWidth="1.5"
|
|
845
|
+
strokeLinecap="round"
|
|
846
|
+
strokeLinejoin="round"
|
|
847
|
+
style={{ marginBottom: theme.spacing.sm, opacity: 0.5 }}
|
|
848
|
+
>
|
|
849
|
+
<polyline points="4 17 10 11 4 5" />
|
|
850
|
+
<line x1="12" y1="19" x2="20" y2="19" />
|
|
851
|
+
</svg>
|
|
852
|
+
<span style={{ fontSize: theme.fontSize.xs }}>
|
|
853
|
+
Run the code to see console output
|
|
854
|
+
</span>
|
|
855
|
+
</div>
|
|
856
|
+
)}
|
|
857
|
+
</div>
|
|
858
|
+
)}
|
|
859
|
+
</div>
|
|
860
|
+
</div>
|
|
861
|
+
)}
|
|
862
|
+
</div>
|
|
863
|
+
</div>
|
|
864
|
+
);
|
|
865
|
+
};
|
|
866
|
+
|
|
867
|
+
export default MiddleSection;
|