flowent 0.0.7 → 0.0.11
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/__init__.py +6 -2
- 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__/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 +376 -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 +477 -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__/cli.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,570 +0,0 @@
|
|
|
1
|
-
from flowent.models import NodeConfig, NodeType
|
|
2
|
-
from flowent.prompts import get_system_prompt
|
|
3
|
-
from flowent.prompts.common import (
|
|
4
|
-
ASSISTANT_ONLY_PROMPT,
|
|
5
|
-
COMMUNICATION_USAGE_GUIDANCE,
|
|
6
|
-
CONNECT_TOOL_GUIDANCE,
|
|
7
|
-
CREATE_AGENT_TOOL_GUIDANCE,
|
|
8
|
-
CREATE_WORKFLOW_TOOL_GUIDANCE,
|
|
9
|
-
DEFAULT_AGENT_ROLE_PROMPT,
|
|
10
|
-
DELEGATION_GENERAL_GUIDANCE,
|
|
11
|
-
DELETE_WORKFLOW_TOOL_GUIDANCE,
|
|
12
|
-
FILE_PATH_GUIDANCE,
|
|
13
|
-
IDLE_TOOL_GUIDANCE,
|
|
14
|
-
LIST_ROLES_TOOL_GUIDANCE,
|
|
15
|
-
LIST_TOOLS_TOOL_GUIDANCE,
|
|
16
|
-
LIST_WORKFLOWS_TOOL_GUIDANCE,
|
|
17
|
-
MANAGE_TOOLS_GUIDANCE,
|
|
18
|
-
SEND_TOOL_GUIDANCE,
|
|
19
|
-
SET_PERMISSIONS_TOOL_GUIDANCE,
|
|
20
|
-
SLEEP_TOOL_GUIDANCE,
|
|
21
|
-
compose_system_prompt,
|
|
22
|
-
)
|
|
23
|
-
from flowent.prompts.steward import STEWARD_ROLE_SYSTEM_PROMPT
|
|
24
|
-
from flowent.settings import (
|
|
25
|
-
CONDUCTOR_ROLE_INCLUDED_TOOLS,
|
|
26
|
-
CONDUCTOR_ROLE_SYSTEM_PROMPT,
|
|
27
|
-
DESIGNER_ROLE_INCLUDED_TOOLS,
|
|
28
|
-
DESIGNER_ROLE_SYSTEM_PROMPT,
|
|
29
|
-
STEWARD_ROLE_INCLUDED_TOOLS,
|
|
30
|
-
STEWARD_ROLE_NAME,
|
|
31
|
-
WORKER_ROLE_INCLUDED_TOOLS,
|
|
32
|
-
WORKER_ROLE_SYSTEM_PROMPT,
|
|
33
|
-
RoleConfig,
|
|
34
|
-
Settings,
|
|
35
|
-
build_conductor_role,
|
|
36
|
-
build_designer_role,
|
|
37
|
-
)
|
|
38
|
-
from flowent.tools import MINIMUM_TOOLS
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
def _join(*parts: str) -> str:
|
|
42
|
-
return "\n\n".join(part.strip() for part in parts if part.strip())
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
def _with_minimum_tools(*tools: str) -> list[str]:
|
|
46
|
-
return list(dict.fromkeys([*tools, *MINIMUM_TOOLS]))
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
def test_compose_system_prompt_inserts_custom_prompt_between_tool_guidance_and_role():
|
|
50
|
-
result = compose_system_prompt(
|
|
51
|
-
"Role-specific instructions.",
|
|
52
|
-
custom_prompt="Global custom instructions.",
|
|
53
|
-
tools=["idle", "create_agent"],
|
|
54
|
-
)
|
|
55
|
-
|
|
56
|
-
assert result == _join(
|
|
57
|
-
COMMUNICATION_USAGE_GUIDANCE,
|
|
58
|
-
FILE_PATH_GUIDANCE,
|
|
59
|
-
IDLE_TOOL_GUIDANCE,
|
|
60
|
-
CREATE_AGENT_TOOL_GUIDANCE,
|
|
61
|
-
DELEGATION_GENERAL_GUIDANCE,
|
|
62
|
-
"Global custom instructions.",
|
|
63
|
-
"Role-specific instructions.",
|
|
64
|
-
)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
def test_compose_system_prompt_inserts_assistant_layer_before_custom_prompt():
|
|
68
|
-
result = compose_system_prompt(
|
|
69
|
-
"Role-specific instructions.",
|
|
70
|
-
custom_prompt="Global custom instructions.",
|
|
71
|
-
is_assistant=True,
|
|
72
|
-
tools=["idle"],
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
assert result == _join(
|
|
76
|
-
COMMUNICATION_USAGE_GUIDANCE,
|
|
77
|
-
FILE_PATH_GUIDANCE,
|
|
78
|
-
IDLE_TOOL_GUIDANCE,
|
|
79
|
-
ASSISTANT_ONLY_PROMPT,
|
|
80
|
-
"Global custom instructions.",
|
|
81
|
-
"Role-specific instructions.",
|
|
82
|
-
)
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
def test_compose_system_prompt_ignores_empty_custom_prompt():
|
|
86
|
-
result = compose_system_prompt(
|
|
87
|
-
"Role-specific instructions.",
|
|
88
|
-
custom_prompt=" ",
|
|
89
|
-
tools=["idle"],
|
|
90
|
-
)
|
|
91
|
-
|
|
92
|
-
assert result == _join(
|
|
93
|
-
COMMUNICATION_USAGE_GUIDANCE,
|
|
94
|
-
FILE_PATH_GUIDANCE,
|
|
95
|
-
IDLE_TOOL_GUIDANCE,
|
|
96
|
-
"Role-specific instructions.",
|
|
97
|
-
)
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
def test_compose_system_prompt_injects_create_agent_guidance_when_tool_present():
|
|
101
|
-
result = compose_system_prompt(
|
|
102
|
-
"Role-specific instructions.",
|
|
103
|
-
tools=["create_agent"],
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
assert DELEGATION_GENERAL_GUIDANCE in result
|
|
107
|
-
assert CREATE_AGENT_TOOL_GUIDANCE in result
|
|
108
|
-
assert (
|
|
109
|
-
"If you also have `connect`, wire workflow edges as needed."
|
|
110
|
-
in CREATE_AGENT_TOOL_GUIDANCE
|
|
111
|
-
)
|
|
112
|
-
assert (
|
|
113
|
-
"place the new node as a standalone node, after another node, or between two nodes"
|
|
114
|
-
in CREATE_AGENT_TOOL_GUIDANCE
|
|
115
|
-
)
|
|
116
|
-
assert (
|
|
117
|
-
"It does not take `workflow_id` or any other cross-workflow target parameter."
|
|
118
|
-
in CREATE_AGENT_TOOL_GUIDANCE
|
|
119
|
-
)
|
|
120
|
-
assert (
|
|
121
|
-
"Ordinary task nodes may use `create_agent` only when that tool was explicitly granted to them."
|
|
122
|
-
in CREATE_AGENT_TOOL_GUIDANCE
|
|
123
|
-
)
|
|
124
|
-
assert "dispatch tasks to all of them before calling `idle`" in result
|
|
125
|
-
assert "explicitly dispatch its first task with `send`" in result
|
|
126
|
-
assert "Do not insert unrelated tool calls or Human-facing text" in result
|
|
127
|
-
assert "title case with spaces" in CREATE_AGENT_TOOL_GUIDANCE
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
def test_compose_system_prompt_omits_delegation_guidance_when_create_agent_is_absent():
|
|
131
|
-
result = compose_system_prompt("Role-specific instructions.", tools=["read"])
|
|
132
|
-
|
|
133
|
-
assert DELEGATION_GENERAL_GUIDANCE not in result
|
|
134
|
-
assert CREATE_AGENT_TOOL_GUIDANCE not in result
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
def test_compose_system_prompt_injects_connect_guidance_when_tool_present():
|
|
138
|
-
result = compose_system_prompt(
|
|
139
|
-
"Role-specific instructions.",
|
|
140
|
-
tools=["connect"],
|
|
141
|
-
)
|
|
142
|
-
|
|
143
|
-
assert CONNECT_TOOL_GUIDANCE in result
|
|
144
|
-
assert "directed workflow edge between node ports" in CONNECT_TOOL_GUIDANCE
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
def test_compose_system_prompt_injects_management_guidance_when_manage_tool_present():
|
|
148
|
-
result = compose_system_prompt(
|
|
149
|
-
"Role-specific instructions.",
|
|
150
|
-
tools=["manage_providers"],
|
|
151
|
-
)
|
|
152
|
-
|
|
153
|
-
assert MANAGE_TOOLS_GUIDANCE in result
|
|
154
|
-
assert "`manage_providers`" in result
|
|
155
|
-
assert "`manage_roles`" in result
|
|
156
|
-
assert "`manage_settings`" in result
|
|
157
|
-
assert "`manage_prompts`" in result
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
def test_compose_system_prompt_injects_workflow_graph_guidance_when_tools_present():
|
|
161
|
-
result = compose_system_prompt(
|
|
162
|
-
"Role-specific instructions.",
|
|
163
|
-
tools=["create_workflow", "delete_workflow", "create_agent", "list_workflows"],
|
|
164
|
-
)
|
|
165
|
-
|
|
166
|
-
assert CREATE_WORKFLOW_TOOL_GUIDANCE in result
|
|
167
|
-
assert DELETE_WORKFLOW_TOOL_GUIDANCE in result
|
|
168
|
-
assert CREATE_AGENT_TOOL_GUIDANCE in result
|
|
169
|
-
assert LIST_WORKFLOWS_TOOL_GUIDANCE in result
|
|
170
|
-
assert "create_workflow" in CREATE_WORKFLOW_TOOL_GUIDANCE
|
|
171
|
-
assert "current workflow" in CREATE_AGENT_TOOL_GUIDANCE
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
def test_compose_system_prompt_injects_set_permissions_guidance_when_tool_present():
|
|
175
|
-
result = compose_system_prompt(
|
|
176
|
-
"Role-specific instructions.",
|
|
177
|
-
tools=["set_permissions"],
|
|
178
|
-
)
|
|
179
|
-
|
|
180
|
-
assert SET_PERMISSIONS_TOOL_GUIDANCE in result
|
|
181
|
-
assert "target workflow's own `allow_network` and `write_dirs`" in result
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
def test_common_communication_guidance_requires_explicit_target_routing():
|
|
185
|
-
assert (
|
|
186
|
-
"Use plain content only for your own direct output."
|
|
187
|
-
in COMMUNICATION_USAGE_GUIDANCE
|
|
188
|
-
)
|
|
189
|
-
assert (
|
|
190
|
-
"Use `send` for every formal node-to-node message."
|
|
191
|
-
in COMMUNICATION_USAGE_GUIDANCE
|
|
192
|
-
)
|
|
193
|
-
assert "`send` takes one target at a time." in COMMUNICATION_USAGE_GUIDANCE
|
|
194
|
-
assert (
|
|
195
|
-
"Use `contacts` to discover current contact names and ids before sending."
|
|
196
|
-
in COMMUNICATION_USAGE_GUIDANCE
|
|
197
|
-
)
|
|
198
|
-
assert "use `send` to deliver the result" in COMMUNICATION_USAGE_GUIDANCE
|
|
199
|
-
assert (
|
|
200
|
-
"`@target:` and similar `@name:` text inside normal content are just text."
|
|
201
|
-
in COMMUNICATION_USAGE_GUIDANCE
|
|
202
|
-
)
|
|
203
|
-
assert "automatically delivered to your parent" not in COMMUNICATION_USAGE_GUIDANCE
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
def test_file_path_guidance_requires_relative_paths():
|
|
207
|
-
assert "relative paths" in FILE_PATH_GUIDANCE
|
|
208
|
-
assert "Do not guess absolute paths like /workspace or /home." in FILE_PATH_GUIDANCE
|
|
209
|
-
assert "run `pwd` first" in FILE_PATH_GUIDANCE
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
def test_compose_system_prompt_always_includes_file_path_guidance():
|
|
213
|
-
result = compose_system_prompt("Role-specific instructions.", tools=["read"])
|
|
214
|
-
|
|
215
|
-
assert FILE_PATH_GUIDANCE in result
|
|
216
|
-
assert result.index(COMMUNICATION_USAGE_GUIDANCE) < result.index(FILE_PATH_GUIDANCE)
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
def test_assistant_only_prompt_keeps_frontend_semantics_without_repeating_block_rule():
|
|
220
|
-
assert "frontend chat panel" in ASSISTANT_ONLY_PROMPT
|
|
221
|
-
assert "Plain content is your reply to the Human." in ASSISTANT_ONLY_PROMPT
|
|
222
|
-
assert "use `send`" in ASSISTANT_ONLY_PROMPT
|
|
223
|
-
assert "A single content block is either" not in ASSISTANT_ONLY_PROMPT
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
def test_compose_system_prompt_injects_send_guidance_when_tool_present():
|
|
227
|
-
result = compose_system_prompt(
|
|
228
|
-
"Role-specific instructions.",
|
|
229
|
-
tools=["send"],
|
|
230
|
-
)
|
|
231
|
-
|
|
232
|
-
assert SEND_TOOL_GUIDANCE in result
|
|
233
|
-
assert "formal node-to-node message" in SEND_TOOL_GUIDANCE
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
def test_get_system_prompt_reads_global_custom_prompt(monkeypatch):
|
|
237
|
-
monkeypatch.setattr(
|
|
238
|
-
"flowent.settings.get_settings",
|
|
239
|
-
lambda: Settings(
|
|
240
|
-
custom_prompt="Global custom instructions.",
|
|
241
|
-
custom_post_prompt="Runtime-only reminder.",
|
|
242
|
-
roles=[
|
|
243
|
-
RoleConfig(
|
|
244
|
-
name="Reviewer",
|
|
245
|
-
system_prompt="Review code carefully.",
|
|
246
|
-
)
|
|
247
|
-
],
|
|
248
|
-
),
|
|
249
|
-
)
|
|
250
|
-
|
|
251
|
-
prompt = get_system_prompt(
|
|
252
|
-
NodeConfig(node_type=NodeType.AGENT, role_name="Reviewer", tools=["read"])
|
|
253
|
-
)
|
|
254
|
-
|
|
255
|
-
assert prompt == compose_system_prompt(
|
|
256
|
-
"Review code carefully.",
|
|
257
|
-
custom_prompt="Global custom instructions.",
|
|
258
|
-
tools=_with_minimum_tools("read"),
|
|
259
|
-
)
|
|
260
|
-
assert "Runtime-only reminder." not in prompt
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
def test_get_system_prompt_merges_minimum_tools_for_guidance(monkeypatch):
|
|
264
|
-
monkeypatch.setattr(
|
|
265
|
-
"flowent.settings.get_settings",
|
|
266
|
-
lambda: Settings(
|
|
267
|
-
roles=[
|
|
268
|
-
RoleConfig(
|
|
269
|
-
name="Reviewer",
|
|
270
|
-
system_prompt="Review code carefully.",
|
|
271
|
-
)
|
|
272
|
-
],
|
|
273
|
-
),
|
|
274
|
-
)
|
|
275
|
-
|
|
276
|
-
prompt = get_system_prompt(
|
|
277
|
-
NodeConfig(node_type=NodeType.AGENT, role_name="Reviewer", tools=["read"])
|
|
278
|
-
)
|
|
279
|
-
|
|
280
|
-
assert IDLE_TOOL_GUIDANCE in prompt
|
|
281
|
-
assert SLEEP_TOOL_GUIDANCE in prompt
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
def test_get_system_prompt_reads_assistant_role_prompt_when_custom_prompt_is_empty(
|
|
285
|
-
monkeypatch,
|
|
286
|
-
):
|
|
287
|
-
monkeypatch.setattr(
|
|
288
|
-
"flowent.settings.get_settings",
|
|
289
|
-
lambda: Settings(
|
|
290
|
-
custom_prompt="",
|
|
291
|
-
roles=[
|
|
292
|
-
RoleConfig(
|
|
293
|
-
name=STEWARD_ROLE_NAME,
|
|
294
|
-
system_prompt=STEWARD_ROLE_SYSTEM_PROMPT,
|
|
295
|
-
)
|
|
296
|
-
],
|
|
297
|
-
),
|
|
298
|
-
)
|
|
299
|
-
|
|
300
|
-
prompt = get_system_prompt(
|
|
301
|
-
NodeConfig(
|
|
302
|
-
node_type=NodeType.ASSISTANT,
|
|
303
|
-
role_name=STEWARD_ROLE_NAME,
|
|
304
|
-
tools=list(STEWARD_ROLE_INCLUDED_TOOLS),
|
|
305
|
-
)
|
|
306
|
-
)
|
|
307
|
-
|
|
308
|
-
assert prompt == compose_system_prompt(
|
|
309
|
-
STEWARD_ROLE_SYSTEM_PROMPT,
|
|
310
|
-
custom_prompt="",
|
|
311
|
-
is_assistant=True,
|
|
312
|
-
tools=_with_minimum_tools(*STEWARD_ROLE_INCLUDED_TOOLS),
|
|
313
|
-
)
|
|
314
|
-
assert ASSISTANT_ONLY_PROMPT in prompt
|
|
315
|
-
assert LIST_ROLES_TOOL_GUIDANCE in prompt
|
|
316
|
-
assert LIST_WORKFLOWS_TOOL_GUIDANCE in prompt
|
|
317
|
-
assert LIST_TOOLS_TOOL_GUIDANCE in prompt
|
|
318
|
-
assert MANAGE_TOOLS_GUIDANCE in prompt
|
|
319
|
-
assert CONNECT_TOOL_GUIDANCE not in prompt
|
|
320
|
-
assert "## Tools Available" not in prompt
|
|
321
|
-
assert "create_workflow" in STEWARD_ROLE_SYSTEM_PROMPT
|
|
322
|
-
assert "delete_workflow" in STEWARD_ROLE_SYSTEM_PROMPT
|
|
323
|
-
assert (
|
|
324
|
-
"Creating a workflow also creates its bound Leader"
|
|
325
|
-
in STEWARD_ROLE_SYSTEM_PROMPT
|
|
326
|
-
)
|
|
327
|
-
assert (
|
|
328
|
-
"Do not directly assign execution work to a Worker or other ordinary task node as the default path."
|
|
329
|
-
in STEWARD_ROLE_SYSTEM_PROMPT
|
|
330
|
-
)
|
|
331
|
-
assert (
|
|
332
|
-
"task brief, not a raw copy of the Human's text" in STEWARD_ROLE_SYSTEM_PROMPT
|
|
333
|
-
)
|
|
334
|
-
assert (
|
|
335
|
-
"hand the execution brief to that workflow's Leader"
|
|
336
|
-
in STEWARD_ROLE_SYSTEM_PROMPT
|
|
337
|
-
)
|
|
338
|
-
assert "call `idle` in the same response" in prompt
|
|
339
|
-
assert "Do not repeat or restate a Human-facing reply" in prompt
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
def test_get_system_prompt_keeps_steward_identity_for_non_steward_assistant_role(
|
|
343
|
-
monkeypatch,
|
|
344
|
-
):
|
|
345
|
-
monkeypatch.setattr(
|
|
346
|
-
"flowent.settings.get_settings",
|
|
347
|
-
lambda: Settings(
|
|
348
|
-
roles=[
|
|
349
|
-
RoleConfig(
|
|
350
|
-
name=STEWARD_ROLE_NAME,
|
|
351
|
-
system_prompt=STEWARD_ROLE_SYSTEM_PROMPT,
|
|
352
|
-
),
|
|
353
|
-
RoleConfig(
|
|
354
|
-
name="Worker",
|
|
355
|
-
system_prompt=WORKER_ROLE_SYSTEM_PROMPT,
|
|
356
|
-
),
|
|
357
|
-
],
|
|
358
|
-
),
|
|
359
|
-
)
|
|
360
|
-
|
|
361
|
-
prompt = get_system_prompt(
|
|
362
|
-
NodeConfig(
|
|
363
|
-
node_type=NodeType.ASSISTANT,
|
|
364
|
-
role_name="Worker",
|
|
365
|
-
tools=[*STEWARD_ROLE_INCLUDED_TOOLS, *WORKER_ROLE_INCLUDED_TOOLS],
|
|
366
|
-
)
|
|
367
|
-
)
|
|
368
|
-
|
|
369
|
-
assert ASSISTANT_ONLY_PROMPT in prompt
|
|
370
|
-
assert STEWARD_ROLE_SYSTEM_PROMPT in prompt
|
|
371
|
-
assert "## Selected Role Overlay" in prompt
|
|
372
|
-
assert WORKER_ROLE_SYSTEM_PROMPT in prompt
|
|
373
|
-
assert "Do not follow any selected-role instruction" in prompt
|
|
374
|
-
assert CREATE_WORKFLOW_TOOL_GUIDANCE in prompt
|
|
375
|
-
assert SET_PERMISSIONS_TOOL_GUIDANCE in prompt
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
def test_get_system_prompt_reads_conductor_prompt_via_role_system(monkeypatch):
|
|
379
|
-
monkeypatch.setattr(
|
|
380
|
-
"flowent.settings.get_settings",
|
|
381
|
-
lambda: Settings(
|
|
382
|
-
roles=[build_conductor_role()],
|
|
383
|
-
),
|
|
384
|
-
)
|
|
385
|
-
|
|
386
|
-
prompt = get_system_prompt(
|
|
387
|
-
NodeConfig(
|
|
388
|
-
node_type=NodeType.AGENT,
|
|
389
|
-
role_name="Conductor",
|
|
390
|
-
tools=list(CONDUCTOR_ROLE_INCLUDED_TOOLS),
|
|
391
|
-
)
|
|
392
|
-
)
|
|
393
|
-
|
|
394
|
-
assert prompt == compose_system_prompt(
|
|
395
|
-
CONDUCTOR_ROLE_SYSTEM_PROMPT,
|
|
396
|
-
custom_prompt="",
|
|
397
|
-
tools=_with_minimum_tools(*CONDUCTOR_ROLE_INCLUDED_TOOLS),
|
|
398
|
-
)
|
|
399
|
-
assert ASSISTANT_ONLY_PROMPT not in prompt
|
|
400
|
-
assert CREATE_AGENT_TOOL_GUIDANCE in prompt
|
|
401
|
-
assert LIST_WORKFLOWS_TOOL_GUIDANCE not in prompt
|
|
402
|
-
assert LIST_ROLES_TOOL_GUIDANCE in prompt
|
|
403
|
-
assert LIST_TOOLS_TOOL_GUIDANCE in prompt
|
|
404
|
-
assert "## Tools Available" not in CONDUCTOR_ROLE_SYSTEM_PROMPT
|
|
405
|
-
assert (
|
|
406
|
-
"This role is the default behavior template for a workflow's Leader"
|
|
407
|
-
in CONDUCTOR_ROLE_SYSTEM_PROMPT
|
|
408
|
-
)
|
|
409
|
-
assert (
|
|
410
|
-
"Do not default to creating a single Worker and handing it the entire task."
|
|
411
|
-
in CONDUCTOR_ROLE_SYSTEM_PROMPT
|
|
412
|
-
)
|
|
413
|
-
assert (
|
|
414
|
-
"Regular task-node results should usually come back to you first"
|
|
415
|
-
in CONDUCTOR_ROLE_SYSTEM_PROMPT
|
|
416
|
-
)
|
|
417
|
-
assert (
|
|
418
|
-
"Prefer adding peer nodes to the current workflow with `create_agent`"
|
|
419
|
-
in CONDUCTOR_ROLE_SYSTEM_PROMPT
|
|
420
|
-
)
|
|
421
|
-
assert (
|
|
422
|
-
"**Create the network structure** with `create_agent` and `connect`"
|
|
423
|
-
in CONDUCTOR_ROLE_SYSTEM_PROMPT
|
|
424
|
-
)
|
|
425
|
-
assert "**Dispatch immediately** after creation" in CONDUCTOR_ROLE_SYSTEM_PROMPT
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
def test_get_system_prompt_for_worker_omits_graph_creation_guidance(monkeypatch):
|
|
429
|
-
monkeypatch.setattr(
|
|
430
|
-
"flowent.settings.get_settings",
|
|
431
|
-
lambda: Settings(
|
|
432
|
-
roles=[
|
|
433
|
-
RoleConfig(
|
|
434
|
-
name="Worker",
|
|
435
|
-
system_prompt=WORKER_ROLE_SYSTEM_PROMPT,
|
|
436
|
-
)
|
|
437
|
-
],
|
|
438
|
-
),
|
|
439
|
-
)
|
|
440
|
-
|
|
441
|
-
prompt = get_system_prompt(
|
|
442
|
-
NodeConfig(
|
|
443
|
-
node_type=NodeType.AGENT,
|
|
444
|
-
role_name="Worker",
|
|
445
|
-
tools=["read", "exec"],
|
|
446
|
-
)
|
|
447
|
-
)
|
|
448
|
-
|
|
449
|
-
assert CREATE_AGENT_TOOL_GUIDANCE not in prompt
|
|
450
|
-
assert CONNECT_TOOL_GUIDANCE not in prompt
|
|
451
|
-
assert DELEGATION_GENERAL_GUIDANCE not in prompt
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
def test_get_system_prompt_reads_designer_prompt_via_role_system(monkeypatch):
|
|
455
|
-
monkeypatch.setattr(
|
|
456
|
-
"flowent.settings.get_settings",
|
|
457
|
-
lambda: Settings(
|
|
458
|
-
roles=[build_designer_role()],
|
|
459
|
-
),
|
|
460
|
-
)
|
|
461
|
-
|
|
462
|
-
prompt = get_system_prompt(
|
|
463
|
-
NodeConfig(
|
|
464
|
-
node_type=NodeType.AGENT,
|
|
465
|
-
role_name="Designer",
|
|
466
|
-
tools=list(DESIGNER_ROLE_INCLUDED_TOOLS),
|
|
467
|
-
)
|
|
468
|
-
)
|
|
469
|
-
|
|
470
|
-
assert prompt == compose_system_prompt(
|
|
471
|
-
DESIGNER_ROLE_SYSTEM_PROMPT,
|
|
472
|
-
custom_prompt="",
|
|
473
|
-
tools=_with_minimum_tools(*DESIGNER_ROLE_INCLUDED_TOOLS),
|
|
474
|
-
)
|
|
475
|
-
assert CREATE_AGENT_TOOL_GUIDANCE not in prompt
|
|
476
|
-
assert CONNECT_TOOL_GUIDANCE not in prompt
|
|
477
|
-
assert DELEGATION_GENERAL_GUIDANCE not in prompt
|
|
478
|
-
assert (
|
|
479
|
-
"frontend implementation and visual design node" in DESIGNER_ROLE_SYSTEM_PROMPT
|
|
480
|
-
)
|
|
481
|
-
assert (
|
|
482
|
-
"pages, components, layouts, and interaction details"
|
|
483
|
-
in DESIGNER_ROLE_SYSTEM_PROMPT
|
|
484
|
-
)
|
|
485
|
-
assert (
|
|
486
|
-
"not the default executor for unrelated backend" in DESIGNER_ROLE_SYSTEM_PROMPT
|
|
487
|
-
)
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
def test_worker_default_tools_do_not_include_create_agent():
|
|
491
|
-
assert "create_agent" not in WORKER_ROLE_INCLUDED_TOOLS
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
def test_designer_default_tools_match_frontend_scope():
|
|
495
|
-
assert DESIGNER_ROLE_INCLUDED_TOOLS == ["read", "edit", "exec"]
|
|
496
|
-
assert "create_agent" not in DESIGNER_ROLE_INCLUDED_TOOLS
|
|
497
|
-
assert "set_permissions" not in DESIGNER_ROLE_INCLUDED_TOOLS
|
|
498
|
-
assert "fetch" not in DESIGNER_ROLE_INCLUDED_TOOLS
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
def test_get_system_prompt_falls_back_when_role_is_missing(monkeypatch):
|
|
502
|
-
monkeypatch.setattr(
|
|
503
|
-
"flowent.settings.get_settings",
|
|
504
|
-
lambda: Settings(roles=[]),
|
|
505
|
-
)
|
|
506
|
-
|
|
507
|
-
prompt = get_system_prompt(
|
|
508
|
-
NodeConfig(node_type=NodeType.AGENT, role_name="Ghost", tools=["read"])
|
|
509
|
-
)
|
|
510
|
-
|
|
511
|
-
assert prompt == compose_system_prompt(
|
|
512
|
-
DEFAULT_AGENT_ROLE_PROMPT,
|
|
513
|
-
custom_prompt="",
|
|
514
|
-
tools=_with_minimum_tools("read"),
|
|
515
|
-
)
|
|
516
|
-
assert ASSISTANT_ONLY_PROMPT not in prompt
|
|
517
|
-
assert "@target:" not in WORKER_ROLE_SYSTEM_PROMPT
|
|
518
|
-
assert "your parent" not in WORKER_ROLE_SYSTEM_PROMPT
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
def test_get_system_prompt_falls_back_to_steward_role_for_assistant(monkeypatch):
|
|
522
|
-
monkeypatch.setattr(
|
|
523
|
-
"flowent.settings.get_settings",
|
|
524
|
-
lambda: Settings(roles=[]),
|
|
525
|
-
)
|
|
526
|
-
|
|
527
|
-
prompt = get_system_prompt(
|
|
528
|
-
NodeConfig(
|
|
529
|
-
node_type=NodeType.ASSISTANT,
|
|
530
|
-
role_name="Ghost",
|
|
531
|
-
tools=list(STEWARD_ROLE_INCLUDED_TOOLS),
|
|
532
|
-
)
|
|
533
|
-
)
|
|
534
|
-
|
|
535
|
-
assert prompt == compose_system_prompt(
|
|
536
|
-
STEWARD_ROLE_SYSTEM_PROMPT,
|
|
537
|
-
custom_prompt="",
|
|
538
|
-
is_assistant=True,
|
|
539
|
-
tools=_with_minimum_tools(*STEWARD_ROLE_INCLUDED_TOOLS),
|
|
540
|
-
)
|
|
541
|
-
assert ASSISTANT_ONLY_PROMPT in prompt
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
def test_steward_included_tools_contains_list_roles_and_list_tools():
|
|
545
|
-
assert "delete_workflow" in STEWARD_ROLE_INCLUDED_TOOLS
|
|
546
|
-
assert "set_permissions" in STEWARD_ROLE_INCLUDED_TOOLS
|
|
547
|
-
assert "list_roles" in STEWARD_ROLE_INCLUDED_TOOLS
|
|
548
|
-
assert "list_workflows" in STEWARD_ROLE_INCLUDED_TOOLS
|
|
549
|
-
assert "list_tools" in STEWARD_ROLE_INCLUDED_TOOLS
|
|
550
|
-
assert "connect" not in STEWARD_ROLE_INCLUDED_TOOLS
|
|
551
|
-
assert "connect" in CONDUCTOR_ROLE_INCLUDED_TOOLS
|
|
552
|
-
assert "list_workflows" not in CONDUCTOR_ROLE_INCLUDED_TOOLS
|
|
553
|
-
assert "set_permissions" not in CONDUCTOR_ROLE_INCLUDED_TOOLS
|
|
554
|
-
assert "set_permissions" not in WORKER_ROLE_INCLUDED_TOOLS
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
def test_steward_prompt_requires_same_response_dispatch_and_no_rebroadcast():
|
|
558
|
-
assert (
|
|
559
|
-
"dispatch the first task brief to its Leader with `send`"
|
|
560
|
-
in STEWARD_ROLE_SYSTEM_PROMPT
|
|
561
|
-
)
|
|
562
|
-
assert (
|
|
563
|
-
"keep using `send` until every intended Leader has been dispatched"
|
|
564
|
-
in STEWARD_ROLE_SYSTEM_PROMPT
|
|
565
|
-
)
|
|
566
|
-
assert "Do not re-send a task to a node" in STEWARD_ROLE_SYSTEM_PROMPT
|
|
567
|
-
assert (
|
|
568
|
-
"Do not insert tool calls such as `contacts` between dispatch responses"
|
|
569
|
-
in STEWARD_ROLE_SYSTEM_PROMPT
|
|
570
|
-
)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/backend/tests/unit/providers/__pycache__/test_openai_provider.cpython-313-pytest-9.0.3.pyc
DELETED
|
Binary file
|
package/backend/tests/unit/providers/__pycache__/test_openai_responses.cpython-313-pytest-9.0.3.pyc
DELETED
|
Binary file
|