machinaos 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.template +71 -0
- package/LICENSE +21 -0
- package/README.md +87 -0
- package/bin/cli.js +159 -0
- package/client/.dockerignore +45 -0
- package/client/Dockerfile +68 -0
- package/client/eslint.config.js +29 -0
- package/client/index.html +13 -0
- package/client/nginx.conf +66 -0
- package/client/package.json +48 -0
- package/client/src/App.tsx +27 -0
- package/client/src/Dashboard.tsx +1173 -0
- package/client/src/ParameterPanel.tsx +301 -0
- package/client/src/components/AIAgentNode.tsx +321 -0
- package/client/src/components/APIKeyValidator.tsx +118 -0
- package/client/src/components/ClaudeChatModelNode.tsx +18 -0
- package/client/src/components/ConditionalEdge.tsx +189 -0
- package/client/src/components/CredentialsModal.tsx +306 -0
- package/client/src/components/EdgeConditionEditor.tsx +443 -0
- package/client/src/components/GeminiChatModelNode.tsx +18 -0
- package/client/src/components/GenericNode.tsx +357 -0
- package/client/src/components/LocationParameterPanel.tsx +154 -0
- package/client/src/components/ModelNode.tsx +286 -0
- package/client/src/components/OpenAIChatModelNode.tsx +18 -0
- package/client/src/components/OutputPanel.tsx +471 -0
- package/client/src/components/ParameterRenderer.tsx +1874 -0
- package/client/src/components/SkillEditorModal.tsx +417 -0
- package/client/src/components/SquareNode.tsx +797 -0
- package/client/src/components/StartNode.tsx +250 -0
- package/client/src/components/ToolkitNode.tsx +365 -0
- package/client/src/components/TriggerNode.tsx +463 -0
- package/client/src/components/auth/LoginPage.tsx +247 -0
- package/client/src/components/auth/ProtectedRoute.tsx +59 -0
- package/client/src/components/base/BaseChatModelNode.tsx +271 -0
- package/client/src/components/icons/AIProviderIcons.tsx +50 -0
- package/client/src/components/maps/GoogleMapsPicker.tsx +137 -0
- package/client/src/components/maps/MapsPreviewPanel.tsx +110 -0
- package/client/src/components/maps/index.ts +26 -0
- package/client/src/components/parameterPanel/InputSection.tsx +1094 -0
- package/client/src/components/parameterPanel/LocationPanelLayout.tsx +65 -0
- package/client/src/components/parameterPanel/MapsSection.tsx +92 -0
- package/client/src/components/parameterPanel/MiddleSection.tsx +571 -0
- package/client/src/components/parameterPanel/OutputSection.tsx +81 -0
- package/client/src/components/parameterPanel/ParameterPanelLayout.tsx +82 -0
- package/client/src/components/parameterPanel/ToolSchemaEditor.tsx +436 -0
- package/client/src/components/parameterPanel/index.ts +42 -0
- package/client/src/components/shared/DataPanel.tsx +142 -0
- package/client/src/components/shared/JSONTreeRenderer.tsx +106 -0
- package/client/src/components/ui/AIResultModal.tsx +204 -0
- package/client/src/components/ui/AndroidSettingsPanel.tsx +401 -0
- package/client/src/components/ui/CodeEditor.tsx +81 -0
- package/client/src/components/ui/CollapsibleSection.tsx +88 -0
- package/client/src/components/ui/ComponentItem.tsx +154 -0
- package/client/src/components/ui/ComponentPalette.tsx +321 -0
- package/client/src/components/ui/ConsolePanel.tsx +1074 -0
- package/client/src/components/ui/ErrorBoundary.tsx +196 -0
- package/client/src/components/ui/InputNodesPanel.tsx +204 -0
- package/client/src/components/ui/MapSelector.tsx +314 -0
- package/client/src/components/ui/Modal.tsx +149 -0
- package/client/src/components/ui/NodeContextMenu.tsx +192 -0
- package/client/src/components/ui/NodeOutputPanel.tsx +1150 -0
- package/client/src/components/ui/OutputDisplayPanel.tsx +381 -0
- package/client/src/components/ui/SettingsPanel.tsx +243 -0
- package/client/src/components/ui/TopToolbar.tsx +736 -0
- package/client/src/components/ui/WhatsAppSettingsPanel.tsx +345 -0
- package/client/src/components/ui/WorkflowSidebar.tsx +294 -0
- package/client/src/config/antdTheme.ts +186 -0
- package/client/src/config/api.ts +54 -0
- package/client/src/contexts/AuthContext.tsx +221 -0
- package/client/src/contexts/ThemeContext.tsx +42 -0
- package/client/src/contexts/WebSocketContext.tsx +1971 -0
- package/client/src/factories/baseChatModelFactory.ts +256 -0
- package/client/src/hooks/useAndroidOperations.ts +164 -0
- package/client/src/hooks/useApiKeyValidation.ts +107 -0
- package/client/src/hooks/useApiKeys.ts +238 -0
- package/client/src/hooks/useAppTheme.ts +17 -0
- package/client/src/hooks/useComponentPalette.ts +51 -0
- package/client/src/hooks/useCopyPaste.ts +155 -0
- package/client/src/hooks/useDragAndDrop.ts +124 -0
- package/client/src/hooks/useDragVariable.ts +88 -0
- package/client/src/hooks/useExecution.ts +313 -0
- package/client/src/hooks/useParameterPanel.ts +176 -0
- package/client/src/hooks/useReactFlowNodes.ts +189 -0
- package/client/src/hooks/useToolSchema.ts +209 -0
- package/client/src/hooks/useWhatsApp.ts +196 -0
- package/client/src/hooks/useWorkflowManagement.ts +46 -0
- package/client/src/index.css +315 -0
- package/client/src/main.tsx +19 -0
- package/client/src/nodeDefinitions/aiAgentNodes.ts +336 -0
- package/client/src/nodeDefinitions/aiModelNodes.ts +340 -0
- package/client/src/nodeDefinitions/androidDeviceNodes.ts +140 -0
- package/client/src/nodeDefinitions/androidServiceNodes.ts +383 -0
- package/client/src/nodeDefinitions/chatNodes.ts +135 -0
- package/client/src/nodeDefinitions/codeNodes.ts +54 -0
- package/client/src/nodeDefinitions/documentNodes.ts +379 -0
- package/client/src/nodeDefinitions/index.ts +15 -0
- package/client/src/nodeDefinitions/locationNodes.ts +463 -0
- package/client/src/nodeDefinitions/schedulerNodes.ts +220 -0
- package/client/src/nodeDefinitions/skillNodes.ts +211 -0
- package/client/src/nodeDefinitions/toolNodes.ts +198 -0
- package/client/src/nodeDefinitions/utilityNodes.ts +284 -0
- package/client/src/nodeDefinitions/whatsappNodes.ts +865 -0
- package/client/src/nodeDefinitions/workflowNodes.ts +41 -0
- package/client/src/nodeDefinitions.ts +104 -0
- package/client/src/schemas/workflowSchema.ts +264 -0
- package/client/src/services/dynamicParameterService.ts +96 -0
- package/client/src/services/execution/aiAgentExecutionService.ts +35 -0
- package/client/src/services/executionService.ts +232 -0
- package/client/src/services/workflowApi.ts +91 -0
- package/client/src/store/useAppStore.ts +582 -0
- package/client/src/styles/theme.ts +508 -0
- package/client/src/styles/zIndex.ts +17 -0
- package/client/src/types/ComponentTypes.ts +39 -0
- package/client/src/types/EdgeCondition.ts +231 -0
- package/client/src/types/INodeProperties.ts +288 -0
- package/client/src/types/NodeTypes.ts +28 -0
- package/client/src/utils/formatters.ts +33 -0
- package/client/src/utils/googleMapsLoader.ts +140 -0
- package/client/src/utils/locationUtils.ts +85 -0
- package/client/src/utils/nodeUtils.ts +31 -0
- package/client/src/utils/workflow.ts +30 -0
- package/client/src/utils/workflowExport.ts +120 -0
- package/client/src/vite-env.d.ts +12 -0
- package/client/tailwind.config.js +60 -0
- package/client/tsconfig.json +25 -0
- package/client/tsconfig.node.json +11 -0
- package/client/vite.config.js +35 -0
- package/docker-compose.prod.yml +107 -0
- package/docker-compose.yml +104 -0
- package/docs-MachinaOs/README.md +85 -0
- package/docs-MachinaOs/deployment/docker.mdx +228 -0
- package/docs-MachinaOs/deployment/production.mdx +345 -0
- package/docs-MachinaOs/docs.json +75 -0
- package/docs-MachinaOs/faq.mdx +309 -0
- package/docs-MachinaOs/favicon.svg +5 -0
- package/docs-MachinaOs/installation.mdx +160 -0
- package/docs-MachinaOs/introduction.mdx +114 -0
- package/docs-MachinaOs/logo/dark.svg +6 -0
- package/docs-MachinaOs/logo/light.svg +6 -0
- package/docs-MachinaOs/nodes/ai-agent.mdx +216 -0
- package/docs-MachinaOs/nodes/ai-models.mdx +240 -0
- package/docs-MachinaOs/nodes/android.mdx +411 -0
- package/docs-MachinaOs/nodes/overview.mdx +181 -0
- package/docs-MachinaOs/nodes/schedulers.mdx +316 -0
- package/docs-MachinaOs/nodes/webhooks.mdx +330 -0
- package/docs-MachinaOs/nodes/whatsapp.mdx +305 -0
- package/docs-MachinaOs/quickstart.mdx +119 -0
- package/docs-MachinaOs/tutorials/ai-agent-workflow.mdx +177 -0
- package/docs-MachinaOs/tutorials/android-automation.mdx +242 -0
- package/docs-MachinaOs/tutorials/first-workflow.mdx +134 -0
- package/docs-MachinaOs/tutorials/whatsapp-automation.mdx +185 -0
- package/nul +0 -0
- package/package.json +70 -0
- package/scripts/build.js +158 -0
- package/scripts/check-ports.ps1 +33 -0
- package/scripts/clean.js +40 -0
- package/scripts/docker.js +93 -0
- package/scripts/kill-port.ps1 +154 -0
- package/scripts/start.js +210 -0
- package/scripts/stop.js +325 -0
- package/server/.dockerignore +44 -0
- package/server/Dockerfile +45 -0
- package/server/constants.py +249 -0
- package/server/core/__init__.py +1 -0
- package/server/core/cache.py +461 -0
- package/server/core/config.py +128 -0
- package/server/core/container.py +99 -0
- package/server/core/database.py +1211 -0
- package/server/core/logging.py +314 -0
- package/server/main.py +289 -0
- package/server/middleware/__init__.py +5 -0
- package/server/middleware/auth.py +89 -0
- package/server/models/__init__.py +1 -0
- package/server/models/auth.py +52 -0
- package/server/models/cache.py +24 -0
- package/server/models/database.py +211 -0
- package/server/models/nodes.py +455 -0
- package/server/package.json +9 -0
- package/server/pyproject.toml +72 -0
- package/server/requirements.txt +83 -0
- package/server/routers/__init__.py +1 -0
- package/server/routers/android.py +294 -0
- package/server/routers/auth.py +203 -0
- package/server/routers/database.py +151 -0
- package/server/routers/maps.py +142 -0
- package/server/routers/nodejs_compat.py +289 -0
- package/server/routers/webhook.py +90 -0
- package/server/routers/websocket.py +2127 -0
- package/server/routers/whatsapp.py +761 -0
- package/server/routers/workflow.py +200 -0
- package/server/services/__init__.py +1 -0
- package/server/services/ai.py +2415 -0
- package/server/services/android/__init__.py +27 -0
- package/server/services/android/broadcaster.py +114 -0
- package/server/services/android/client.py +608 -0
- package/server/services/android/manager.py +78 -0
- package/server/services/android/protocol.py +165 -0
- package/server/services/android_service.py +588 -0
- package/server/services/auth.py +131 -0
- package/server/services/chat_client.py +160 -0
- package/server/services/deployment/__init__.py +12 -0
- package/server/services/deployment/manager.py +706 -0
- package/server/services/deployment/state.py +47 -0
- package/server/services/deployment/triggers.py +275 -0
- package/server/services/event_waiter.py +785 -0
- package/server/services/execution/__init__.py +77 -0
- package/server/services/execution/cache.py +769 -0
- package/server/services/execution/conditions.py +373 -0
- package/server/services/execution/dlq.py +132 -0
- package/server/services/execution/executor.py +1351 -0
- package/server/services/execution/models.py +531 -0
- package/server/services/execution/recovery.py +235 -0
- package/server/services/handlers/__init__.py +126 -0
- package/server/services/handlers/ai.py +355 -0
- package/server/services/handlers/android.py +260 -0
- package/server/services/handlers/code.py +278 -0
- package/server/services/handlers/document.py +598 -0
- package/server/services/handlers/http.py +193 -0
- package/server/services/handlers/polyglot.py +105 -0
- package/server/services/handlers/tools.py +845 -0
- package/server/services/handlers/triggers.py +107 -0
- package/server/services/handlers/utility.py +822 -0
- package/server/services/handlers/whatsapp.py +476 -0
- package/server/services/maps.py +289 -0
- package/server/services/memory_store.py +103 -0
- package/server/services/node_executor.py +375 -0
- package/server/services/parameter_resolver.py +218 -0
- package/server/services/polyglot_client.py +169 -0
- package/server/services/scheduler.py +155 -0
- package/server/services/skill_loader.py +417 -0
- package/server/services/status_broadcaster.py +826 -0
- package/server/services/temporal/__init__.py +23 -0
- package/server/services/temporal/activities.py +344 -0
- package/server/services/temporal/client.py +76 -0
- package/server/services/temporal/executor.py +147 -0
- package/server/services/temporal/worker.py +251 -0
- package/server/services/temporal/workflow.py +355 -0
- package/server/services/temporal/ws_client.py +236 -0
- package/server/services/text.py +111 -0
- package/server/services/user_auth.py +172 -0
- package/server/services/websocket_client.py +29 -0
- package/server/services/workflow.py +597 -0
- package/server/skills/android-skill/SKILL.md +82 -0
- package/server/skills/assistant-personality/SKILL.md +45 -0
- package/server/skills/code-skill/SKILL.md +140 -0
- package/server/skills/http-skill/SKILL.md +161 -0
- package/server/skills/maps-skill/SKILL.md +170 -0
- package/server/skills/memory-skill/SKILL.md +154 -0
- package/server/skills/scheduler-skill/SKILL.md +84 -0
- package/server/skills/whatsapp-skill/SKILL.md +283 -0
- package/server/uv.lock +2916 -0
- package/server/whatsapp-rpc/.dockerignore +30 -0
- package/server/whatsapp-rpc/Dockerfile +44 -0
- package/server/whatsapp-rpc/Dockerfile.web +17 -0
- package/server/whatsapp-rpc/README.md +139 -0
- package/server/whatsapp-rpc/cli.js +95 -0
- package/server/whatsapp-rpc/configs/config.yaml +7 -0
- package/server/whatsapp-rpc/docker-compose.yml +35 -0
- package/server/whatsapp-rpc/docs/API.md +410 -0
- package/server/whatsapp-rpc/go.mod +67 -0
- package/server/whatsapp-rpc/go.sum +203 -0
- package/server/whatsapp-rpc/package.json +30 -0
- package/server/whatsapp-rpc/schema.json +1294 -0
- package/server/whatsapp-rpc/scripts/clean.cjs +66 -0
- package/server/whatsapp-rpc/scripts/cli.js +162 -0
- package/server/whatsapp-rpc/src/go/cmd/server/main.go +91 -0
- package/server/whatsapp-rpc/src/go/config/config.go +49 -0
- package/server/whatsapp-rpc/src/go/rpc/rpc.go +446 -0
- package/server/whatsapp-rpc/src/go/rpc/server.go +112 -0
- package/server/whatsapp-rpc/src/go/whatsapp/history.go +166 -0
- package/server/whatsapp-rpc/src/go/whatsapp/messages.go +390 -0
- package/server/whatsapp-rpc/src/go/whatsapp/service.go +2130 -0
- package/server/whatsapp-rpc/src/go/whatsapp/types.go +261 -0
- package/server/whatsapp-rpc/src/python/pyproject.toml +15 -0
- package/server/whatsapp-rpc/src/python/whatsapp_rpc/__init__.py +4 -0
- package/server/whatsapp-rpc/src/python/whatsapp_rpc/client.py +427 -0
- package/server/whatsapp-rpc/web/app.py +609 -0
- package/server/whatsapp-rpc/web/requirements.txt +6 -0
- package/server/whatsapp-rpc/web/rpc_client.py +427 -0
- package/server/whatsapp-rpc/web/static/openapi.yaml +59 -0
- package/server/whatsapp-rpc/web/templates/base.html +150 -0
- package/server/whatsapp-rpc/web/templates/contacts.html +240 -0
- package/server/whatsapp-rpc/web/templates/dashboard.html +320 -0
- package/server/whatsapp-rpc/web/templates/groups.html +328 -0
- package/server/whatsapp-rpc/web/templates/messages.html +465 -0
- package/server/whatsapp-rpc/web/templates/messaging.html +681 -0
- package/server/whatsapp-rpc/web/templates/send.html +259 -0
- package/server/whatsapp-rpc/web/templates/settings.html +459 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: assistant-personality
|
|
3
|
+
description: General AI assistant with helpful, harmless, and honest responses. Use as the default personality for conversations.
|
|
4
|
+
metadata:
|
|
5
|
+
author: machina
|
|
6
|
+
version: "1.0"
|
|
7
|
+
category: assistant
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Assistant Personality
|
|
11
|
+
|
|
12
|
+
You are a helpful, harmless, and honest AI assistant. Your goal is to assist users with their requests while being truthful and avoiding harmful content.
|
|
13
|
+
|
|
14
|
+
## Core Principles
|
|
15
|
+
|
|
16
|
+
1. **Helpfulness**: Provide clear, accurate, and useful information
|
|
17
|
+
2. **Honesty**: Be truthful about your capabilities and limitations
|
|
18
|
+
3. **Safety**: Avoid generating harmful, illegal, or unethical content
|
|
19
|
+
|
|
20
|
+
## Communication Style
|
|
21
|
+
|
|
22
|
+
- Be concise but thorough
|
|
23
|
+
- Use clear, simple language
|
|
24
|
+
- Break down complex topics into understandable parts
|
|
25
|
+
- Ask clarifying questions when needed
|
|
26
|
+
- Admit when you don't know something
|
|
27
|
+
|
|
28
|
+
## Response Guidelines
|
|
29
|
+
|
|
30
|
+
When responding to users:
|
|
31
|
+
1. Understand the intent behind their question
|
|
32
|
+
2. Provide the most helpful response possible
|
|
33
|
+
3. Include relevant context or caveats
|
|
34
|
+
4. Suggest follow-up questions if appropriate
|
|
35
|
+
|
|
36
|
+
## Examples
|
|
37
|
+
|
|
38
|
+
User: "What's the weather like?"
|
|
39
|
+
Response: I don't have access to real-time weather data. However, I can help you find weather information if you tell me your location, or you can use a weather service like weather.com.
|
|
40
|
+
|
|
41
|
+
User: "Help me write an email"
|
|
42
|
+
Response: I'd be happy to help you write an email. Could you tell me:
|
|
43
|
+
- Who is the recipient?
|
|
44
|
+
- What is the purpose of the email?
|
|
45
|
+
- What tone would you like (formal, casual, etc.)?
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-skill
|
|
3
|
+
description: Execute Python or JavaScript code for calculations, data processing, and automation. Use when user needs to run code, do calculations, or process data.
|
|
4
|
+
allowed-tools: code-python code-javascript
|
|
5
|
+
metadata:
|
|
6
|
+
author: machina
|
|
7
|
+
version: "1.0"
|
|
8
|
+
category: code
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Code Execution
|
|
12
|
+
|
|
13
|
+
This skill enables you to execute Python and JavaScript code for various tasks.
|
|
14
|
+
|
|
15
|
+
## Capabilities
|
|
16
|
+
|
|
17
|
+
- Run Python code with full standard library
|
|
18
|
+
- Execute JavaScript code
|
|
19
|
+
- Perform complex calculations
|
|
20
|
+
- Process and transform data
|
|
21
|
+
- Generate outputs and visualizations
|
|
22
|
+
|
|
23
|
+
## Tool Reference
|
|
24
|
+
|
|
25
|
+
### code-python
|
|
26
|
+
Execute Python code.
|
|
27
|
+
|
|
28
|
+
Parameters:
|
|
29
|
+
- `code` (required): Python code to execute
|
|
30
|
+
- `input_data` (optional): Data to pass to the script (available as `input_data` variable)
|
|
31
|
+
|
|
32
|
+
Returns:
|
|
33
|
+
- output: Script output (print statements)
|
|
34
|
+
- result: Return value if any
|
|
35
|
+
- error: Error message if execution failed
|
|
36
|
+
|
|
37
|
+
### code-javascript
|
|
38
|
+
Execute JavaScript code.
|
|
39
|
+
|
|
40
|
+
Parameters:
|
|
41
|
+
- `code` (required): JavaScript code to execute
|
|
42
|
+
- `input_data` (optional): Data to pass to the script
|
|
43
|
+
|
|
44
|
+
Returns:
|
|
45
|
+
- output: Console output
|
|
46
|
+
- result: Return value
|
|
47
|
+
- error: Error message if execution failed
|
|
48
|
+
|
|
49
|
+
## Python Guidelines
|
|
50
|
+
|
|
51
|
+
### Available Libraries
|
|
52
|
+
- Standard library (math, json, datetime, re, etc.)
|
|
53
|
+
- Data processing (collections, itertools)
|
|
54
|
+
- String manipulation
|
|
55
|
+
|
|
56
|
+
### Input Data Access
|
|
57
|
+
```python
|
|
58
|
+
# Access input data from previous nodes
|
|
59
|
+
data = input_data # Available as global variable
|
|
60
|
+
print(f"Received: {data}")
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Output
|
|
64
|
+
```python
|
|
65
|
+
# Print for output display
|
|
66
|
+
print("Hello, World!")
|
|
67
|
+
|
|
68
|
+
# Return value for downstream nodes
|
|
69
|
+
result = {"status": "success", "value": 42}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## JavaScript Guidelines
|
|
73
|
+
|
|
74
|
+
### Input Data Access
|
|
75
|
+
```javascript
|
|
76
|
+
// Access input data from previous nodes
|
|
77
|
+
const data = input_data;
|
|
78
|
+
console.log(`Received: ${JSON.stringify(data)}`);
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Output
|
|
82
|
+
```javascript
|
|
83
|
+
// Console for output display
|
|
84
|
+
console.log("Hello, World!");
|
|
85
|
+
|
|
86
|
+
// Return value for downstream nodes
|
|
87
|
+
return { status: "success", value: 42 };
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Examples
|
|
91
|
+
|
|
92
|
+
**User**: "Calculate 15% tip on $85.50"
|
|
93
|
+
**Action**: Use code-python with:
|
|
94
|
+
```python
|
|
95
|
+
bill = 85.50
|
|
96
|
+
tip_percent = 15
|
|
97
|
+
tip = bill * (tip_percent / 100)
|
|
98
|
+
total = bill + tip
|
|
99
|
+
print(f"Tip: ${tip:.2f}")
|
|
100
|
+
print(f"Total: ${total:.2f}")
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**User**: "Convert this JSON to CSV"
|
|
104
|
+
**Action**: Use code-python with:
|
|
105
|
+
```python
|
|
106
|
+
import json
|
|
107
|
+
import csv
|
|
108
|
+
import io
|
|
109
|
+
|
|
110
|
+
data = input_data # JSON from previous node
|
|
111
|
+
output = io.StringIO()
|
|
112
|
+
writer = csv.DictWriter(output, fieldnames=data[0].keys())
|
|
113
|
+
writer.writeheader()
|
|
114
|
+
writer.writerows(data)
|
|
115
|
+
print(output.getvalue())
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**User**: "Generate 5 random numbers between 1 and 100"
|
|
119
|
+
**Action**: Use code-python with:
|
|
120
|
+
```python
|
|
121
|
+
import random
|
|
122
|
+
numbers = [random.randint(1, 100) for _ in range(5)]
|
|
123
|
+
print(f"Random numbers: {numbers}")
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Security Guidelines
|
|
127
|
+
|
|
128
|
+
1. **No file system access** outside designated directories
|
|
129
|
+
2. **No network requests** from code (use http-skill instead)
|
|
130
|
+
3. **No system commands** or shell access
|
|
131
|
+
4. **Limited execution time** (timeout after 30 seconds)
|
|
132
|
+
5. **No sensitive data** in code outputs
|
|
133
|
+
|
|
134
|
+
## Best Practices
|
|
135
|
+
|
|
136
|
+
1. Keep code simple and focused on one task
|
|
137
|
+
2. Use descriptive variable names
|
|
138
|
+
3. Add comments for complex logic
|
|
139
|
+
4. Validate input data before processing
|
|
140
|
+
5. Handle potential errors gracefully
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: http-skill
|
|
3
|
+
description: Make HTTP requests to external APIs and web services. Use when user needs to fetch data from URLs, call APIs, or interact with web services.
|
|
4
|
+
allowed-tools: http-request
|
|
5
|
+
metadata:
|
|
6
|
+
author: machina
|
|
7
|
+
version: "2.0"
|
|
8
|
+
category: integration
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# HTTP Requests
|
|
12
|
+
|
|
13
|
+
This skill enables you to make HTTP requests to external APIs and web services.
|
|
14
|
+
|
|
15
|
+
## Capabilities
|
|
16
|
+
|
|
17
|
+
- Make GET, POST, PUT, DELETE, PATCH requests
|
|
18
|
+
- Send JSON payloads in request body
|
|
19
|
+
- Set custom headers (authentication, content-type, etc.)
|
|
20
|
+
- Handle API responses (JSON and text)
|
|
21
|
+
|
|
22
|
+
## Tool Reference
|
|
23
|
+
|
|
24
|
+
### http-request
|
|
25
|
+
|
|
26
|
+
Make an HTTP request to a URL.
|
|
27
|
+
|
|
28
|
+
**Parameters:**
|
|
29
|
+
| Parameter | Type | Required | Default | Description |
|
|
30
|
+
|-----------|------|----------|---------|-------------|
|
|
31
|
+
| `url` | string | Yes | - | Full URL to request (e.g., `https://api.example.com/data`) |
|
|
32
|
+
| `method` | string | No | `GET` | HTTP method: `GET`, `POST`, `PUT`, `DELETE`, `PATCH` |
|
|
33
|
+
| `body` | object | No | null | Request body as JSON object (for POST/PUT/PATCH) |
|
|
34
|
+
| `headers` | object | No | null | Custom headers as key-value pairs |
|
|
35
|
+
|
|
36
|
+
**Returns:**
|
|
37
|
+
| Field | Type | Description |
|
|
38
|
+
|-------|------|-------------|
|
|
39
|
+
| `status` | number | HTTP status code (200, 404, 500, etc.) |
|
|
40
|
+
| `data` | any | Response body (parsed JSON or text) |
|
|
41
|
+
| `headers` | object | Response headers |
|
|
42
|
+
| `url` | string | Final URL (may differ if redirected) |
|
|
43
|
+
| `method` | string | HTTP method used |
|
|
44
|
+
|
|
45
|
+
## Common Use Cases
|
|
46
|
+
|
|
47
|
+
### Fetching Data (GET)
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"url": "https://api.example.com/users/123",
|
|
51
|
+
"method": "GET"
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Creating Resources (POST)
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"url": "https://api.example.com/users",
|
|
59
|
+
"method": "POST",
|
|
60
|
+
"body": {"name": "John", "email": "john@example.com"},
|
|
61
|
+
"headers": {"Content-Type": "application/json"}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Updating Resources (PUT/PATCH)
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"url": "https://api.example.com/users/123",
|
|
69
|
+
"method": "PUT",
|
|
70
|
+
"body": {"name": "John Updated"}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Deleting Resources (DELETE)
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"url": "https://api.example.com/users/123",
|
|
78
|
+
"method": "DELETE"
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### With Authentication
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"url": "https://api.example.com/protected",
|
|
86
|
+
"method": "GET",
|
|
87
|
+
"headers": {
|
|
88
|
+
"Authorization": "Bearer your-api-token",
|
|
89
|
+
"X-API-Key": "your-api-key"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Examples
|
|
95
|
+
|
|
96
|
+
**User**: "Get the current Bitcoin price"
|
|
97
|
+
**Action**: Use http-request with:
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"url": "https://api.coindesk.com/v1/bpi/currentprice.json",
|
|
101
|
+
"method": "GET"
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**User**: "Post this data to my webhook"
|
|
106
|
+
**Action**: Use http-request with:
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"url": "https://webhook.example.com/endpoint",
|
|
110
|
+
"method": "POST",
|
|
111
|
+
"body": {"event": "user_action", "data": "..."},
|
|
112
|
+
"headers": {"Content-Type": "application/json"}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**User**: "Check if example.com is up"
|
|
117
|
+
**Action**: Use http-request with:
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"url": "https://example.com",
|
|
121
|
+
"method": "GET"
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
Then check if status is 200.
|
|
125
|
+
|
|
126
|
+
**User**: "Get weather for New York"
|
|
127
|
+
**Action**: Use http-request with:
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"url": "https://api.openweathermap.org/data/2.5/weather?q=New York&appid=YOUR_KEY",
|
|
131
|
+
"method": "GET"
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Security Guidelines
|
|
136
|
+
|
|
137
|
+
1. **Never expose API keys** in responses to the user
|
|
138
|
+
2. **Validate URLs** - only request from trusted domains
|
|
139
|
+
3. **Don't make requests** to internal/private networks (localhost, 192.168.x.x, 10.x.x.x)
|
|
140
|
+
4. **Respect rate limits** of external services
|
|
141
|
+
5. **Handle errors gracefully** and inform the user clearly
|
|
142
|
+
6. **Don't store sensitive data** from API responses
|
|
143
|
+
|
|
144
|
+
## Error Handling
|
|
145
|
+
|
|
146
|
+
Common HTTP status codes and what they mean:
|
|
147
|
+
|
|
148
|
+
| Status | Meaning | Action |
|
|
149
|
+
|--------|---------|--------|
|
|
150
|
+
| 200-299 | Success | Process the response data |
|
|
151
|
+
| 400 | Bad Request | Check request parameters |
|
|
152
|
+
| 401 | Unauthorized | Check API key/authentication |
|
|
153
|
+
| 403 | Forbidden | Access denied, may need different permissions |
|
|
154
|
+
| 404 | Not Found | Check URL path |
|
|
155
|
+
| 429 | Too Many Requests | Rate limited, wait before retrying |
|
|
156
|
+
| 500-599 | Server Error | External service issue, try again later |
|
|
157
|
+
|
|
158
|
+
When an error occurs, inform the user about:
|
|
159
|
+
- What was attempted
|
|
160
|
+
- What went wrong (status code and message)
|
|
161
|
+
- Suggested next steps
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: maps-skill
|
|
3
|
+
description: Location services including geocoding, nearby places, and maps. Use when user asks about addresses, locations, places nearby, or wants to see a map.
|
|
4
|
+
metadata:
|
|
5
|
+
author: machina
|
|
6
|
+
version: "3.0"
|
|
7
|
+
category: location
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Location Services
|
|
11
|
+
|
|
12
|
+
This skill provides context for location-based capabilities using Google Maps services.
|
|
13
|
+
|
|
14
|
+
## How It Works
|
|
15
|
+
|
|
16
|
+
This skill provides instructions and context. To execute location actions, connect the appropriate **tool nodes** to the Chat Agent's `input-tools` handle:
|
|
17
|
+
|
|
18
|
+
- **Add Locations** node - Geocode addresses to coordinates or reverse geocode
|
|
19
|
+
- **Show Nearby Places** node - Search for nearby places
|
|
20
|
+
|
|
21
|
+
## add_locations Tool (Geocoding)
|
|
22
|
+
|
|
23
|
+
Convert addresses to coordinates or coordinates to addresses.
|
|
24
|
+
|
|
25
|
+
### Schema Fields
|
|
26
|
+
|
|
27
|
+
| Field | Type | Required | Description |
|
|
28
|
+
|-------|------|----------|-------------|
|
|
29
|
+
| service_type | string | Yes | "geocode" (address to coordinates) or "reverse_geocode" (coordinates to address) |
|
|
30
|
+
| address | string | If geocode | Address to geocode (e.g., "1600 Amphitheatre Parkway, Mountain View, CA") |
|
|
31
|
+
| lat | float | If reverse_geocode | Latitude coordinate |
|
|
32
|
+
| lng | float | If reverse_geocode | Longitude coordinate |
|
|
33
|
+
|
|
34
|
+
### Examples
|
|
35
|
+
|
|
36
|
+
**Geocode address:**
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"service_type": "geocode",
|
|
40
|
+
"address": "Eiffel Tower, Paris"
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Reverse geocode:**
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"service_type": "reverse_geocode",
|
|
48
|
+
"lat": 48.8584,
|
|
49
|
+
"lng": 2.2945
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Response Format
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"success": true,
|
|
58
|
+
"service_type": "geocoding",
|
|
59
|
+
"input": {"address": "Eiffel Tower, Paris"},
|
|
60
|
+
"results": [
|
|
61
|
+
{
|
|
62
|
+
"formatted_address": "Champ de Mars, 5 Av. Anatole France, 75007 Paris, France",
|
|
63
|
+
"geometry": {
|
|
64
|
+
"location": {"lat": 48.8583701, "lng": 2.2944813}
|
|
65
|
+
},
|
|
66
|
+
"address_components": [...]
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"status": "OK"
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## show_nearby_places Tool
|
|
74
|
+
|
|
75
|
+
Search for places near a location.
|
|
76
|
+
|
|
77
|
+
### Schema Fields
|
|
78
|
+
|
|
79
|
+
| Field | Type | Required | Description |
|
|
80
|
+
|-------|------|----------|-------------|
|
|
81
|
+
| lat | float | Yes | Center latitude for search |
|
|
82
|
+
| lng | float | Yes | Center longitude for search |
|
|
83
|
+
| radius | int | No | Search radius in meters (default: 500, max: 50000) |
|
|
84
|
+
| type | string | No | Place type (default: "restaurant") |
|
|
85
|
+
| keyword | string | No | Optional keyword to filter results |
|
|
86
|
+
|
|
87
|
+
### Examples
|
|
88
|
+
|
|
89
|
+
**Find nearby restaurants:**
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"lat": 40.7484,
|
|
93
|
+
"lng": -73.9857,
|
|
94
|
+
"radius": 500,
|
|
95
|
+
"type": "restaurant"
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Find coffee shops near a location:**
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"lat": 37.7749,
|
|
103
|
+
"lng": -122.4194,
|
|
104
|
+
"type": "cafe",
|
|
105
|
+
"keyword": "starbucks"
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Response Format
|
|
110
|
+
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"success": true,
|
|
114
|
+
"type": "restaurant",
|
|
115
|
+
"search_parameters": {
|
|
116
|
+
"location": {"lat": 40.7484, "lng": -73.9857},
|
|
117
|
+
"radius": 500,
|
|
118
|
+
"type": "restaurant"
|
|
119
|
+
},
|
|
120
|
+
"results": [
|
|
121
|
+
{
|
|
122
|
+
"name": "Example Restaurant",
|
|
123
|
+
"vicinity": "123 Main St",
|
|
124
|
+
"rating": 4.5,
|
|
125
|
+
"user_ratings_total": 150,
|
|
126
|
+
"price_level": 2,
|
|
127
|
+
"geometry": {
|
|
128
|
+
"location": {"lat": 40.7485, "lng": -73.9860}
|
|
129
|
+
},
|
|
130
|
+
"types": ["restaurant", "food"],
|
|
131
|
+
"opening_hours": {"open_now": true}
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
"total_results": 10,
|
|
135
|
+
"status": "OK"
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Place Types
|
|
140
|
+
|
|
141
|
+
Common place types for nearby search:
|
|
142
|
+
- Food: restaurant, cafe, bakery, bar, meal_takeaway
|
|
143
|
+
- Shopping: store, supermarket, shopping_mall, clothing_store
|
|
144
|
+
- Services: bank, atm, gas_station, pharmacy, post_office
|
|
145
|
+
- Health: hospital, doctor, dentist, pharmacy
|
|
146
|
+
- Transport: bus_station, train_station, airport, taxi_stand
|
|
147
|
+
- Entertainment: movie_theater, gym, park, museum, zoo
|
|
148
|
+
|
|
149
|
+
## Common Workflows
|
|
150
|
+
|
|
151
|
+
### Find nearby places by address
|
|
152
|
+
1. Use `add_locations` with service_type="geocode" to get coordinates
|
|
153
|
+
2. Use `show_nearby_places` with the returned lat/lng
|
|
154
|
+
|
|
155
|
+
### Get address from coordinates
|
|
156
|
+
1. Use `add_locations` with service_type="reverse_geocode"
|
|
157
|
+
|
|
158
|
+
## Response Guidelines
|
|
159
|
+
|
|
160
|
+
When presenting location results:
|
|
161
|
+
1. List the top results with name, rating, and address
|
|
162
|
+
2. Include distance if available
|
|
163
|
+
3. Mention if places are currently open
|
|
164
|
+
4. Offer to search for different types or expand radius
|
|
165
|
+
|
|
166
|
+
## Setup Requirements
|
|
167
|
+
|
|
168
|
+
1. Connect this skill to Chat Agent's `input-skill` handle
|
|
169
|
+
2. Connect location tool nodes to Chat Agent's `input-tools` handle
|
|
170
|
+
3. Ensure Google Maps API key is configured in credentials
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: memory-skill
|
|
3
|
+
description: Manage conversation memory. Use when user asks to remember something, recall information, view/edit conversation history, or manage short/long-term memory.
|
|
4
|
+
allowed-tools: memory-save memory-get memory-clear memory-view memory-search
|
|
5
|
+
metadata:
|
|
6
|
+
author: machina
|
|
7
|
+
version: "2.0"
|
|
8
|
+
category: memory
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Memory Management Skill
|
|
12
|
+
|
|
13
|
+
This skill enables you to manage conversation memory using the SimpleMemory node's markdown-based storage system.
|
|
14
|
+
|
|
15
|
+
## Memory Architecture
|
|
16
|
+
|
|
17
|
+
### Short-Term Memory (Markdown)
|
|
18
|
+
- Visible and editable in the SimpleMemory node's UI
|
|
19
|
+
- Stored as markdown with timestamped entries
|
|
20
|
+
- Window-based: keeps last N message pairs (configurable)
|
|
21
|
+
- Format: `### **Human** (timestamp)` and `### **Assistant** (timestamp)`
|
|
22
|
+
|
|
23
|
+
### Long-Term Memory (Vector DB)
|
|
24
|
+
- Automatically archives messages that exceed the window
|
|
25
|
+
- Semantic search for relevant past conversations
|
|
26
|
+
- Enabled via `longTermEnabled` in SimpleMemory node
|
|
27
|
+
|
|
28
|
+
## Capabilities
|
|
29
|
+
|
|
30
|
+
1. **View History**: See recent conversation in markdown format
|
|
31
|
+
2. **Save Notes**: Add explicit notes/memories to the conversation
|
|
32
|
+
3. **Search Memory**: Find relevant past conversations semantically
|
|
33
|
+
4. **Clear Memory**: Reset conversation history
|
|
34
|
+
|
|
35
|
+
## When to Use
|
|
36
|
+
|
|
37
|
+
**Save information when:**
|
|
38
|
+
- User says "remember this" or "don't forget"
|
|
39
|
+
- Important context is shared for future use
|
|
40
|
+
- User wants to note something specific
|
|
41
|
+
|
|
42
|
+
**Recall information when:**
|
|
43
|
+
- User asks "do you remember..."
|
|
44
|
+
- Context from earlier is needed
|
|
45
|
+
- User references previous discussions
|
|
46
|
+
|
|
47
|
+
**View history when:**
|
|
48
|
+
- User wants to see conversation log
|
|
49
|
+
- Debugging or reviewing past exchanges
|
|
50
|
+
|
|
51
|
+
## Tool Reference
|
|
52
|
+
|
|
53
|
+
### memory-save
|
|
54
|
+
Add a note or memory entry to the conversation history.
|
|
55
|
+
|
|
56
|
+
Parameters:
|
|
57
|
+
- `content` (required): Information to remember
|
|
58
|
+
- `role` (optional): "note" (default) or "context"
|
|
59
|
+
|
|
60
|
+
Example:
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"content": "User's favorite color is blue",
|
|
64
|
+
"role": "note"
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### memory-get
|
|
69
|
+
Get recent conversation history or search for specific content.
|
|
70
|
+
|
|
71
|
+
Parameters:
|
|
72
|
+
- `count` (optional): Number of recent messages (default: 10)
|
|
73
|
+
- `search` (optional): Search term to find specific memories
|
|
74
|
+
|
|
75
|
+
Example - Recent history:
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"count": 5
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Example - Search:
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"search": "favorite color"
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### memory-clear
|
|
90
|
+
Clear conversation history.
|
|
91
|
+
|
|
92
|
+
Parameters:
|
|
93
|
+
- `confirm` (required): Must be true to clear
|
|
94
|
+
|
|
95
|
+
Example:
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"confirm": true
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### memory-view
|
|
103
|
+
View the current conversation history in markdown format.
|
|
104
|
+
|
|
105
|
+
Parameters: None
|
|
106
|
+
|
|
107
|
+
Returns the full markdown content of the conversation history.
|
|
108
|
+
|
|
109
|
+
### memory-search
|
|
110
|
+
Semantic search in long-term memory (if enabled).
|
|
111
|
+
|
|
112
|
+
Parameters:
|
|
113
|
+
- `query` (required): Search query
|
|
114
|
+
- `count` (optional): Number of results (default: 3)
|
|
115
|
+
|
|
116
|
+
Example:
|
|
117
|
+
```json
|
|
118
|
+
{
|
|
119
|
+
"query": "what did we discuss about the project",
|
|
120
|
+
"count": 5
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Markdown Format
|
|
125
|
+
|
|
126
|
+
The conversation history uses this format:
|
|
127
|
+
|
|
128
|
+
```markdown
|
|
129
|
+
# Conversation History
|
|
130
|
+
|
|
131
|
+
### **Human** (2025-01-30 10:15:32)
|
|
132
|
+
Hello, how are you?
|
|
133
|
+
|
|
134
|
+
### **Assistant** (2025-01-30 10:15:35)
|
|
135
|
+
I'm doing well! How can I help you today?
|
|
136
|
+
|
|
137
|
+
### **Note** (2025-01-30 10:16:00)
|
|
138
|
+
User prefers formal language.
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Integration with SimpleMemory Node
|
|
142
|
+
|
|
143
|
+
When connected to a Chat Agent:
|
|
144
|
+
1. Conversation is automatically logged to markdown
|
|
145
|
+
2. Window size limits short-term memory
|
|
146
|
+
3. Overflow archives to vector DB (if long-term enabled)
|
|
147
|
+
4. You can view/edit the markdown in the node's parameter panel
|
|
148
|
+
|
|
149
|
+
## Best Practices
|
|
150
|
+
|
|
151
|
+
1. Use memory-save for explicit user requests to remember
|
|
152
|
+
2. Use memory-search for semantic recall of past discussions
|
|
153
|
+
3. Don't save sensitive information without user consent
|
|
154
|
+
4. The markdown is editable - users can manually curate their history
|