flowent 0.0.6 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -4
- package/backend/README.md +1 -4
- package/backend/pyproject.toml +2 -8
- package/backend/src/flowent/__pycache__/__init__.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/agent.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/cli.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/context.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/llm.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/logging.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/main.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/patch.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/paths.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/sandbox.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/storage.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/tools.cpython-313.pyc +0 -0
- package/backend/src/flowent/agent.py +217 -3094
- package/backend/src/flowent/cli.py +19 -24
- package/backend/src/flowent/context.py +127 -0
- package/backend/src/flowent/llm.py +256 -0
- package/backend/src/flowent/logging.py +170 -129
- package/backend/src/flowent/main.py +321 -70
- package/backend/src/flowent/patch.py +182 -0
- package/backend/src/flowent/paths.py +11 -0
- package/backend/src/flowent/sandbox.py +214 -40
- package/backend/src/flowent/static/assets/geist-cyrillic-wght-normal-CHSlOQsW.woff2 +0 -0
- package/backend/src/flowent/static/assets/geist-latin-ext-wght-normal-DMtmJ5ZE.woff2 +0 -0
- package/backend/src/flowent/static/assets/geist-latin-wght-normal-Dm3htQBi.woff2 +0 -0
- package/backend/src/flowent/static/assets/index-C76K95ty.js +81 -0
- package/backend/src/flowent/static/assets/index-iUMNKvlU.css +2 -0
- package/backend/src/flowent/static/flowent.png +0 -0
- package/backend/src/flowent/static/index.html +5 -25
- package/backend/src/flowent/storage.py +302 -0
- package/backend/src/flowent/tools.py +364 -0
- package/backend/tests/__pycache__/test_agent_tools.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/__pycache__/test_health.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/__pycache__/test_llm_providers.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/__pycache__/test_logging.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/__pycache__/test_persistence.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/__pycache__/test_workspace_chat.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/test_agent_tools.py +449 -0
- package/backend/tests/test_health.py +12 -0
- package/backend/tests/test_llm_providers.py +113 -0
- package/backend/tests/test_logging.py +182 -0
- package/backend/tests/test_persistence.py +125 -0
- package/backend/tests/test_workspace_chat.py +578 -0
- package/backend/uv.lock +803 -99
- package/dist/frontend/assets/geist-cyrillic-wght-normal-CHSlOQsW.woff2 +0 -0
- package/dist/frontend/assets/geist-latin-ext-wght-normal-DMtmJ5ZE.woff2 +0 -0
- package/dist/frontend/assets/geist-latin-wght-normal-Dm3htQBi.woff2 +0 -0
- package/dist/frontend/assets/index-C76K95ty.js +81 -0
- package/dist/frontend/assets/index-iUMNKvlU.css +2 -0
- package/dist/frontend/flowent.png +0 -0
- package/dist/frontend/index.html +5 -25
- package/package.json +1 -2
- package/backend/src/flowent/__pycache__/_version.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/access.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/assistant_commands.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/config.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/events.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/graph_runtime.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/graph_service.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/image_assets.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/mcp_service.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/model_metadata.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/network.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/observability_service.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/registry.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/role_management.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/runtime.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/security.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/settings.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/settings_management.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/state_db.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/workspace_store.cpython-313.pyc +0 -0
- package/backend/src/flowent/access.py +0 -247
- package/backend/src/flowent/assistant_commands.py +0 -115
- package/backend/src/flowent/channels/__init__.py +0 -3
- package/backend/src/flowent/channels/__pycache__/__init__.cpython-313.pyc +0 -0
- package/backend/src/flowent/channels/__pycache__/telegram.cpython-313.pyc +0 -0
- package/backend/src/flowent/channels/telegram.py +0 -615
- package/backend/src/flowent/config.py +0 -14
- package/backend/src/flowent/dev.py +0 -3
- package/backend/src/flowent/events.py +0 -157
- package/backend/src/flowent/graph_runtime.py +0 -60
- package/backend/src/flowent/graph_service.py +0 -2508
- package/backend/src/flowent/image_assets.py +0 -356
- package/backend/src/flowent/mcp_service.py +0 -1918
- package/backend/src/flowent/model_metadata.py +0 -102
- package/backend/src/flowent/models/__init__.py +0 -125
- package/backend/src/flowent/models/__pycache__/__init__.cpython-313.pyc +0 -0
- package/backend/src/flowent/models/__pycache__/agent.cpython-313.pyc +0 -0
- package/backend/src/flowent/models/__pycache__/base.cpython-313.pyc +0 -0
- package/backend/src/flowent/models/__pycache__/blueprint.cpython-313.pyc +0 -0
- package/backend/src/flowent/models/__pycache__/content.cpython-313.pyc +0 -0
- package/backend/src/flowent/models/__pycache__/delta.cpython-313.pyc +0 -0
- package/backend/src/flowent/models/__pycache__/event.cpython-313.pyc +0 -0
- package/backend/src/flowent/models/__pycache__/graph.cpython-313.pyc +0 -0
- package/backend/src/flowent/models/__pycache__/history.cpython-313.pyc +0 -0
- package/backend/src/flowent/models/__pycache__/llm.cpython-313.pyc +0 -0
- package/backend/src/flowent/models/__pycache__/message.cpython-313.pyc +0 -0
- package/backend/src/flowent/models/__pycache__/tab.cpython-313.pyc +0 -0
- package/backend/src/flowent/models/__pycache__/todo.cpython-313.pyc +0 -0
- package/backend/src/flowent/models/agent.py +0 -34
- package/backend/src/flowent/models/base.py +0 -24
- package/backend/src/flowent/models/blueprint.py +0 -176
- package/backend/src/flowent/models/content.py +0 -164
- package/backend/src/flowent/models/delta.py +0 -44
- package/backend/src/flowent/models/event.py +0 -51
- package/backend/src/flowent/models/graph.py +0 -472
- package/backend/src/flowent/models/history.py +0 -272
- package/backend/src/flowent/models/llm.py +0 -62
- package/backend/src/flowent/models/message.py +0 -33
- package/backend/src/flowent/models/tab.py +0 -85
- package/backend/src/flowent/models/todo.py +0 -10
- package/backend/src/flowent/network.py +0 -146
- package/backend/src/flowent/observability_service.py +0 -218
- package/backend/src/flowent/prompts/__init__.py +0 -67
- package/backend/src/flowent/prompts/__pycache__/__init__.cpython-313.pyc +0 -0
- package/backend/src/flowent/prompts/__pycache__/common.cpython-313.pyc +0 -0
- package/backend/src/flowent/prompts/__pycache__/steward.cpython-313.pyc +0 -0
- package/backend/src/flowent/prompts/common.py +0 -250
- package/backend/src/flowent/prompts/steward.py +0 -64
- package/backend/src/flowent/providers/__init__.py +0 -23
- package/backend/src/flowent/providers/__pycache__/__init__.cpython-313.pyc +0 -0
- package/backend/src/flowent/providers/__pycache__/anthropic.cpython-313.pyc +0 -0
- package/backend/src/flowent/providers/__pycache__/base_url.cpython-313.pyc +0 -0
- package/backend/src/flowent/providers/__pycache__/configuration.cpython-313.pyc +0 -0
- package/backend/src/flowent/providers/__pycache__/content.cpython-313.pyc +0 -0
- package/backend/src/flowent/providers/__pycache__/errors.cpython-313.pyc +0 -0
- package/backend/src/flowent/providers/__pycache__/gateway.cpython-313.pyc +0 -0
- package/backend/src/flowent/providers/__pycache__/headers.cpython-313.pyc +0 -0
- package/backend/src/flowent/providers/__pycache__/management.cpython-313.pyc +0 -0
- package/backend/src/flowent/providers/__pycache__/openai.cpython-313.pyc +0 -0
- package/backend/src/flowent/providers/__pycache__/openai_responses.cpython-313.pyc +0 -0
- package/backend/src/flowent/providers/__pycache__/registry.cpython-313.pyc +0 -0
- package/backend/src/flowent/providers/__pycache__/sse.cpython-313.pyc +0 -0
- package/backend/src/flowent/providers/__pycache__/thinking.cpython-313.pyc +0 -0
- package/backend/src/flowent/providers/anthropic.py +0 -468
- package/backend/src/flowent/providers/base_url.py +0 -60
- package/backend/src/flowent/providers/configuration.py +0 -189
- package/backend/src/flowent/providers/content.py +0 -122
- package/backend/src/flowent/providers/errors.py +0 -223
- package/backend/src/flowent/providers/gateway.py +0 -169
- package/backend/src/flowent/providers/gemini.py +0 -447
- package/backend/src/flowent/providers/headers.py +0 -20
- package/backend/src/flowent/providers/management.py +0 -96
- package/backend/src/flowent/providers/ollama.py +0 -293
- package/backend/src/flowent/providers/openai.py +0 -422
- package/backend/src/flowent/providers/openai_responses.py +0 -655
- package/backend/src/flowent/providers/registry.py +0 -144
- package/backend/src/flowent/providers/sse.py +0 -31
- package/backend/src/flowent/providers/thinking.py +0 -79
- package/backend/src/flowent/registry.py +0 -73
- package/backend/src/flowent/role_management.py +0 -267
- package/backend/src/flowent/routes/__init__.py +0 -28
- package/backend/src/flowent/routes/__pycache__/__init__.cpython-313.pyc +0 -0
- package/backend/src/flowent/routes/__pycache__/access.cpython-313.pyc +0 -0
- package/backend/src/flowent/routes/__pycache__/assistant.cpython-313.pyc +0 -0
- package/backend/src/flowent/routes/__pycache__/image_assets.cpython-313.pyc +0 -0
- package/backend/src/flowent/routes/__pycache__/mcp.cpython-313.pyc +0 -0
- package/backend/src/flowent/routes/__pycache__/meta.cpython-313.pyc +0 -0
- package/backend/src/flowent/routes/__pycache__/nodes.cpython-313.pyc +0 -0
- package/backend/src/flowent/routes/__pycache__/prompts.cpython-313.pyc +0 -0
- package/backend/src/flowent/routes/__pycache__/providers_route.cpython-313.pyc +0 -0
- package/backend/src/flowent/routes/__pycache__/roles.cpython-313.pyc +0 -0
- package/backend/src/flowent/routes/__pycache__/settings.cpython-313.pyc +0 -0
- package/backend/src/flowent/routes/__pycache__/tabs.cpython-313.pyc +0 -0
- package/backend/src/flowent/routes/__pycache__/ws.cpython-313.pyc +0 -0
- package/backend/src/flowent/routes/access.py +0 -48
- package/backend/src/flowent/routes/assistant.py +0 -155
- package/backend/src/flowent/routes/image_assets.py +0 -33
- package/backend/src/flowent/routes/mcp.py +0 -125
- package/backend/src/flowent/routes/meta.py +0 -28
- package/backend/src/flowent/routes/nodes.py +0 -413
- package/backend/src/flowent/routes/prompts.py +0 -46
- package/backend/src/flowent/routes/providers_route.py +0 -365
- package/backend/src/flowent/routes/roles.py +0 -207
- package/backend/src/flowent/routes/settings.py +0 -328
- package/backend/src/flowent/routes/tabs.py +0 -310
- package/backend/src/flowent/routes/ws.py +0 -33
- package/backend/src/flowent/runtime.py +0 -165
- package/backend/src/flowent/security.py +0 -57
- package/backend/src/flowent/settings.py +0 -2518
- package/backend/src/flowent/settings_management.py +0 -298
- package/backend/src/flowent/state_db.py +0 -120
- package/backend/src/flowent/static/assets/AssistantPage-VBohhz4d.js +0 -1
- package/backend/src/flowent/static/assets/ChannelsPage-CIydPZA_.js +0 -1
- package/backend/src/flowent/static/assets/McpPage-CHPm2TPY.js +0 -7
- package/backend/src/flowent/static/assets/PageScaffold-DteOA8V7.js +0 -1
- package/backend/src/flowent/static/assets/PromptsPage-CSmJ3sZg.js +0 -1
- package/backend/src/flowent/static/assets/ProvidersPage-sl2jeG4e.js +0 -3
- package/backend/src/flowent/static/assets/RolesPage-DCe7W6Km.js +0 -1
- package/backend/src/flowent/static/assets/SettingsPage-Bix9e63E.js +0 -3
- package/backend/src/flowent/static/assets/ToolsPage-favNkj5C.js +0 -1
- package/backend/src/flowent/static/assets/WorkspaceCommandDialog-DRS6wiD6.js +0 -1
- package/backend/src/flowent/static/assets/WorkspacePage-KuaDjt_D.js +0 -3
- package/backend/src/flowent/static/assets/WorkspacePanels-BZxBw8M5.js +0 -1
- package/backend/src/flowent/static/assets/alert-dialog-DIBUCmqM.js +0 -1
- package/backend/src/flowent/static/assets/datetime-eJqd0V2S.js +0 -1
- package/backend/src/flowent/static/assets/dialog-BOvHIBrg.js +0 -1
- package/backend/src/flowent/static/assets/elk-worker.min-C9JGDOE-.js +0 -6312
- package/backend/src/flowent/static/assets/graph-vendor-CHpVij2M.css +0 -1
- package/backend/src/flowent/static/assets/graph-vendor-DRq_-6fV.js +0 -7
- package/backend/src/flowent/static/assets/index-Biio-CoI.js +0 -10
- package/backend/src/flowent/static/assets/index-CmQvO7sl.css +0 -1
- package/backend/src/flowent/static/assets/layout.worker-jMHqAFbP.js +0 -24
- package/backend/src/flowent/static/assets/markdown-vendor-C9RtvaJh.js +0 -29
- package/backend/src/flowent/static/assets/modelParams-DcEhGnu0.js +0 -1
- package/backend/src/flowent/static/assets/react-vendor-mEs_JJxa.js +0 -9
- package/backend/src/flowent/static/assets/roles-BbIEIMeG.js +0 -1
- package/backend/src/flowent/static/assets/rolldown-runtime-BYbx6iT9.js +0 -1
- package/backend/src/flowent/static/assets/select-D9SwnlXF.js +0 -1
- package/backend/src/flowent/static/assets/surface-Bzr1FRG4.js +0 -1
- package/backend/src/flowent/static/assets/triState-DgLlKdRR.js +0 -1
- package/backend/src/flowent/static/assets/ui-vendor-UazN8rcv.js +0 -51
- package/backend/src/flowent/static/favicon.svg +0 -4
- package/backend/src/flowent/tools/__init__.py +0 -275
- package/backend/src/flowent/tools/__pycache__/__init__.cpython-313.pyc +0 -0
- package/backend/src/flowent/tools/__pycache__/connect.cpython-313.pyc +0 -0
- package/backend/src/flowent/tools/__pycache__/contacts.cpython-313.pyc +0 -0
- package/backend/src/flowent/tools/__pycache__/create_agent.cpython-313.pyc +0 -0
- package/backend/src/flowent/tools/__pycache__/create_tab.cpython-313.pyc +0 -0
- package/backend/src/flowent/tools/__pycache__/delete_tab.cpython-313.pyc +0 -0
- package/backend/src/flowent/tools/__pycache__/edit.cpython-313.pyc +0 -0
- package/backend/src/flowent/tools/__pycache__/exec.cpython-313.pyc +0 -0
- package/backend/src/flowent/tools/__pycache__/fetch.cpython-313.pyc +0 -0
- package/backend/src/flowent/tools/__pycache__/idle.cpython-313.pyc +0 -0
- package/backend/src/flowent/tools/__pycache__/list_roles.cpython-313.pyc +0 -0
- package/backend/src/flowent/tools/__pycache__/list_tabs.cpython-313.pyc +0 -0
- package/backend/src/flowent/tools/__pycache__/list_tools.cpython-313.pyc +0 -0
- package/backend/src/flowent/tools/__pycache__/manage_prompts.cpython-313.pyc +0 -0
- package/backend/src/flowent/tools/__pycache__/manage_providers.cpython-313.pyc +0 -0
- package/backend/src/flowent/tools/__pycache__/manage_roles.cpython-313.pyc +0 -0
- package/backend/src/flowent/tools/__pycache__/manage_settings.cpython-313.pyc +0 -0
- package/backend/src/flowent/tools/__pycache__/mcp.cpython-313.pyc +0 -0
- package/backend/src/flowent/tools/__pycache__/read.cpython-313.pyc +0 -0
- package/backend/src/flowent/tools/__pycache__/send.cpython-313.pyc +0 -0
- package/backend/src/flowent/tools/__pycache__/set_permissions.cpython-313.pyc +0 -0
- package/backend/src/flowent/tools/__pycache__/sleep.cpython-313.pyc +0 -0
- package/backend/src/flowent/tools/__pycache__/todo.cpython-313.pyc +0 -0
- package/backend/src/flowent/tools/connect.py +0 -100
- package/backend/src/flowent/tools/contacts.py +0 -22
- package/backend/src/flowent/tools/create_agent.py +0 -191
- package/backend/src/flowent/tools/create_tab.py +0 -61
- package/backend/src/flowent/tools/delete_tab.py +0 -39
- package/backend/src/flowent/tools/edit.py +0 -142
- package/backend/src/flowent/tools/exec.py +0 -118
- package/backend/src/flowent/tools/fetch.py +0 -85
- package/backend/src/flowent/tools/idle.py +0 -27
- package/backend/src/flowent/tools/list_roles.py +0 -75
- package/backend/src/flowent/tools/list_tabs.py +0 -100
- package/backend/src/flowent/tools/list_tools.py +0 -28
- package/backend/src/flowent/tools/manage_prompts.py +0 -102
- package/backend/src/flowent/tools/manage_providers.py +0 -220
- package/backend/src/flowent/tools/manage_roles.py +0 -275
- package/backend/src/flowent/tools/manage_settings.py +0 -364
- package/backend/src/flowent/tools/mcp.py +0 -199
- package/backend/src/flowent/tools/read.py +0 -152
- package/backend/src/flowent/tools/send.py +0 -68
- package/backend/src/flowent/tools/set_permissions.py +0 -99
- package/backend/src/flowent/tools/sleep.py +0 -41
- package/backend/src/flowent/tools/todo.py +0 -51
- package/backend/src/flowent/workspace_store.py +0 -479
- package/backend/tests/__init__.py +0 -0
- package/backend/tests/__pycache__/__init__.cpython-313.pyc +0 -0
- package/backend/tests/__pycache__/conftest.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/conftest.py +0 -6
- package/backend/tests/integration/api/__pycache__/conftest.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/integration/api/__pycache__/test_access_api.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/integration/api/__pycache__/test_assistant_api.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/integration/api/__pycache__/test_frontend_mounting.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/integration/api/__pycache__/test_mcp_api.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/integration/api/__pycache__/test_meta_api.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/integration/api/__pycache__/test_nodes_api.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/integration/api/__pycache__/test_prompts_api.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/integration/api/__pycache__/test_roles_api.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/integration/api/__pycache__/test_tabs_api.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/integration/api/conftest.py +0 -29
- package/backend/tests/integration/api/test_access_api.py +0 -182
- package/backend/tests/integration/api/test_assistant_api.py +0 -354
- package/backend/tests/integration/api/test_frontend_mounting.py +0 -61
- package/backend/tests/integration/api/test_mcp_api.py +0 -116
- package/backend/tests/integration/api/test_meta_api.py +0 -33
- package/backend/tests/integration/api/test_nodes_api.py +0 -722
- package/backend/tests/integration/api/test_prompts_api.py +0 -47
- package/backend/tests/integration/api/test_roles_api.py +0 -228
- package/backend/tests/integration/api/test_tabs_api.py +0 -802
- package/backend/tests/unit/__pycache__/test_access.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/__pycache__/test_cli.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/__pycache__/test_graph_runtime.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/__pycache__/test_network.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/__pycache__/test_state_sqlite_storage.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/__pycache__/test_workspace_store.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/agent/__pycache__/test_agent_public_api.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/agent/__pycache__/test_agent_runtime.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/agent/test_agent_public_api.py +0 -837
- package/backend/tests/unit/agent/test_agent_runtime.py +0 -2942
- package/backend/tests/unit/channels/__pycache__/test_telegram_channel.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/channels/test_telegram_channel.py +0 -552
- package/backend/tests/unit/logging/__pycache__/test_logging.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/logging/test_logging.py +0 -132
- package/backend/tests/unit/prompts/__pycache__/test_prompts.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/prompts/test_prompts.py +0 -570
- package/backend/tests/unit/providers/__pycache__/test_anthropic_provider.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/providers/__pycache__/test_errors.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/providers/__pycache__/test_extract_delta_parts.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/providers/__pycache__/test_openai_provider.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/providers/__pycache__/test_openai_responses.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/providers/__pycache__/test_provider_gateway.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/providers/__pycache__/test_think_tag_parser.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/providers/test_anthropic_provider.py +0 -185
- package/backend/tests/unit/providers/test_errors.py +0 -68
- package/backend/tests/unit/providers/test_extract_delta_parts.py +0 -22
- package/backend/tests/unit/providers/test_openai_provider.py +0 -139
- package/backend/tests/unit/providers/test_openai_responses.py +0 -402
- package/backend/tests/unit/providers/test_provider_gateway.py +0 -359
- package/backend/tests/unit/providers/test_think_tag_parser.py +0 -36
- package/backend/tests/unit/routes/__pycache__/test_prompts_routes.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/routes/__pycache__/test_providers_route.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/routes/__pycache__/test_roles_routes.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/routes/__pycache__/test_settings_routes.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/routes/test_prompts_routes.py +0 -104
- package/backend/tests/unit/routes/test_providers_route.py +0 -370
- package/backend/tests/unit/routes/test_roles_routes.py +0 -535
- package/backend/tests/unit/routes/test_settings_routes.py +0 -1142
- package/backend/tests/unit/runtime/__pycache__/test_bootstrap_runtime.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/runtime/test_bootstrap_runtime.py +0 -1002
- package/backend/tests/unit/sandbox/__pycache__/test_sandbox_tools.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/sandbox/test_sandbox_tools.py +0 -78
- package/backend/tests/unit/security/__pycache__/test_security.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/security/test_security.py +0 -124
- package/backend/tests/unit/settings/__pycache__/test_settings_roles.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/settings/test_settings_roles.py +0 -751
- package/backend/tests/unit/test_access.py +0 -45
- package/backend/tests/unit/test_cli.py +0 -124
- package/backend/tests/unit/test_graph_runtime.py +0 -72
- package/backend/tests/unit/test_network.py +0 -51
- package/backend/tests/unit/test_state_sqlite_storage.py +0 -159
- package/backend/tests/unit/test_workspace_store.py +0 -231
- package/backend/tests/unit/tools/__pycache__/test_connect_tool.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/tools/__pycache__/test_create_agent_tool.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/tools/__pycache__/test_delete_tab_tool.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/tools/__pycache__/test_edit_tool.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/tools/__pycache__/test_exec_tool.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/tools/__pycache__/test_fetch_tool.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/tools/__pycache__/test_manage_prompts_tool.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/tools/__pycache__/test_manage_providers_tool.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/tools/__pycache__/test_manage_roles_tool.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/tools/__pycache__/test_manage_settings_tool.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/tools/__pycache__/test_read_tool.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/tools/__pycache__/test_set_permissions_tool.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/tools/__pycache__/test_todo_tool.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/tools/__pycache__/test_tool_registry.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/unit/tools/test_connect_tool.py +0 -228
- package/backend/tests/unit/tools/test_create_agent_tool.py +0 -436
- package/backend/tests/unit/tools/test_delete_tab_tool.py +0 -116
- package/backend/tests/unit/tools/test_edit_tool.py +0 -115
- package/backend/tests/unit/tools/test_exec_tool.py +0 -81
- package/backend/tests/unit/tools/test_fetch_tool.py +0 -65
- package/backend/tests/unit/tools/test_manage_prompts_tool.py +0 -117
- package/backend/tests/unit/tools/test_manage_providers_tool.py +0 -460
- package/backend/tests/unit/tools/test_manage_roles_tool.py +0 -411
- package/backend/tests/unit/tools/test_manage_settings_tool.py +0 -611
- package/backend/tests/unit/tools/test_read_tool.py +0 -33
- package/backend/tests/unit/tools/test_set_permissions_tool.py +0 -595
- package/backend/tests/unit/tools/test_todo_tool.py +0 -37
- package/backend/tests/unit/tools/test_tool_registry.py +0 -194
- package/dist/frontend/assets/AssistantPage-VBohhz4d.js +0 -1
- package/dist/frontend/assets/ChannelsPage-CIydPZA_.js +0 -1
- package/dist/frontend/assets/McpPage-CHPm2TPY.js +0 -7
- package/dist/frontend/assets/PageScaffold-DteOA8V7.js +0 -1
- package/dist/frontend/assets/PromptsPage-CSmJ3sZg.js +0 -1
- package/dist/frontend/assets/ProvidersPage-sl2jeG4e.js +0 -3
- package/dist/frontend/assets/RolesPage-DCe7W6Km.js +0 -1
- package/dist/frontend/assets/SettingsPage-Bix9e63E.js +0 -3
- package/dist/frontend/assets/ToolsPage-favNkj5C.js +0 -1
- package/dist/frontend/assets/WorkspaceCommandDialog-DRS6wiD6.js +0 -1
- package/dist/frontend/assets/WorkspacePage-KuaDjt_D.js +0 -3
- package/dist/frontend/assets/WorkspacePanels-BZxBw8M5.js +0 -1
- package/dist/frontend/assets/alert-dialog-DIBUCmqM.js +0 -1
- package/dist/frontend/assets/datetime-eJqd0V2S.js +0 -1
- package/dist/frontend/assets/dialog-BOvHIBrg.js +0 -1
- package/dist/frontend/assets/elk-worker.min-C9JGDOE-.js +0 -6312
- package/dist/frontend/assets/graph-vendor-CHpVij2M.css +0 -1
- package/dist/frontend/assets/graph-vendor-DRq_-6fV.js +0 -7
- package/dist/frontend/assets/index-Biio-CoI.js +0 -10
- package/dist/frontend/assets/index-CmQvO7sl.css +0 -1
- package/dist/frontend/assets/layout.worker-jMHqAFbP.js +0 -24
- package/dist/frontend/assets/markdown-vendor-C9RtvaJh.js +0 -29
- package/dist/frontend/assets/modelParams-DcEhGnu0.js +0 -1
- package/dist/frontend/assets/react-vendor-mEs_JJxa.js +0 -9
- package/dist/frontend/assets/roles-BbIEIMeG.js +0 -1
- package/dist/frontend/assets/rolldown-runtime-BYbx6iT9.js +0 -1
- package/dist/frontend/assets/select-D9SwnlXF.js +0 -1
- package/dist/frontend/assets/surface-Bzr1FRG4.js +0 -1
- package/dist/frontend/assets/triState-DgLlKdRR.js +0 -1
- package/dist/frontend/assets/ui-vendor-UazN8rcv.js +0 -51
- package/dist/frontend/favicon.svg +0 -4
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import json
|
|
4
|
-
import os
|
|
5
|
-
from collections.abc import Callable
|
|
6
|
-
from pathlib import Path
|
|
7
|
-
from typing import TYPE_CHECKING, Any, ClassVar
|
|
8
|
-
|
|
9
|
-
from loguru import logger
|
|
10
|
-
|
|
11
|
-
from flowent.tools import Tool, re_raise_interrupt
|
|
12
|
-
|
|
13
|
-
if TYPE_CHECKING:
|
|
14
|
-
from flowent.agent import Agent
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def _append_stream_chunk(
|
|
18
|
-
buffer: list[str],
|
|
19
|
-
size: int,
|
|
20
|
-
text: str,
|
|
21
|
-
on_output: Callable[[str], None] | None,
|
|
22
|
-
) -> int:
|
|
23
|
-
if on_output is None or not text:
|
|
24
|
-
return size
|
|
25
|
-
buffer.append(text)
|
|
26
|
-
size += len(text)
|
|
27
|
-
if size >= 2048:
|
|
28
|
-
on_output("".join(buffer))
|
|
29
|
-
buffer.clear()
|
|
30
|
-
return 0
|
|
31
|
-
return size
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
def _flush_stream_chunk(
|
|
35
|
-
buffer: list[str], on_output: Callable[[str], None] | None
|
|
36
|
-
) -> None:
|
|
37
|
-
if on_output is None or not buffer:
|
|
38
|
-
return
|
|
39
|
-
on_output("".join(buffer))
|
|
40
|
-
buffer.clear()
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
class ReadTool(Tool):
|
|
44
|
-
name = "read"
|
|
45
|
-
description = (
|
|
46
|
-
"Read a file with line numbers, or list a directory. "
|
|
47
|
-
"Use start_line and end_line to read a specific range (1-indexed, inclusive). "
|
|
48
|
-
"Line numbers in the output are used as input to the edit tool."
|
|
49
|
-
)
|
|
50
|
-
parameters: ClassVar[dict[str, Any]] = {
|
|
51
|
-
"type": "object",
|
|
52
|
-
"properties": {
|
|
53
|
-
"path": {
|
|
54
|
-
"type": "string",
|
|
55
|
-
"description": "Absolute path to the file or directory to read",
|
|
56
|
-
},
|
|
57
|
-
"start_line": {
|
|
58
|
-
"type": "integer",
|
|
59
|
-
"description": "First line to read (1-indexed, inclusive). Defaults to 1.",
|
|
60
|
-
},
|
|
61
|
-
"end_line": {
|
|
62
|
-
"type": "integer",
|
|
63
|
-
"description": "Last line to read (1-indexed, inclusive). Defaults to end of file.",
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
"required": ["path"],
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
def execute(self, agent: Agent, args: dict[str, Any], **kwargs: Any) -> str:
|
|
70
|
-
path_str = args["path"]
|
|
71
|
-
real_path = Path(path_str)
|
|
72
|
-
on_output: Callable[[str], None] | None = kwargs.get("on_output")
|
|
73
|
-
|
|
74
|
-
if real_path.is_dir():
|
|
75
|
-
try:
|
|
76
|
-
entries = []
|
|
77
|
-
stream_buffer: list[str] = []
|
|
78
|
-
stream_size = 0
|
|
79
|
-
for entry in sorted(os.listdir(real_path)):
|
|
80
|
-
full = real_path / entry
|
|
81
|
-
kind = "dir" if full.is_dir() else "file"
|
|
82
|
-
size = full.stat().st_size if kind == "file" else None
|
|
83
|
-
entries.append({"name": entry, "type": kind, "size": size})
|
|
84
|
-
label = f"{kind}\t{entry}"
|
|
85
|
-
if size is not None:
|
|
86
|
-
label = f"{label}\t{size}"
|
|
87
|
-
stream_size = _append_stream_chunk(
|
|
88
|
-
stream_buffer,
|
|
89
|
-
stream_size,
|
|
90
|
-
f"{label}\n",
|
|
91
|
-
on_output,
|
|
92
|
-
)
|
|
93
|
-
_flush_stream_chunk(stream_buffer, on_output)
|
|
94
|
-
logger.debug(
|
|
95
|
-
"Listed directory: {} ({} entries)", path_str, len(entries)
|
|
96
|
-
)
|
|
97
|
-
return json.dumps({"path": path_str, "entries": entries})
|
|
98
|
-
except Exception as e:
|
|
99
|
-
re_raise_interrupt(agent, e)
|
|
100
|
-
return json.dumps({"error": str(e)})
|
|
101
|
-
|
|
102
|
-
if real_path.is_file():
|
|
103
|
-
try:
|
|
104
|
-
with open(real_path, encoding="utf-8") as f:
|
|
105
|
-
total_lines = sum(1 for _ in f)
|
|
106
|
-
|
|
107
|
-
start = max(1, int(args.get("start_line", 1)))
|
|
108
|
-
end = min(total_lines, int(args.get("end_line", total_lines)))
|
|
109
|
-
width = max(6, len(str(total_lines)))
|
|
110
|
-
selected_parts: list[str] = []
|
|
111
|
-
stream_buffer = []
|
|
112
|
-
stream_size = 0
|
|
113
|
-
|
|
114
|
-
with open(real_path, encoding="utf-8") as f:
|
|
115
|
-
for line_number, line in enumerate(f, start=1):
|
|
116
|
-
if line_number < start:
|
|
117
|
-
continue
|
|
118
|
-
if line_number > end:
|
|
119
|
-
break
|
|
120
|
-
numbered_line = f"{line_number:{width}d}\t{line}"
|
|
121
|
-
selected_parts.append(numbered_line)
|
|
122
|
-
stream_size = _append_stream_chunk(
|
|
123
|
-
stream_buffer,
|
|
124
|
-
stream_size,
|
|
125
|
-
numbered_line,
|
|
126
|
-
on_output,
|
|
127
|
-
)
|
|
128
|
-
|
|
129
|
-
_flush_stream_chunk(stream_buffer, on_output)
|
|
130
|
-
numbered = "".join(selected_parts)
|
|
131
|
-
|
|
132
|
-
logger.debug(
|
|
133
|
-
"Read file: {} (lines {}-{} of {})",
|
|
134
|
-
path_str,
|
|
135
|
-
start,
|
|
136
|
-
end,
|
|
137
|
-
total_lines,
|
|
138
|
-
)
|
|
139
|
-
return json.dumps(
|
|
140
|
-
{
|
|
141
|
-
"path": path_str,
|
|
142
|
-
"total_lines": total_lines,
|
|
143
|
-
"start_line": start,
|
|
144
|
-
"end_line": end,
|
|
145
|
-
"content": numbered,
|
|
146
|
-
}
|
|
147
|
-
)
|
|
148
|
-
except Exception as e:
|
|
149
|
-
re_raise_interrupt(agent, e)
|
|
150
|
-
return json.dumps({"error": str(e)})
|
|
151
|
-
|
|
152
|
-
return json.dumps({"error": f"Not found: {path_str}"})
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from typing import TYPE_CHECKING, Any, ClassVar
|
|
4
|
-
|
|
5
|
-
from flowent.tools import Tool
|
|
6
|
-
|
|
7
|
-
if TYPE_CHECKING:
|
|
8
|
-
from flowent.agent import Agent
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class SendTool(Tool):
|
|
12
|
-
name = "send"
|
|
13
|
-
description = "Send to one current contact or output-port path."
|
|
14
|
-
parameters: ClassVar[dict[str, Any]] = {
|
|
15
|
-
"type": "object",
|
|
16
|
-
"properties": {
|
|
17
|
-
"target": {
|
|
18
|
-
"type": "string",
|
|
19
|
-
"description": "One target id, name, or unique short id from contacts.",
|
|
20
|
-
},
|
|
21
|
-
"from_output_port_key": {
|
|
22
|
-
"type": "string",
|
|
23
|
-
"description": "Source output port key for workflow path sends.",
|
|
24
|
-
},
|
|
25
|
-
"to_input_port_key": {
|
|
26
|
-
"type": "string",
|
|
27
|
-
"description": "Target input port key for workflow path sends.",
|
|
28
|
-
},
|
|
29
|
-
"value": {
|
|
30
|
-
"description": "Typed value for workflow path sends. Use ordered parts for parts ports, a string for string ports, or an object for json ports.",
|
|
31
|
-
},
|
|
32
|
-
"parts": {
|
|
33
|
-
"type": "array",
|
|
34
|
-
"description": "Ordered message parts for Assistant and Leader entry contacts.",
|
|
35
|
-
"items": {
|
|
36
|
-
"type": "object",
|
|
37
|
-
"properties": {
|
|
38
|
-
"type": {"type": "string", "enum": ["text", "image"]},
|
|
39
|
-
"text": {"type": "string"},
|
|
40
|
-
"asset_id": {"type": "string"},
|
|
41
|
-
"mime_type": {"type": "string"},
|
|
42
|
-
"width": {"type": "integer"},
|
|
43
|
-
"height": {"type": "integer"},
|
|
44
|
-
"alt": {"type": "string"},
|
|
45
|
-
},
|
|
46
|
-
"required": ["type"],
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
"required": ["target"],
|
|
51
|
-
"additionalProperties": False,
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
def execute(self, agent: Agent, args: dict[str, Any], **_kwargs: Any) -> str:
|
|
55
|
-
target = args.get("target")
|
|
56
|
-
if not isinstance(target, str) or not target.strip():
|
|
57
|
-
raise ValueError("send.target must be a non-empty string")
|
|
58
|
-
if not agent._is_entry_level_sender():
|
|
59
|
-
return agent.send_port_value(
|
|
60
|
-
target_ref=target.strip(),
|
|
61
|
-
from_output_port_key=args.get("from_output_port_key"),
|
|
62
|
-
to_input_port_key=args.get("to_input_port_key"),
|
|
63
|
-
raw_value=args.get("value", args.get("parts")),
|
|
64
|
-
)
|
|
65
|
-
return agent.send_message(
|
|
66
|
-
target_ref=target.strip(),
|
|
67
|
-
raw_parts=args.get("parts"),
|
|
68
|
-
)
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import json
|
|
4
|
-
from typing import TYPE_CHECKING, Any, ClassVar
|
|
5
|
-
|
|
6
|
-
from flowent.models import NodeType
|
|
7
|
-
from flowent.tools import Tool
|
|
8
|
-
|
|
9
|
-
if TYPE_CHECKING:
|
|
10
|
-
from flowent.agent import Agent
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class SetPermissionsTool(Tool):
|
|
14
|
-
name = "set_permissions"
|
|
15
|
-
description = (
|
|
16
|
-
"Update a workflow's permission boundary by patching its allow_network "
|
|
17
|
-
"and write_dirs."
|
|
18
|
-
)
|
|
19
|
-
parameters: ClassVar[dict[str, Any]] = {
|
|
20
|
-
"type": "object",
|
|
21
|
-
"properties": {
|
|
22
|
-
"workflow_id": {
|
|
23
|
-
"type": "string",
|
|
24
|
-
"description": "ID of the workflow whose permission boundary should be updated",
|
|
25
|
-
},
|
|
26
|
-
"allow_network": {
|
|
27
|
-
"type": "boolean",
|
|
28
|
-
"description": "Optional patched network permission for the workflow boundary",
|
|
29
|
-
},
|
|
30
|
-
"write_dirs": {
|
|
31
|
-
"type": "array",
|
|
32
|
-
"items": {"type": "string"},
|
|
33
|
-
"description": "Optional patched writable directory boundary for the workflow",
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
"required": ["workflow_id"],
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
def execute(self, agent: Agent, args: dict[str, Any], **_kwargs: Any) -> str:
|
|
40
|
-
from flowent.graph_service import (
|
|
41
|
-
resolve_effective_permissions_for_agent,
|
|
42
|
-
set_tab_permissions,
|
|
43
|
-
)
|
|
44
|
-
from flowent.settings import (
|
|
45
|
-
build_assistant_allow_network,
|
|
46
|
-
build_assistant_write_dirs,
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
workflow_id = args.get("workflow_id")
|
|
50
|
-
raw_allow_network = args.get("allow_network")
|
|
51
|
-
raw_write_dirs = args.get("write_dirs")
|
|
52
|
-
|
|
53
|
-
if not isinstance(workflow_id, str) or not workflow_id.strip():
|
|
54
|
-
return json.dumps({"error": "workflow_id must be a non-empty string"})
|
|
55
|
-
normalized_workflow_id = workflow_id.strip()
|
|
56
|
-
if (
|
|
57
|
-
agent.node_type != NodeType.ASSISTANT
|
|
58
|
-
and agent.config.tab_id != normalized_workflow_id
|
|
59
|
-
):
|
|
60
|
-
return json.dumps(
|
|
61
|
-
{"error": "Workflow permissions can only be changed for this workflow"}
|
|
62
|
-
)
|
|
63
|
-
|
|
64
|
-
allow_network: bool | None = None
|
|
65
|
-
if "allow_network" in args:
|
|
66
|
-
try:
|
|
67
|
-
allow_network = build_assistant_allow_network(
|
|
68
|
-
raw_allow_network,
|
|
69
|
-
field_name="allow_network",
|
|
70
|
-
)
|
|
71
|
-
except ValueError as exc:
|
|
72
|
-
return json.dumps({"error": str(exc)})
|
|
73
|
-
|
|
74
|
-
write_dirs: list[str] | None = None
|
|
75
|
-
if "write_dirs" in args:
|
|
76
|
-
try:
|
|
77
|
-
write_dirs = build_assistant_write_dirs(
|
|
78
|
-
raw_write_dirs,
|
|
79
|
-
field_name="write_dirs",
|
|
80
|
-
)
|
|
81
|
-
except ValueError as exc:
|
|
82
|
-
return json.dumps({"error": str(exc)})
|
|
83
|
-
|
|
84
|
-
caller_allow_network, caller_write_dirs = (
|
|
85
|
-
resolve_effective_permissions_for_agent(agent)
|
|
86
|
-
)
|
|
87
|
-
result, error = set_tab_permissions(
|
|
88
|
-
tab_id=normalized_workflow_id,
|
|
89
|
-
allow_network=allow_network,
|
|
90
|
-
write_dirs=write_dirs,
|
|
91
|
-
caller_allow_network=caller_allow_network,
|
|
92
|
-
caller_write_dirs=caller_write_dirs,
|
|
93
|
-
actor_id=agent.uuid,
|
|
94
|
-
)
|
|
95
|
-
if error is not None or result is None:
|
|
96
|
-
return json.dumps(
|
|
97
|
-
{"error": error or "Failed to update workflow permissions"}
|
|
98
|
-
)
|
|
99
|
-
return json.dumps(result)
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import json
|
|
4
|
-
from math import isfinite
|
|
5
|
-
from typing import TYPE_CHECKING, Any, ClassVar
|
|
6
|
-
|
|
7
|
-
from flowent.tools import Tool
|
|
8
|
-
|
|
9
|
-
if TYPE_CHECKING:
|
|
10
|
-
from flowent.agent import Agent
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class SleepTool(Tool):
|
|
14
|
-
name = "sleep"
|
|
15
|
-
description = (
|
|
16
|
-
"Enter a timed wait that resumes on whichever happens first: a new input "
|
|
17
|
-
"arrives or the requested duration elapses. Use this when you want to wait "
|
|
18
|
-
"until a deadline without missing messages."
|
|
19
|
-
)
|
|
20
|
-
parameters: ClassVar[dict[str, Any]] = {
|
|
21
|
-
"type": "object",
|
|
22
|
-
"properties": {
|
|
23
|
-
"seconds": {
|
|
24
|
-
"type": "number",
|
|
25
|
-
"description": "How many seconds to wait before resuming execution. Supports fractional seconds.",
|
|
26
|
-
"minimum": 0,
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
"required": ["seconds"],
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
def execute(self, agent: Agent, args: dict[str, Any], **_kwargs: Any) -> str:
|
|
33
|
-
seconds = args.get("seconds")
|
|
34
|
-
if isinstance(seconds, bool) or not isinstance(seconds, int | float):
|
|
35
|
-
return json.dumps({"error": "seconds must be a non-negative number"})
|
|
36
|
-
|
|
37
|
-
duration = float(seconds)
|
|
38
|
-
if not isfinite(duration) or duration < 0:
|
|
39
|
-
return json.dumps({"error": "seconds must be a non-negative number"})
|
|
40
|
-
|
|
41
|
-
return agent.request_sleep(seconds=duration)
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import json
|
|
4
|
-
from typing import TYPE_CHECKING, Any, ClassVar
|
|
5
|
-
|
|
6
|
-
from flowent.events import event_bus
|
|
7
|
-
from flowent.models import Event, EventType, TodoItem
|
|
8
|
-
from flowent.tools import Tool
|
|
9
|
-
|
|
10
|
-
if TYPE_CHECKING:
|
|
11
|
-
from flowent.agent import Agent
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class TodoTool(Tool):
|
|
15
|
-
name = "todo"
|
|
16
|
-
description = "Replace the full todo list with a new ordered list of task strings."
|
|
17
|
-
parameters: ClassVar[dict[str, Any]] = {
|
|
18
|
-
"type": "object",
|
|
19
|
-
"properties": {
|
|
20
|
-
"todos": {
|
|
21
|
-
"type": "array",
|
|
22
|
-
"items": {"type": "string"},
|
|
23
|
-
"description": "Complete replacement todo list. Pass an empty array to clear all todos.",
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
"required": ["todos"],
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
def execute(self, agent: Agent, args: dict[str, Any], **_kwargs: Any) -> str:
|
|
30
|
-
raw_todos = args["todos"]
|
|
31
|
-
if not isinstance(raw_todos, list) or not all(
|
|
32
|
-
isinstance(item, str) for item in raw_todos
|
|
33
|
-
):
|
|
34
|
-
return json.dumps({"error": "todos must be an array of strings"})
|
|
35
|
-
|
|
36
|
-
next_todos = [TodoItem(text=item) for item in raw_todos]
|
|
37
|
-
agent.set_todos(next_todos)
|
|
38
|
-
self._emit_todo_event(agent)
|
|
39
|
-
return json.dumps({"status": "updated"})
|
|
40
|
-
|
|
41
|
-
@staticmethod
|
|
42
|
-
def _emit_todo_event(agent: Agent) -> None:
|
|
43
|
-
event_bus.emit(
|
|
44
|
-
Event(
|
|
45
|
-
type=EventType.NODE_TODOS_CHANGED,
|
|
46
|
-
agent_id=agent.uuid,
|
|
47
|
-
data={
|
|
48
|
-
"todos": [t.serialize() for t in agent.get_todos_snapshot()],
|
|
49
|
-
},
|
|
50
|
-
),
|
|
51
|
-
)
|