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,176 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import time
|
|
4
|
-
from dataclasses import dataclass, field
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@dataclass
|
|
8
|
-
class BlueprintSlot:
|
|
9
|
-
id: str
|
|
10
|
-
role_name: str
|
|
11
|
-
display_name: str | None = None
|
|
12
|
-
|
|
13
|
-
def serialize(self) -> dict[str, object]:
|
|
14
|
-
return {
|
|
15
|
-
"id": self.id,
|
|
16
|
-
"role_name": self.role_name,
|
|
17
|
-
"display_name": self.display_name,
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
@classmethod
|
|
21
|
-
def from_mapping(cls, data: dict[str, object]) -> BlueprintSlot | None:
|
|
22
|
-
slot_id = data.get("id")
|
|
23
|
-
role_name = data.get("role_name")
|
|
24
|
-
if not isinstance(slot_id, str) or not slot_id.strip():
|
|
25
|
-
return None
|
|
26
|
-
if not isinstance(role_name, str) or not role_name.strip():
|
|
27
|
-
return None
|
|
28
|
-
raw_display_name = data.get("display_name")
|
|
29
|
-
return cls(
|
|
30
|
-
id=slot_id.strip(),
|
|
31
|
-
role_name=role_name.strip(),
|
|
32
|
-
display_name=(
|
|
33
|
-
raw_display_name.strip()
|
|
34
|
-
if isinstance(raw_display_name, str) and raw_display_name.strip()
|
|
35
|
-
else None
|
|
36
|
-
),
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
@dataclass
|
|
41
|
-
class BlueprintEdge:
|
|
42
|
-
from_slot_id: str
|
|
43
|
-
to_slot_id: str
|
|
44
|
-
|
|
45
|
-
def serialize(self) -> dict[str, object]:
|
|
46
|
-
return {
|
|
47
|
-
"from_slot_id": self.from_slot_id,
|
|
48
|
-
"to_slot_id": self.to_slot_id,
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
@classmethod
|
|
52
|
-
def from_mapping(cls, data: dict[str, object]) -> BlueprintEdge | None:
|
|
53
|
-
from_slot_id = data.get("from_slot_id")
|
|
54
|
-
to_slot_id = data.get("to_slot_id")
|
|
55
|
-
if not isinstance(from_slot_id, str) or not from_slot_id.strip():
|
|
56
|
-
return None
|
|
57
|
-
if not isinstance(to_slot_id, str) or not to_slot_id.strip():
|
|
58
|
-
return None
|
|
59
|
-
return cls(
|
|
60
|
-
from_slot_id=from_slot_id.strip(),
|
|
61
|
-
to_slot_id=to_slot_id.strip(),
|
|
62
|
-
)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
@dataclass
|
|
66
|
-
class BlueprintVersionSummary:
|
|
67
|
-
version: int
|
|
68
|
-
updated_at: float
|
|
69
|
-
|
|
70
|
-
def serialize(self) -> dict[str, object]:
|
|
71
|
-
return {
|
|
72
|
-
"version": self.version,
|
|
73
|
-
"updated_at": self.updated_at,
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
@classmethod
|
|
77
|
-
def from_mapping(
|
|
78
|
-
cls,
|
|
79
|
-
data: dict[str, object],
|
|
80
|
-
) -> BlueprintVersionSummary | None:
|
|
81
|
-
version = data.get("version")
|
|
82
|
-
updated_at = data.get("updated_at")
|
|
83
|
-
if not isinstance(version, int) or version <= 0:
|
|
84
|
-
return None
|
|
85
|
-
if not isinstance(updated_at, (int, float)):
|
|
86
|
-
return None
|
|
87
|
-
return cls(version=version, updated_at=updated_at)
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
@dataclass
|
|
91
|
-
class AgentBlueprint:
|
|
92
|
-
id: str
|
|
93
|
-
name: str
|
|
94
|
-
description: str = ""
|
|
95
|
-
version: int = 1
|
|
96
|
-
slots: list[BlueprintSlot] = field(default_factory=list)
|
|
97
|
-
edges: list[BlueprintEdge] = field(default_factory=list)
|
|
98
|
-
created_at: float = field(default_factory=time.time)
|
|
99
|
-
updated_at: float = field(default_factory=time.time)
|
|
100
|
-
version_history: list[BlueprintVersionSummary] = field(default_factory=list)
|
|
101
|
-
|
|
102
|
-
def serialize(self) -> dict[str, object]:
|
|
103
|
-
return {
|
|
104
|
-
"id": self.id,
|
|
105
|
-
"name": self.name,
|
|
106
|
-
"description": self.description,
|
|
107
|
-
"version": self.version,
|
|
108
|
-
"slots": [slot.serialize() for slot in self.slots],
|
|
109
|
-
"edges": [edge.serialize() for edge in self.edges],
|
|
110
|
-
"created_at": self.created_at,
|
|
111
|
-
"updated_at": self.updated_at,
|
|
112
|
-
"version_history": [item.serialize() for item in self.version_history],
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
@classmethod
|
|
116
|
-
def from_mapping(cls, data: dict[str, object]) -> AgentBlueprint:
|
|
117
|
-
created_at = data.get("created_at")
|
|
118
|
-
updated_at = data.get("updated_at")
|
|
119
|
-
raw_slots = data.get("slots")
|
|
120
|
-
raw_edges = data.get("edges")
|
|
121
|
-
raw_version_history = data.get("version_history")
|
|
122
|
-
slots = [
|
|
123
|
-
slot
|
|
124
|
-
for slot in (
|
|
125
|
-
BlueprintSlot.from_mapping(item)
|
|
126
|
-
for item in (raw_slots if isinstance(raw_slots, list) else [])
|
|
127
|
-
if isinstance(item, dict)
|
|
128
|
-
)
|
|
129
|
-
if slot is not None
|
|
130
|
-
]
|
|
131
|
-
edges = [
|
|
132
|
-
edge
|
|
133
|
-
for edge in (
|
|
134
|
-
BlueprintEdge.from_mapping(item)
|
|
135
|
-
for item in (raw_edges if isinstance(raw_edges, list) else [])
|
|
136
|
-
if isinstance(item, dict)
|
|
137
|
-
)
|
|
138
|
-
if edge is not None
|
|
139
|
-
]
|
|
140
|
-
raw_version = data.get("version")
|
|
141
|
-
normalized_created_at = (
|
|
142
|
-
created_at if isinstance(created_at, (int, float)) else time.time()
|
|
143
|
-
)
|
|
144
|
-
normalized_updated_at = (
|
|
145
|
-
updated_at if isinstance(updated_at, (int, float)) else time.time()
|
|
146
|
-
)
|
|
147
|
-
version = raw_version if isinstance(raw_version, int) and raw_version > 0 else 1
|
|
148
|
-
version_history = [
|
|
149
|
-
item
|
|
150
|
-
for item in (
|
|
151
|
-
BlueprintVersionSummary.from_mapping(entry)
|
|
152
|
-
for entry in (
|
|
153
|
-
raw_version_history if isinstance(raw_version_history, list) else []
|
|
154
|
-
)
|
|
155
|
-
if isinstance(entry, dict)
|
|
156
|
-
)
|
|
157
|
-
if item is not None
|
|
158
|
-
]
|
|
159
|
-
if not version_history:
|
|
160
|
-
version_history = [
|
|
161
|
-
BlueprintVersionSummary(
|
|
162
|
-
version=version,
|
|
163
|
-
updated_at=normalized_updated_at,
|
|
164
|
-
)
|
|
165
|
-
]
|
|
166
|
-
return cls(
|
|
167
|
-
id=str(data.get("id", "")),
|
|
168
|
-
name=str(data.get("name", "")),
|
|
169
|
-
description=str(data.get("description", "")),
|
|
170
|
-
version=version,
|
|
171
|
-
slots=slots,
|
|
172
|
-
edges=edges,
|
|
173
|
-
created_at=normalized_created_at,
|
|
174
|
-
updated_at=normalized_updated_at,
|
|
175
|
-
version_history=version_history,
|
|
176
|
-
)
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from dataclasses import dataclass
|
|
4
|
-
from typing import Any
|
|
5
|
-
|
|
6
|
-
from flowent.models.base import Serializable
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
@dataclass
|
|
10
|
-
class TextPart(Serializable):
|
|
11
|
-
text: str
|
|
12
|
-
|
|
13
|
-
def serialize(self) -> dict[str, Any]:
|
|
14
|
-
return {"type": "text", "text": self.text}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@dataclass
|
|
18
|
-
class ImagePart(Serializable):
|
|
19
|
-
asset_id: str
|
|
20
|
-
mime_type: str | None = None
|
|
21
|
-
width: int | None = None
|
|
22
|
-
height: int | None = None
|
|
23
|
-
alt: str | None = None
|
|
24
|
-
|
|
25
|
-
def serialize(self) -> dict[str, Any]:
|
|
26
|
-
return {
|
|
27
|
-
"type": "image",
|
|
28
|
-
"asset_id": self.asset_id,
|
|
29
|
-
"mime_type": self.mime_type,
|
|
30
|
-
"width": self.width,
|
|
31
|
-
"height": self.height,
|
|
32
|
-
"alt": self.alt,
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
ContentPart = TextPart | ImagePart
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
def fallback_text_parts(content: str | None) -> list[ContentPart]:
|
|
40
|
-
if not isinstance(content, str) or not content:
|
|
41
|
-
return []
|
|
42
|
-
return [TextPart(text=content)]
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
def deserialize_content_parts(
|
|
46
|
-
raw_parts: Any,
|
|
47
|
-
*,
|
|
48
|
-
fallback_text: str | None = None,
|
|
49
|
-
) -> list[ContentPart]:
|
|
50
|
-
if not isinstance(raw_parts, list):
|
|
51
|
-
return fallback_text_parts(fallback_text)
|
|
52
|
-
|
|
53
|
-
parts: list[ContentPart] = []
|
|
54
|
-
for raw_part in raw_parts:
|
|
55
|
-
if not isinstance(raw_part, dict):
|
|
56
|
-
continue
|
|
57
|
-
part_type = raw_part.get("type")
|
|
58
|
-
if part_type == "TextPart":
|
|
59
|
-
part_type = "text"
|
|
60
|
-
if part_type == "ImagePart":
|
|
61
|
-
part_type = "image"
|
|
62
|
-
|
|
63
|
-
if part_type == "text":
|
|
64
|
-
text = raw_part.get("text")
|
|
65
|
-
if isinstance(text, str):
|
|
66
|
-
parts.append(TextPart(text=text))
|
|
67
|
-
continue
|
|
68
|
-
|
|
69
|
-
if part_type == "image":
|
|
70
|
-
asset_id = raw_part.get("asset_id")
|
|
71
|
-
if not isinstance(asset_id, str) or not asset_id:
|
|
72
|
-
continue
|
|
73
|
-
width = raw_part.get("width")
|
|
74
|
-
height = raw_part.get("height")
|
|
75
|
-
parts.append(
|
|
76
|
-
ImagePart(
|
|
77
|
-
asset_id=asset_id,
|
|
78
|
-
mime_type=(
|
|
79
|
-
str(raw_part["mime_type"])
|
|
80
|
-
if isinstance(raw_part.get("mime_type"), str)
|
|
81
|
-
else None
|
|
82
|
-
),
|
|
83
|
-
width=width if isinstance(width, int) else None,
|
|
84
|
-
height=height if isinstance(height, int) else None,
|
|
85
|
-
alt=(
|
|
86
|
-
str(raw_part["alt"])
|
|
87
|
-
if isinstance(raw_part.get("alt"), str)
|
|
88
|
-
else None
|
|
89
|
-
),
|
|
90
|
-
)
|
|
91
|
-
)
|
|
92
|
-
|
|
93
|
-
if parts:
|
|
94
|
-
return parts
|
|
95
|
-
return fallback_text_parts(fallback_text)
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
def parse_content_parts_payload(raw_parts: Any) -> list[ContentPart]:
|
|
99
|
-
if not isinstance(raw_parts, list) or not raw_parts:
|
|
100
|
-
raise ValueError("send.parts must be a non-empty array")
|
|
101
|
-
|
|
102
|
-
parts: list[ContentPart] = []
|
|
103
|
-
for index, raw_part in enumerate(raw_parts):
|
|
104
|
-
if not isinstance(raw_part, dict):
|
|
105
|
-
raise ValueError(f"send.parts[{index}] must be an object")
|
|
106
|
-
|
|
107
|
-
part_type = raw_part.get("type")
|
|
108
|
-
if part_type == "text":
|
|
109
|
-
text = raw_part.get("text")
|
|
110
|
-
if not isinstance(text, str):
|
|
111
|
-
raise ValueError(f"send.parts[{index}].text must be a string")
|
|
112
|
-
parts.append(TextPart(text=text))
|
|
113
|
-
continue
|
|
114
|
-
|
|
115
|
-
if part_type == "image":
|
|
116
|
-
asset_id = raw_part.get("asset_id")
|
|
117
|
-
if not isinstance(asset_id, str) or not asset_id:
|
|
118
|
-
raise ValueError(
|
|
119
|
-
f"send.parts[{index}].asset_id must be a non-empty string"
|
|
120
|
-
)
|
|
121
|
-
width = raw_part.get("width")
|
|
122
|
-
height = raw_part.get("height")
|
|
123
|
-
if width is not None and not isinstance(width, int):
|
|
124
|
-
raise ValueError(f"send.parts[{index}].width must be an integer")
|
|
125
|
-
if height is not None and not isinstance(height, int):
|
|
126
|
-
raise ValueError(f"send.parts[{index}].height must be an integer")
|
|
127
|
-
mime_type = raw_part.get("mime_type")
|
|
128
|
-
if mime_type is not None and not isinstance(mime_type, str):
|
|
129
|
-
raise ValueError(f"send.parts[{index}].mime_type must be a string")
|
|
130
|
-
alt = raw_part.get("alt")
|
|
131
|
-
if alt is not None and not isinstance(alt, str):
|
|
132
|
-
raise ValueError(f"send.parts[{index}].alt must be a string")
|
|
133
|
-
parts.append(
|
|
134
|
-
ImagePart(
|
|
135
|
-
asset_id=asset_id,
|
|
136
|
-
mime_type=mime_type,
|
|
137
|
-
width=width,
|
|
138
|
-
height=height,
|
|
139
|
-
alt=alt,
|
|
140
|
-
)
|
|
141
|
-
)
|
|
142
|
-
continue
|
|
143
|
-
|
|
144
|
-
raise ValueError(f"send.parts[{index}].type must be either `text` or `image`")
|
|
145
|
-
|
|
146
|
-
return parts
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
def content_parts_to_text(parts: list[ContentPart]) -> str:
|
|
150
|
-
text_parts: list[str] = []
|
|
151
|
-
for part in parts:
|
|
152
|
-
if isinstance(part, TextPart):
|
|
153
|
-
text_parts.append(part.text)
|
|
154
|
-
continue
|
|
155
|
-
if isinstance(part, ImagePart):
|
|
156
|
-
if part.alt:
|
|
157
|
-
text_parts.append(f"[image: {part.alt}]")
|
|
158
|
-
else:
|
|
159
|
-
text_parts.append("[image]")
|
|
160
|
-
return "".join(text_parts)
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
def has_image_parts(parts: list[ContentPart]) -> bool:
|
|
164
|
-
return any(isinstance(part, ImagePart) for part in parts)
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from dataclasses import dataclass
|
|
4
|
-
|
|
5
|
-
from flowent.models.base import Serializable
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
@dataclass
|
|
9
|
-
class ContentDelta(Serializable):
|
|
10
|
-
text: str
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
@dataclass
|
|
14
|
-
class ThinkingDelta(Serializable):
|
|
15
|
-
text: str
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
@dataclass
|
|
19
|
-
class ToolResultDelta(Serializable):
|
|
20
|
-
tool_call_id: str
|
|
21
|
-
text: str
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
@dataclass
|
|
25
|
-
class SentMessageDelta(Serializable):
|
|
26
|
-
message_id: str
|
|
27
|
-
to_id: str
|
|
28
|
-
text: str
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
@dataclass
|
|
32
|
-
class ReceivedMessageDelta(Serializable):
|
|
33
|
-
message_id: str
|
|
34
|
-
from_id: str
|
|
35
|
-
text: str
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
StreamingDelta = (
|
|
39
|
-
ContentDelta
|
|
40
|
-
| ThinkingDelta
|
|
41
|
-
| ToolResultDelta
|
|
42
|
-
| SentMessageDelta
|
|
43
|
-
| ReceivedMessageDelta
|
|
44
|
-
)
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import time
|
|
4
|
-
from dataclasses import dataclass, field
|
|
5
|
-
from enum import StrEnum
|
|
6
|
-
from typing import Any
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class EventType(StrEnum):
|
|
10
|
-
TAB_CREATED = "tab_created"
|
|
11
|
-
TAB_UPDATED = "tab_updated"
|
|
12
|
-
TAB_DELETED = "tab_deleted"
|
|
13
|
-
NODE_CREATED = "node_created"
|
|
14
|
-
NODE_STATE_CHANGED = "node_state_changed"
|
|
15
|
-
NODE_TODOS_CHANGED = "node_todos_changed"
|
|
16
|
-
NODE_MESSAGE = "node_message"
|
|
17
|
-
NODE_TERMINATED = "node_terminated"
|
|
18
|
-
NODE_DELETED = "node_deleted"
|
|
19
|
-
NODE_CONNECTED = "node_connected"
|
|
20
|
-
NODE_DISCONNECTED = "node_disconnected"
|
|
21
|
-
ASSISTANT_CONTENT = "assistant_content"
|
|
22
|
-
TOOL_CALLED = "tool_called"
|
|
23
|
-
HISTORY_CLEARED = "history_cleared"
|
|
24
|
-
HISTORY_REPLACED = "history_replaced"
|
|
25
|
-
HISTORY_ENTRY_ADDED = "history_entry_added"
|
|
26
|
-
HISTORY_ENTRY_DELTA = "history_entry_delta"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
DISPLAY_EVENTS: set[EventType] = {
|
|
30
|
-
EventType.TAB_CREATED,
|
|
31
|
-
EventType.TAB_UPDATED,
|
|
32
|
-
EventType.TAB_DELETED,
|
|
33
|
-
EventType.NODE_CREATED,
|
|
34
|
-
EventType.NODE_STATE_CHANGED,
|
|
35
|
-
EventType.NODE_TODOS_CHANGED,
|
|
36
|
-
EventType.NODE_MESSAGE,
|
|
37
|
-
EventType.NODE_TERMINATED,
|
|
38
|
-
EventType.NODE_DELETED,
|
|
39
|
-
EventType.NODE_CONNECTED,
|
|
40
|
-
EventType.NODE_DISCONNECTED,
|
|
41
|
-
EventType.ASSISTANT_CONTENT,
|
|
42
|
-
EventType.TOOL_CALLED,
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
@dataclass
|
|
47
|
-
class Event:
|
|
48
|
-
type: EventType
|
|
49
|
-
agent_id: str
|
|
50
|
-
data: dict[str, Any] = field(default_factory=dict)
|
|
51
|
-
timestamp: float = field(default_factory=time.time)
|