flowent 0.0.7 → 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 +0 -3
- package/backend/README.md +0 -3
- 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 +213 -3173
- 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__/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 -2401
- package/backend/src/flowent/image_assets.py +0 -356
- 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 -270
- package/backend/src/flowent/routes/__init__.py +0 -26
- 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__/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 -158
- package/backend/src/flowent/routes/image_assets.py +0 -33
- package/backend/src/flowent/routes/meta.py +0 -28
- package/backend/src/flowent/routes/nodes.py +0 -423
- 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 -379
- package/backend/src/flowent/routes/tabs.py +0 -298
- package/backend/src/flowent/routes/ws.py +0 -33
- package/backend/src/flowent/runtime.py +0 -160
- package/backend/src/flowent/security.py +0 -37
- package/backend/src/flowent/settings.py +0 -2112
- package/backend/src/flowent/settings_management.py +0 -394
- package/backend/src/flowent/state_db.py +0 -108
- package/backend/src/flowent/static/assets/AssistantPage-BW7XAd9I.js +0 -1
- package/backend/src/flowent/static/assets/ChannelsPage-tCJHgt6m.js +0 -1
- package/backend/src/flowent/static/assets/PageScaffold-f6g2l7XN.js +0 -1
- package/backend/src/flowent/static/assets/PromptsPage-C3Sxn2D7.js +0 -1
- package/backend/src/flowent/static/assets/ProvidersPage-BfmdXmNt.js +0 -3
- package/backend/src/flowent/static/assets/RolesPage-DET8wO4r.js +0 -1
- package/backend/src/flowent/static/assets/SettingsPage-D-g3deMm.js +0 -3
- package/backend/src/flowent/static/assets/ToolsPage-CDmtE2g4.js +0 -1
- package/backend/src/flowent/static/assets/WorkspacePage-AZsJ0sD0.js +0 -3
- package/backend/src/flowent/static/assets/WorkspacePanels-CteCjolX.js +0 -1
- package/backend/src/flowent/static/assets/alert-dialog-Duorp_S-.js +0 -1
- package/backend/src/flowent/static/assets/dialog-C3ixjGjN.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--o_0fv0N.css +0 -1
- package/backend/src/flowent/static/assets/index-C9HuekJm.js +0 -10
- 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-DmnF2hwR.js +0 -1
- package/backend/src/flowent/static/assets/providerTypes-DT3Ahwl_.js +0 -1
- package/backend/src/flowent/static/assets/react-vendor-mEs_JJxa.js +0 -9
- package/backend/src/flowent/static/assets/roles-CuRT_chR.js +0 -1
- package/backend/src/flowent/static/assets/rolldown-runtime-BYbx6iT9.js +0 -1
- package/backend/src/flowent/static/assets/select-DCfeNu-F.js +0 -1
- package/backend/src/flowent/static/assets/surface-pWwG5ogx.js +0 -1
- package/backend/src/flowent/static/assets/ui-vendor-C5pJa8N7.js +0 -51
- package/backend/src/flowent/static/assets/useAppRoute-FgSHBKhV.js +0 -1
- package/backend/src/flowent/static/favicon.svg +0 -4
- package/backend/src/flowent/tools/__init__.py +0 -176
- 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__/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 -68
- 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 -326
- 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_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 -422
- package/backend/tests/integration/api/test_frontend_mounting.py +0 -61
- package/backend/tests/integration/api/test_meta_api.py +0 -32
- package/backend/tests/integration/api/test_nodes_api.py +0 -787
- 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 -688
- 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 -822
- package/backend/tests/unit/agent/test_agent_runtime.py +0 -3088
- 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 -82
- package/backend/tests/unit/routes/test_providers_route.py +0 -370
- package/backend/tests/unit/routes/test_roles_routes.py +0 -539
- package/backend/tests/unit/routes/test_settings_routes.py +0 -1123
- 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 -703
- package/backend/tests/unit/test_access.py +0 -45
- package/backend/tests/unit/test_cli.py +0 -102
- 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 -87
- package/backend/tests/unit/test_workspace_store.py +0 -228
- 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 -404
- 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 -92
- 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 -199
- package/dist/frontend/assets/AssistantPage-BW7XAd9I.js +0 -1
- package/dist/frontend/assets/ChannelsPage-tCJHgt6m.js +0 -1
- package/dist/frontend/assets/PageScaffold-f6g2l7XN.js +0 -1
- package/dist/frontend/assets/PromptsPage-C3Sxn2D7.js +0 -1
- package/dist/frontend/assets/ProvidersPage-BfmdXmNt.js +0 -3
- package/dist/frontend/assets/RolesPage-DET8wO4r.js +0 -1
- package/dist/frontend/assets/SettingsPage-D-g3deMm.js +0 -3
- package/dist/frontend/assets/ToolsPage-CDmtE2g4.js +0 -1
- package/dist/frontend/assets/WorkspacePage-AZsJ0sD0.js +0 -3
- package/dist/frontend/assets/WorkspacePanels-CteCjolX.js +0 -1
- package/dist/frontend/assets/alert-dialog-Duorp_S-.js +0 -1
- package/dist/frontend/assets/dialog-C3ixjGjN.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--o_0fv0N.css +0 -1
- package/dist/frontend/assets/index-C9HuekJm.js +0 -10
- 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-DmnF2hwR.js +0 -1
- package/dist/frontend/assets/providerTypes-DT3Ahwl_.js +0 -1
- package/dist/frontend/assets/react-vendor-mEs_JJxa.js +0 -9
- package/dist/frontend/assets/roles-CuRT_chR.js +0 -1
- package/dist/frontend/assets/rolldown-runtime-BYbx6iT9.js +0 -1
- package/dist/frontend/assets/select-DCfeNu-F.js +0 -1
- package/dist/frontend/assets/surface-pWwG5ogx.js +0 -1
- package/dist/frontend/assets/ui-vendor-C5pJa8N7.js +0 -51
- package/dist/frontend/assets/useAppRoute-FgSHBKhV.js +0 -1
- package/dist/frontend/favicon.svg +0 -4
|
@@ -1,326 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import json
|
|
4
|
-
from collections.abc import Callable
|
|
5
|
-
from typing import TYPE_CHECKING, Any, ClassVar
|
|
6
|
-
|
|
7
|
-
if TYPE_CHECKING:
|
|
8
|
-
from flowent.agent import Agent
|
|
9
|
-
|
|
10
|
-
from flowent.settings_management import (
|
|
11
|
-
MISSING,
|
|
12
|
-
apply_resolved_settings_update,
|
|
13
|
-
resolve_settings_update,
|
|
14
|
-
serialize_manage_settings,
|
|
15
|
-
)
|
|
16
|
-
from flowent.tools import Tool
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def _error(message: str) -> str:
|
|
20
|
-
return json.dumps({"error": message})
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def _validate_optional_string(value: object, field_name: str) -> str | None:
|
|
24
|
-
if value is not None and not isinstance(value, str):
|
|
25
|
-
return f"{field_name} must be a string"
|
|
26
|
-
return None
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def _validate_manage_settings_args(args: dict[str, Any]) -> str | None:
|
|
30
|
-
from flowent.settings import (
|
|
31
|
-
build_model_auto_compact_token_limit,
|
|
32
|
-
build_model_context_window_tokens,
|
|
33
|
-
build_model_input_image,
|
|
34
|
-
build_model_max_retries,
|
|
35
|
-
build_model_output_image,
|
|
36
|
-
build_model_retry_backoff_cap_retries,
|
|
37
|
-
build_model_retry_initial_delay_seconds,
|
|
38
|
-
build_model_retry_max_delay_seconds,
|
|
39
|
-
build_model_retry_policy,
|
|
40
|
-
build_model_structured_output,
|
|
41
|
-
build_model_timeout_ms,
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
action = args.get("action")
|
|
45
|
-
if not isinstance(action, str):
|
|
46
|
-
return "action must be a string"
|
|
47
|
-
|
|
48
|
-
for field_name in (
|
|
49
|
-
"assistant_role_name",
|
|
50
|
-
"working_dir",
|
|
51
|
-
"leader_role_name",
|
|
52
|
-
"active_provider_id",
|
|
53
|
-
"active_model",
|
|
54
|
-
"timestamp_format",
|
|
55
|
-
):
|
|
56
|
-
error = _validate_optional_string(args.get(field_name), field_name)
|
|
57
|
-
if error is not None:
|
|
58
|
-
return error
|
|
59
|
-
|
|
60
|
-
assistant_allow_network = args.get("assistant_allow_network")
|
|
61
|
-
if assistant_allow_network is not None and not isinstance(
|
|
62
|
-
assistant_allow_network, bool
|
|
63
|
-
):
|
|
64
|
-
return "assistant_allow_network must be a boolean"
|
|
65
|
-
|
|
66
|
-
assistant_write_dirs = args.get("assistant_write_dirs")
|
|
67
|
-
if assistant_write_dirs is not None and not isinstance(assistant_write_dirs, list):
|
|
68
|
-
return "assistant_write_dirs must be an array of strings"
|
|
69
|
-
|
|
70
|
-
builders: tuple[tuple[str, Callable[..., object]], ...] = (
|
|
71
|
-
("retry_policy", build_model_retry_policy),
|
|
72
|
-
("timeout_ms", build_model_timeout_ms),
|
|
73
|
-
("max_retries", build_model_max_retries),
|
|
74
|
-
("retry_initial_delay_seconds", build_model_retry_initial_delay_seconds),
|
|
75
|
-
("retry_max_delay_seconds", build_model_retry_max_delay_seconds),
|
|
76
|
-
("retry_backoff_cap_retries", build_model_retry_backoff_cap_retries),
|
|
77
|
-
)
|
|
78
|
-
for field_name, builder in builders:
|
|
79
|
-
if args.get(field_name) is None:
|
|
80
|
-
continue
|
|
81
|
-
try:
|
|
82
|
-
builder(args.get(field_name), field_name=field_name)
|
|
83
|
-
except ValueError as exc:
|
|
84
|
-
return str(exc)
|
|
85
|
-
|
|
86
|
-
optional_builders: tuple[tuple[str, Callable[..., object]], ...] = (
|
|
87
|
-
("input_image", build_model_input_image),
|
|
88
|
-
("output_image", build_model_output_image),
|
|
89
|
-
("structured_output", build_model_structured_output),
|
|
90
|
-
("context_window_tokens", build_model_context_window_tokens),
|
|
91
|
-
("auto_compact_token_limit", build_model_auto_compact_token_limit),
|
|
92
|
-
)
|
|
93
|
-
for field_name, builder in optional_builders:
|
|
94
|
-
if field_name not in args:
|
|
95
|
-
continue
|
|
96
|
-
try:
|
|
97
|
-
builder(args.get(field_name), field_name=field_name)
|
|
98
|
-
except ValueError as exc:
|
|
99
|
-
return str(exc)
|
|
100
|
-
|
|
101
|
-
model_params = args.get("model_params")
|
|
102
|
-
if model_params is not None and not isinstance(model_params, (dict, type(None))):
|
|
103
|
-
return "model_params must be an object or null"
|
|
104
|
-
|
|
105
|
-
return None
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
def _provided(args: dict[str, Any], field_name: str) -> object:
|
|
109
|
-
return args.get(field_name, MISSING)
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
class ManageSettingsTool(Tool):
|
|
113
|
-
name = "manage_settings"
|
|
114
|
-
description = (
|
|
115
|
-
"Read and update system settings, including the Assistant role, Leader "
|
|
116
|
-
"role, active provider and model, default model params, event log "
|
|
117
|
-
"timestamp format, and other runtime defaults."
|
|
118
|
-
)
|
|
119
|
-
parameters: ClassVar[dict[str, Any]] = {
|
|
120
|
-
"type": "object",
|
|
121
|
-
"properties": {
|
|
122
|
-
"action": {
|
|
123
|
-
"type": "string",
|
|
124
|
-
"enum": ["get", "update"],
|
|
125
|
-
"description": "Settings action",
|
|
126
|
-
},
|
|
127
|
-
"active_provider_id": {
|
|
128
|
-
"type": "string",
|
|
129
|
-
"description": "Active provider ID for update",
|
|
130
|
-
},
|
|
131
|
-
"assistant_role_name": {
|
|
132
|
-
"type": "string",
|
|
133
|
-
"description": "Role name used by the Assistant",
|
|
134
|
-
},
|
|
135
|
-
"assistant_allow_network": {
|
|
136
|
-
"type": "boolean",
|
|
137
|
-
"description": "Whether the Assistant may use networked tools or paths",
|
|
138
|
-
},
|
|
139
|
-
"assistant_write_dirs": {
|
|
140
|
-
"type": "array",
|
|
141
|
-
"description": "Writable directory boundaries for the Assistant",
|
|
142
|
-
"items": {"type": "string"},
|
|
143
|
-
},
|
|
144
|
-
"working_dir": {
|
|
145
|
-
"type": "string",
|
|
146
|
-
"description": "System working directory used as the default cwd and relative path base",
|
|
147
|
-
},
|
|
148
|
-
"leader_role_name": {
|
|
149
|
-
"type": "string",
|
|
150
|
-
"description": "Role name used by workflow Leaders",
|
|
151
|
-
},
|
|
152
|
-
"active_model": {
|
|
153
|
-
"type": "string",
|
|
154
|
-
"description": "Active model name for update",
|
|
155
|
-
},
|
|
156
|
-
"context_window_tokens": {
|
|
157
|
-
"type": ["integer", "null"],
|
|
158
|
-
"description": "Explicit context window override for the active system model",
|
|
159
|
-
},
|
|
160
|
-
"input_image": {
|
|
161
|
-
"type": ["boolean", "null"],
|
|
162
|
-
"description": "Explicit input_image override for the active system model",
|
|
163
|
-
},
|
|
164
|
-
"output_image": {
|
|
165
|
-
"type": ["boolean", "null"],
|
|
166
|
-
"description": "Explicit output_image override for the active system model",
|
|
167
|
-
},
|
|
168
|
-
"structured_output": {
|
|
169
|
-
"type": ["boolean", "null"],
|
|
170
|
-
"description": "Explicit structured_output override for the active system model",
|
|
171
|
-
},
|
|
172
|
-
"max_retries": {
|
|
173
|
-
"type": "integer",
|
|
174
|
-
"description": "Maximum retries for transient LLM call failures when retry_policy is limited",
|
|
175
|
-
},
|
|
176
|
-
"retry_initial_delay_seconds": {
|
|
177
|
-
"type": "number",
|
|
178
|
-
"description": "Initial exponential backoff delay in seconds",
|
|
179
|
-
},
|
|
180
|
-
"retry_max_delay_seconds": {
|
|
181
|
-
"type": "number",
|
|
182
|
-
"description": "Maximum exponential backoff delay in seconds",
|
|
183
|
-
},
|
|
184
|
-
"retry_backoff_cap_retries": {
|
|
185
|
-
"type": "integer",
|
|
186
|
-
"description": "Retry count where exponential growth stops doubling",
|
|
187
|
-
},
|
|
188
|
-
"auto_compact_token_limit": {
|
|
189
|
-
"type": ["integer", "null"],
|
|
190
|
-
"description": "Token-usage threshold where the runtime should auto compact before the next formal LLM call",
|
|
191
|
-
},
|
|
192
|
-
"retry_policy": {
|
|
193
|
-
"type": "string",
|
|
194
|
-
"enum": ["no_retry", "limited", "unlimited"],
|
|
195
|
-
"description": "System-wide retry policy for transient LLM call failures",
|
|
196
|
-
},
|
|
197
|
-
"timeout_ms": {
|
|
198
|
-
"type": "integer",
|
|
199
|
-
"description": "Single LLM request timeout in milliseconds",
|
|
200
|
-
},
|
|
201
|
-
"model_params": {
|
|
202
|
-
"type": ["object", "null"],
|
|
203
|
-
"description": "Default canonical model parameter overrides",
|
|
204
|
-
"properties": {
|
|
205
|
-
"reasoning_effort": {
|
|
206
|
-
"type": "string",
|
|
207
|
-
"enum": ["none", "low", "medium", "high", "xhigh"],
|
|
208
|
-
},
|
|
209
|
-
"verbosity": {
|
|
210
|
-
"type": "string",
|
|
211
|
-
"enum": ["low", "medium", "high"],
|
|
212
|
-
},
|
|
213
|
-
"max_output_tokens": {"type": "integer"},
|
|
214
|
-
"temperature": {"type": "number"},
|
|
215
|
-
"top_p": {"type": "number"},
|
|
216
|
-
},
|
|
217
|
-
"additionalProperties": False,
|
|
218
|
-
},
|
|
219
|
-
"timestamp_format": {
|
|
220
|
-
"type": "string",
|
|
221
|
-
"description": "Event log timestamp format for update",
|
|
222
|
-
},
|
|
223
|
-
},
|
|
224
|
-
"required": ["action"],
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
def execute(self, agent: Agent, args: dict[str, Any], **_kwargs: Any) -> str:
|
|
228
|
-
from flowent.graph_service import sync_assistant_role, sync_tab_leaders
|
|
229
|
-
from flowent.providers.gateway import gateway
|
|
230
|
-
from flowent.settings import get_settings, save_settings
|
|
231
|
-
|
|
232
|
-
action = args.get("action")
|
|
233
|
-
validation_error = _validate_manage_settings_args(args)
|
|
234
|
-
if validation_error is not None:
|
|
235
|
-
return _error(validation_error)
|
|
236
|
-
|
|
237
|
-
settings = get_settings()
|
|
238
|
-
|
|
239
|
-
if action == "get":
|
|
240
|
-
return json.dumps(serialize_manage_settings(settings))
|
|
241
|
-
|
|
242
|
-
if action != "update":
|
|
243
|
-
return _error(f"Unsupported action: {action}")
|
|
244
|
-
|
|
245
|
-
try:
|
|
246
|
-
resolved = resolve_settings_update(
|
|
247
|
-
settings,
|
|
248
|
-
working_dir=args.get("working_dir"),
|
|
249
|
-
assistant_role_name=args.get("assistant_role_name"),
|
|
250
|
-
assistant_allow_network=(
|
|
251
|
-
args.get("assistant_allow_network")
|
|
252
|
-
if args.get("assistant_allow_network") is not None
|
|
253
|
-
else MISSING
|
|
254
|
-
),
|
|
255
|
-
assistant_write_dirs=(
|
|
256
|
-
args.get("assistant_write_dirs")
|
|
257
|
-
if args.get("assistant_write_dirs") is not None
|
|
258
|
-
else MISSING
|
|
259
|
-
),
|
|
260
|
-
leader_role_name=args.get("leader_role_name"),
|
|
261
|
-
active_provider_id=args.get("active_provider_id"),
|
|
262
|
-
active_model=args.get("active_model"),
|
|
263
|
-
context_window_tokens=_provided(args, "context_window_tokens"),
|
|
264
|
-
input_image=_provided(args, "input_image"),
|
|
265
|
-
output_image=_provided(args, "output_image"),
|
|
266
|
-
structured_output=_provided(args, "structured_output"),
|
|
267
|
-
max_retries=(
|
|
268
|
-
args.get("max_retries")
|
|
269
|
-
if args.get("max_retries") is not None
|
|
270
|
-
else MISSING
|
|
271
|
-
),
|
|
272
|
-
retry_policy=(
|
|
273
|
-
args.get("retry_policy")
|
|
274
|
-
if args.get("retry_policy") is not None
|
|
275
|
-
else MISSING
|
|
276
|
-
),
|
|
277
|
-
timeout_ms=(
|
|
278
|
-
args.get("timeout_ms")
|
|
279
|
-
if args.get("timeout_ms") is not None
|
|
280
|
-
else MISSING
|
|
281
|
-
),
|
|
282
|
-
retry_initial_delay_seconds=(
|
|
283
|
-
args.get("retry_initial_delay_seconds")
|
|
284
|
-
if args.get("retry_initial_delay_seconds") is not None
|
|
285
|
-
else MISSING
|
|
286
|
-
),
|
|
287
|
-
retry_max_delay_seconds=(
|
|
288
|
-
args.get("retry_max_delay_seconds")
|
|
289
|
-
if args.get("retry_max_delay_seconds") is not None
|
|
290
|
-
else MISSING
|
|
291
|
-
),
|
|
292
|
-
retry_backoff_cap_retries=(
|
|
293
|
-
args.get("retry_backoff_cap_retries")
|
|
294
|
-
if args.get("retry_backoff_cap_retries") is not None
|
|
295
|
-
else MISSING
|
|
296
|
-
),
|
|
297
|
-
auto_compact_token_limit=_provided(args, "auto_compact_token_limit"),
|
|
298
|
-
model_params=_provided(args, "model_params"),
|
|
299
|
-
timestamp_format=args.get("timestamp_format"),
|
|
300
|
-
assistant_role_field_name="assistant_role_name",
|
|
301
|
-
assistant_allow_network_field_name="assistant_allow_network",
|
|
302
|
-
assistant_write_dirs_field_name="assistant_write_dirs",
|
|
303
|
-
leader_role_field_name="leader_role_name",
|
|
304
|
-
working_dir_field_name="working_dir",
|
|
305
|
-
retry_policy_field_name="retry_policy",
|
|
306
|
-
timeout_ms_field_name="timeout_ms",
|
|
307
|
-
max_retries_field_name="max_retries",
|
|
308
|
-
retry_initial_delay_seconds_field_name="retry_initial_delay_seconds",
|
|
309
|
-
retry_max_delay_seconds_field_name="retry_max_delay_seconds",
|
|
310
|
-
retry_backoff_cap_retries_field_name="retry_backoff_cap_retries",
|
|
311
|
-
input_image_field_name="input_image",
|
|
312
|
-
output_image_field_name="output_image",
|
|
313
|
-
structured_output_field_name="structured_output",
|
|
314
|
-
context_window_tokens_field_name="context_window_tokens",
|
|
315
|
-
auto_compact_token_limit_field_name="auto_compact_token_limit",
|
|
316
|
-
)
|
|
317
|
-
except ValueError as exc:
|
|
318
|
-
return _error(str(exc))
|
|
319
|
-
|
|
320
|
-
apply_resolved_settings_update(settings, resolved)
|
|
321
|
-
|
|
322
|
-
save_settings(settings)
|
|
323
|
-
sync_assistant_role(reason="assistant settings updated")
|
|
324
|
-
sync_tab_leaders(reason="leader settings updated")
|
|
325
|
-
gateway.invalidate_cache()
|
|
326
|
-
return json.dumps(serialize_manage_settings(settings))
|
|
@@ -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)
|