Copy disabled (too large)
Download .txt
Showing preview only (10,739K chars total). Download the full file to get everything.
Repository: ModelEngine-Group/nexent
Branch: main
Commit: 4938657ebbfd
Files: 929
Total size: 10.1 MB
Directory structure:
gitextract_mi96_yfc/
├── .claude/
│ └── skills/
│ ├── prompts-writing/
│ │ ├── SKILL.md
│ │ ├── examples.md
│ │ └── references/
│ │ ├── best-practices.md
│ │ └── templates.md
│ └── skill-creator/
│ ├── .openskills.json
│ ├── LICENSE.txt
│ ├── SKILL.md
│ ├── references/
│ │ ├── output-patterns.md
│ │ └── workflows.md
│ └── scripts/
│ ├── init_skill.py
│ ├── package_skill.py
│ └── quick_validate.py
├── .cursor/
│ └── rules/
│ ├── backend/
│ │ ├── app_layer_rules.mdc
│ │ ├── database_layer_rules.mdc
│ │ └── service_layer_rules.mdc
│ ├── english_comments.mdc
│ ├── environment_variable.mdc
│ ├── frontend/
│ │ ├── component_layer_rules.mdc
│ │ ├── frontend_overview_rules.mdc
│ │ ├── hook_layer_rules.mdc
│ │ ├── page_layer_rules.mdc
│ │ ├── service_layer_rules.mdc
│ │ ├── type_layer_rules.mdc
│ │ └── ui_standards_rules.mdc
│ └── pytest_unit_test_rules.mdc
├── .devcontainer/
│ └── devcontainer.json
├── .dockerignore
├── .editorconfig
├── .github/
│ ├── CODEOWNERS
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.yml
│ │ ├── document_issue.yml
│ │ ├── feature_request.yml
│ │ └── improvement_proposal.yml
│ ├── dependabot.yml
│ └── workflows/
│ ├── auto-build-data-process-dev.yml
│ ├── auto-build-doc-dev.yml
│ ├── auto-build-main-dev.yml
│ ├── auto-build-mcp-dev.yml
│ ├── auto-build-terminal-dev.yml
│ ├── auto-build-web-dev.yml
│ ├── auto-image-pull-test.yml
│ ├── auto-unit-test.yml
│ ├── auto-web-check-dev.yml
│ ├── codeql.yml
│ ├── codeql_main.yml
│ ├── deploy-docs.yml
│ ├── docker-build-push-mainland.yml
│ ├── docker-build-push-overseas.yml
│ ├── docker-deploy.yml
│ └── sdk_publish.yml
├── .gitignore
├── AGENTS.md
├── AUTHORS
├── CLAUDE.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── NOTICE
├── README.md
├── README_CN.md
├── SECURITY.md
├── backend/
│ ├── .gitignore
│ ├── __init__.py
│ ├── agents/
│ │ ├── agent_run_manager.py
│ │ ├── create_agent_info.py
│ │ ├── default_agents/
│ │ │ └── __init__.py
│ │ └── preprocess_manager.py
│ ├── apps/
│ │ ├── agent_app.py
│ │ ├── app_factory.py
│ │ ├── config_app.py
│ │ ├── config_sync_app.py
│ │ ├── conversation_management_app.py
│ │ ├── data_process_app.py
│ │ ├── datamate_app.py
│ │ ├── dify_app.py
│ │ ├── file_management_app.py
│ │ ├── group_app.py
│ │ ├── idata_app.py
│ │ ├── image_app.py
│ │ ├── invitation_app.py
│ │ ├── knowledge_summary_app.py
│ │ ├── memory_config_app.py
│ │ ├── mock_user_management_app.py
│ │ ├── model_managment_app.py
│ │ ├── northbound_app.py
│ │ ├── northbound_base_app.py
│ │ ├── prompt_app.py
│ │ ├── remote_mcp_app.py
│ │ ├── runtime_app.py
│ │ ├── tenant_app.py
│ │ ├── tenant_config_app.py
│ │ ├── tool_config_app.py
│ │ ├── user_app.py
│ │ ├── user_management_app.py
│ │ ├── vectordatabase_app.py
│ │ └── voice_app.py
│ ├── assets/
│ │ └── baidu_stopwords.txt
│ ├── config_service.py
│ ├── consts/
│ │ ├── __init__.py
│ │ ├── const.py
│ │ ├── error_code.py
│ │ ├── error_message.py
│ │ ├── exceptions.py
│ │ ├── model.py
│ │ └── provider.py
│ ├── data_process/
│ │ ├── __init__.py
│ │ ├── app.py
│ │ ├── ray_actors.py
│ │ ├── ray_config.py
│ │ ├── tasks.py
│ │ ├── utils.py
│ │ └── worker.py
│ ├── data_process_service.py
│ ├── database/
│ │ ├── __init__.py
│ │ ├── agent_db.py
│ │ ├── agent_version_db.py
│ │ ├── attachment_db.py
│ │ ├── client.py
│ │ ├── conversation_db.py
│ │ ├── db_models.py
│ │ ├── group_db.py
│ │ ├── invitation_db.py
│ │ ├── knowledge_db.py
│ │ ├── memory_config_db.py
│ │ ├── model_management_db.py
│ │ ├── partner_db.py
│ │ ├── remote_mcp_db.py
│ │ ├── role_permission_db.py
│ │ ├── tenant_config_db.py
│ │ ├── token_db.py
│ │ ├── tool_db.py
│ │ ├── user_tenant_db.py
│ │ └── utils.py
│ ├── mcp_service.py
│ ├── middleware/
│ │ ├── __init__.py
│ │ └── exception_handler.py
│ ├── northbound_service.py
│ ├── prompts/
│ │ ├── cluster_summary_reduce_en.yaml
│ │ ├── cluster_summary_reduce_zh.yaml
│ │ ├── document_summary_agent_en.yaml
│ │ ├── document_summary_agent_zh.yaml
│ │ ├── managed_system_prompt_template_en.yaml
│ │ ├── managed_system_prompt_template_zh.yaml
│ │ ├── manager_system_prompt_template_en.yaml
│ │ ├── manager_system_prompt_template_zh.yaml
│ │ └── utils/
│ │ ├── generate_title_en.yaml
│ │ ├── generate_title_zh.yaml
│ │ ├── prompt_generate_en.yaml
│ │ └── prompt_generate_zh.yaml
│ ├── pyproject.toml
│ ├── runtime_service.py
│ ├── services/
│ │ ├── __init__.py
│ │ ├── agent_service.py
│ │ ├── agent_version_service.py
│ │ ├── config_sync_service.py
│ │ ├── conversation_management_service.py
│ │ ├── data_process_service.py
│ │ ├── datamate_service.py
│ │ ├── dify_service.py
│ │ ├── file_management_service.py
│ │ ├── group_service.py
│ │ ├── idata_service.py
│ │ ├── image_service.py
│ │ ├── invitation_service.py
│ │ ├── mcp_container_service.py
│ │ ├── memory_config_service.py
│ │ ├── model_health_service.py
│ │ ├── model_management_service.py
│ │ ├── model_provider_service.py
│ │ ├── northbound_service.py
│ │ ├── prompt_service.py
│ │ ├── providers/
│ │ │ ├── __init__.py
│ │ │ ├── base.py
│ │ │ ├── dashscope_provider.py
│ │ │ ├── modelengine_provider.py
│ │ │ ├── silicon_provider.py
│ │ │ └── tokenpony_provider.py
│ │ ├── redis_service.py
│ │ ├── remote_mcp_service.py
│ │ ├── tenant_service.py
│ │ ├── tool_configuration_service.py
│ │ ├── user_management_service.py
│ │ ├── user_service.py
│ │ ├── vectordatabase_service.py
│ │ └── voice_service.py
│ ├── tool_collection/
│ │ ├── langchain/
│ │ │ └── compute_tool.py
│ │ └── mcp/
│ │ └── local_mcp_service.py
│ └── utils/
│ ├── __init__.py
│ ├── auth_utils.py
│ ├── config_utils.py
│ ├── document_vector_utils.py
│ ├── file_management_utils.py
│ ├── langchain_utils.py
│ ├── llm_utils.py
│ ├── logging_utils.py
│ ├── memory_utils.py
│ ├── model_name_utils.py
│ ├── monitoring.py
│ ├── prompt_template_utils.py
│ ├── str_utils.py
│ ├── task_status_utils.py
│ └── thread_utils.py
├── doc/
│ ├── .gitignore
│ ├── docs/
│ │ ├── .vitepress/
│ │ │ ├── config.mts
│ │ │ └── theme/
│ │ │ ├── index.ts
│ │ │ └── style.css
│ │ ├── en/
│ │ │ ├── backend/
│ │ │ │ ├── api-reference.md
│ │ │ │ ├── overview.md
│ │ │ │ ├── prompt-development.md
│ │ │ │ ├── tools/
│ │ │ │ │ ├── index.md
│ │ │ │ │ ├── langchain.md
│ │ │ │ │ ├── mcp.md
│ │ │ │ │ └── nexent-native.md
│ │ │ │ └── version-management.md
│ │ │ ├── code-of-conduct.md
│ │ │ ├── contributing.md
│ │ │ ├── contributors.md
│ │ │ ├── deployment/
│ │ │ │ ├── devcontainer.md
│ │ │ │ └── docker-build.md
│ │ │ ├── developer-guide/
│ │ │ │ ├── environment-setup.md
│ │ │ │ └── overview.md
│ │ │ ├── docs-development.md
│ │ │ ├── frontend/
│ │ │ │ └── overview.md
│ │ │ ├── getting-started/
│ │ │ │ ├── features.md
│ │ │ │ ├── overview.md
│ │ │ │ └── software-architecture.md
│ │ │ ├── license.md
│ │ │ ├── mcp-ecosystem/
│ │ │ │ ├── mcp-recommendations.md
│ │ │ │ ├── overview.md
│ │ │ │ └── use-cases.md
│ │ │ ├── opensource-memorial-wall.md
│ │ │ ├── quick-start/
│ │ │ │ ├── faq.md
│ │ │ │ ├── installation.md
│ │ │ │ └── upgrade-guide.md
│ │ │ ├── sdk/
│ │ │ │ ├── basic-usage.md
│ │ │ │ ├── core/
│ │ │ │ │ ├── agents.md
│ │ │ │ │ ├── models.md
│ │ │ │ │ ├── multimodal.md
│ │ │ │ │ └── tools.md
│ │ │ │ ├── data-process.md
│ │ │ │ ├── features.md
│ │ │ │ ├── monitoring.md
│ │ │ │ ├── overview.md
│ │ │ │ └── vector-database.md
│ │ │ ├── security.md
│ │ │ ├── testing/
│ │ │ │ ├── backend.md
│ │ │ │ └── overview.md
│ │ │ └── user-guide/
│ │ │ ├── agent-development.md
│ │ │ ├── agent-market.md
│ │ │ ├── agent-space.md
│ │ │ ├── home-page.md
│ │ │ ├── knowledge-base.md
│ │ │ ├── local-tools/
│ │ │ │ ├── email-tools.md
│ │ │ │ ├── file-tools.md
│ │ │ │ ├── index.md
│ │ │ │ ├── multimodal-tools.md
│ │ │ │ ├── search-tools.md
│ │ │ │ └── terminal-tool.md
│ │ │ ├── mcp-tools.md
│ │ │ ├── memory-management.md
│ │ │ ├── model-management.md
│ │ │ ├── monitor.md
│ │ │ ├── quick-setup.md
│ │ │ ├── start-chat.md
│ │ │ └── user-management.md
│ │ ├── index.md
│ │ └── zh/
│ │ ├── backend/
│ │ │ ├── api-reference.md
│ │ │ ├── overview.md
│ │ │ ├── prompt-development.md
│ │ │ ├── tools/
│ │ │ │ ├── index.md
│ │ │ │ ├── langchain.md
│ │ │ │ ├── mcp.md
│ │ │ │ └── nexent-native.md
│ │ │ └── version-management.md
│ │ ├── code-of-conduct.md
│ │ ├── contributing.md
│ │ ├── contributors.md
│ │ ├── deployment/
│ │ │ ├── devcontainer.md
│ │ │ └── docker-build.md
│ │ ├── developer-guide/
│ │ │ ├── environment-setup.md
│ │ │ └── overview.md
│ │ ├── docs-development.md
│ │ ├── frontend/
│ │ │ └── overview.md
│ │ ├── getting-started/
│ │ │ ├── features.md
│ │ │ ├── overview.md
│ │ │ └── software-architecture.md
│ │ ├── license.md
│ │ ├── mcp-ecosystem/
│ │ │ ├── mcp-recommendations.md
│ │ │ ├── overview.md
│ │ │ └── use-cases.md
│ │ ├── opensource-memorial-wall.md
│ │ ├── quick-start/
│ │ │ ├── faq.md
│ │ │ ├── installation.md
│ │ │ └── upgrade-guide.md
│ │ ├── sdk/
│ │ │ ├── basic-usage.md
│ │ │ ├── core/
│ │ │ │ ├── agents.md
│ │ │ │ ├── models.md
│ │ │ │ ├── multimodal.md
│ │ │ │ └── tools.md
│ │ │ ├── data-process.md
│ │ │ ├── features.md
│ │ │ ├── monitoring.md
│ │ │ ├── overview.md
│ │ │ └── vector-database.md
│ │ ├── security.md
│ │ ├── testing/
│ │ │ ├── backend.md
│ │ │ └── overview.md
│ │ └── user-guide/
│ │ ├── agent-development.md
│ │ ├── agent-market.md
│ │ ├── agent-space.md
│ │ ├── home-page.md
│ │ ├── knowledge-base.md
│ │ ├── local-tools/
│ │ │ ├── email-tools.md
│ │ │ ├── file-tools.md
│ │ │ ├── index.md
│ │ │ ├── multimodal-tools.md
│ │ │ ├── search-tools.md
│ │ │ └── terminal-tool.md
│ │ ├── mcp-tools.md
│ │ ├── memory-management.md
│ │ ├── model-management.md
│ │ ├── monitor.md
│ │ ├── quick-setup.md
│ │ ├── start-chat.md
│ │ └── user-management.md
│ ├── package.json
│ └── pnpm-workspace.yaml
├── docker/
│ ├── create-su.sh
│ ├── deploy.sh
│ ├── docker-compose-monitoring.yml
│ ├── docker-compose-supabase.prod.yml
│ ├── docker-compose-supabase.yml
│ ├── docker-compose.dev.yml
│ ├── docker-compose.prod.yml
│ ├── docker-compose.yml
│ ├── generate_env.sh
│ ├── init.sql
│ ├── monitoring/
│ │ ├── grafana/
│ │ │ ├── dashboards/
│ │ │ │ └── nexent-llm-performance.json
│ │ │ └── provisioning/
│ │ │ ├── dashboards/
│ │ │ │ └── dashboards.yml
│ │ │ └── datasources/
│ │ │ └── datasources.yml
│ │ ├── monitoring.env
│ │ ├── monitoring.env.example
│ │ ├── otel-collector-config.yml
│ │ └── prometheus.yml
│ ├── openssh-install-script.sh
│ ├── scripts/
│ │ ├── sync_user_supabase2pg.py
│ │ └── v180_sync_user_metadata.sh
│ ├── sql/
│ │ ├── v1.1.0_0619_add_tenant_config_t.sql
│ │ ├── v1.2.0_0627_increase_config_value_length.sql
│ │ ├── v1.3.0_0630_add_mcp_record_t.sql
│ │ ├── v1.4.0_0708_add_user_tenant_t.sql
│ │ ├── v1.5.0_0715_add_knowledge_describe_length.sql
│ │ ├── v1.5.0_0716_add_status_to_mcp_record_t.sql
│ │ ├── v1.6.0_0722_modify_tenant_agent.sql
│ │ ├── v1.6.0_0723_add_agent_relation_t.sql
│ │ ├── v1.7.1_0805_add_deep_thinking_to_model_record_t.sql
│ │ ├── v1.7.1_0806_add_memory_user_config.sql
│ │ ├── v1.7.2.2_0820_add_partner_mapping_id_t.sql
│ │ ├── v1.7.2_0809_add_name_zh_to_ag_tenant_agent_t.sql
│ │ ├── v1.7.2_0812_modify_model_record_t.sql
│ │ ├── v1.7.3.2_0902_add_model_name_to_knowledge_record_t.sql
│ │ ├── v1.7.4.1_1011_add_origin_tool_name_to_ag_tool_info.sql
│ │ ├── v1.7.4.1_1013_add_tool_group_to_ag_tool_info.sql
│ │ ├── v1.7.4_0928_add_model_id_to_ag_tenant_agent_t.sql
│ │ ├── v1.7.5.1_1028_add_chunk_size_to_model_record_t.sql
│ │ ├── v1.7.5_1024_add_business_logic_model_fields.sql
│ │ ├── v1.7.5_1024_alter_tenant_config_t_config_value.sql
│ │ ├── v1.7.7_1129_add_ssl_verify_to_model_record_t.sql
│ │ ├── v1.7.8_1204_add_knowledge_name_to_knowledge_record_t.sql
│ │ ├── v1.7.8_add_author_to_ag_tenant_agent_t.sql
│ │ ├── v1.7.9.2_1226_add_invitation_and_group_system.sql
│ │ ├── v1.7.9.3_0122_add_is_new_to_ag_tenant_agent_t.sql
│ │ ├── v1.7.9.3_0123_add_speed_user_tenant_t.sql
│ │ ├── v1.7.9_1219_add_container_id_to_mcp_record_t.sql
│ │ ├── v1.8.0.1_0224_init_agent_id_seq.sql
│ │ ├── v1.8.0.1_0225_delete_empty_tenant.sql
│ │ ├── v1.8.0.1_0226_add_authorization_token_to_mcp_record_t.sql
│ │ ├── v1.8.0.2_0227_add_ingroup_permission_to_ag_tenant_agent_t.sql
│ │ ├── v1.8.0.2_0302_add_tool_instance_id_seq_and_agent_relation_id_seq.sql
│ │ ├── v1.8.0_0204_init_tenant_group.sql
│ │ ├── v1.8.0_0206_add_ag_tenant_agent_version_t .sql
│ │ ├── v1.8.0_0206_init_role_permission_t.sql
│ │ └── v1.8.1_0306_add_user_token_info.sql
│ ├── start-monitoring.sh
│ ├── uninstall.sh
│ ├── upgrade.sh
│ └── volumes/
│ ├── api/
│ │ └── kong.yml
│ ├── db/
│ │ ├── _supabase.sql
│ │ ├── init/
│ │ │ └── data.sql
│ │ ├── jwt.sql
│ │ ├── logs.sql
│ │ ├── pooler.sql
│ │ ├── realtime.sql
│ │ ├── roles.sql
│ │ └── webhooks.sql
│ ├── functions/
│ │ ├── hello/
│ │ │ └── index.ts
│ │ └── main/
│ │ └── index.ts
│ ├── logs/
│ │ └── vector.yml
│ └── pooler/
│ └── pooler.exs
├── experimental/
│ └── tune/
│ ├── base/
│ │ ├── case.py
│ │ ├── constant.py
│ │ ├── context_manager.py
│ │ ├── exception.py
│ │ └── utils.py
│ ├── common/
│ │ ├── exception.py
│ │ └── singleton.py
│ ├── joint_evaluator.py
│ ├── joint_optimizer.py
│ └── joint_prompt_pool.yaml
├── frontend/
│ ├── .eslintrc.json
│ ├── .gitignore
│ ├── .prettierignore
│ ├── .prettierrc
│ ├── app/
│ │ └── [locale]/
│ │ ├── agents/
│ │ │ ├── AgentVersionCard.tsx
│ │ │ ├── AgentVersionManage.tsx
│ │ │ ├── components/
│ │ │ │ ├── AgentConfigComp.tsx
│ │ │ │ ├── AgentInfoComp.tsx
│ │ │ │ ├── AgentManageComp.tsx
│ │ │ │ ├── agentConfig/
│ │ │ │ │ ├── CollaborativeAgent.tsx
│ │ │ │ │ ├── McpConfigModal.tsx
│ │ │ │ │ ├── ToolManagement.tsx
│ │ │ │ │ └── tool/
│ │ │ │ │ ├── ToolConfigModal.tsx
│ │ │ │ │ └── ToolTestPanel.tsx
│ │ │ │ ├── agentInfo/
│ │ │ │ │ ├── AgentGenerateDetail.tsx
│ │ │ │ │ ├── DebugConfig.tsx
│ │ │ │ │ └── ExpandEditModal.tsx
│ │ │ │ └── agentManage/
│ │ │ │ ├── AgentCallRelationshipModal.tsx
│ │ │ │ └── AgentList.tsx
│ │ │ ├── page.tsx
│ │ │ └── versions/
│ │ │ ├── AgentVersionCompareModal.tsx
│ │ │ └── AgentVersionPubulishModal.tsx
│ │ ├── chat/
│ │ │ ├── components/
│ │ │ │ ├── chatAgentSelector.tsx
│ │ │ │ ├── chatHeader.tsx
│ │ │ │ ├── chatInput.tsx
│ │ │ │ ├── chatLeftSidebar.tsx
│ │ │ │ └── chatRightPanel.tsx
│ │ │ ├── internal/
│ │ │ │ ├── ChatTopNavContent.tsx
│ │ │ │ ├── chatAttachment.tsx
│ │ │ │ ├── chatHelpers.tsx
│ │ │ │ ├── chatInterface.tsx
│ │ │ │ ├── chatPreprocess.tsx
│ │ │ │ └── extractMsgFromHistoryResponse.tsx
│ │ │ ├── page.tsx
│ │ │ └── streaming/
│ │ │ ├── chatStreamFinalMessage.tsx
│ │ │ ├── chatStreamHandler.tsx
│ │ │ ├── chatStreamMain.tsx
│ │ │ ├── messageTransformer.ts
│ │ │ └── taskWindow.tsx
│ │ ├── i18n.tsx
│ │ ├── knowledges/
│ │ │ ├── KnowledgeBaseConfiguration.tsx
│ │ │ ├── components/
│ │ │ │ ├── document/
│ │ │ │ │ ├── DocumentChunk.tsx
│ │ │ │ │ ├── DocumentList.tsx
│ │ │ │ │ └── DocumentStatus.tsx
│ │ │ │ ├── knowledge/
│ │ │ │ │ ├── KnowledgeBaseEditModal.tsx
│ │ │ │ │ └── KnowledgeBaseList.tsx
│ │ │ │ └── upload/
│ │ │ │ ├── UploadArea.tsx
│ │ │ │ └── UploadAreaUI.tsx
│ │ │ ├── contexts/
│ │ │ │ ├── DocumentContext.tsx
│ │ │ │ ├── KnowledgeBaseContext.tsx
│ │ │ │ └── UIStateContext.tsx
│ │ │ └── page.tsx
│ │ ├── layout.client.tsx
│ │ ├── layout.tsx
│ │ ├── market/
│ │ │ ├── MarketContent.css
│ │ │ ├── components/
│ │ │ │ ├── AgentMarketCard.tsx
│ │ │ │ ├── MarketAgentDetailModal.tsx
│ │ │ │ └── MarketErrorState.tsx
│ │ │ └── page.tsx
│ │ ├── mcp-tools/
│ │ │ └── page.tsx
│ │ ├── memory/
│ │ │ ├── MemoryMenuList.tsx
│ │ │ ├── memory.css
│ │ │ └── page.tsx
│ │ ├── models/
│ │ │ ├── ModelConfiguration.tsx
│ │ │ ├── components/
│ │ │ │ ├── appConfig.tsx
│ │ │ │ ├── model/
│ │ │ │ │ ├── ModelAddDialog.tsx
│ │ │ │ │ ├── ModelChunkSizeSilder.tsx
│ │ │ │ │ ├── ModelDeleteDialog.tsx
│ │ │ │ │ ├── ModelEditDialog.tsx
│ │ │ │ │ └── ModelListCard.tsx
│ │ │ │ └── modelConfig.tsx
│ │ │ └── page.tsx
│ │ ├── monitoring/
│ │ │ └── page.tsx
│ │ ├── page.tsx
│ │ ├── setup/
│ │ │ └── page.tsx
│ │ ├── space/
│ │ │ ├── components/
│ │ │ │ ├── AgentCard.tsx
│ │ │ │ └── AgentDetailModal.tsx
│ │ │ └── page.tsx
│ │ ├── tenant-resources/
│ │ │ ├── components/
│ │ │ │ ├── UserManageComp.tsx
│ │ │ │ └── resources/
│ │ │ │ ├── AgentList.tsx
│ │ │ │ ├── GroupList.tsx
│ │ │ │ ├── InvitationList.tsx
│ │ │ │ ├── KnowledgeList.tsx
│ │ │ │ ├── McpList.tsx
│ │ │ │ ├── ModelList.tsx
│ │ │ │ └── UserList.tsx
│ │ │ └── page.tsx
│ │ └── users/
│ │ ├── components/
│ │ │ └── UserProfileComp.tsx
│ │ └── page.tsx
│ ├── components/
│ │ ├── agent/
│ │ │ └── AgentImportWizard.tsx
│ │ ├── auth/
│ │ │ ├── AuthDialogs.tsx
│ │ │ ├── DeleteAccountModal.tsx
│ │ │ ├── avatarDropdown.tsx
│ │ │ ├── loginModal.tsx
│ │ │ └── registerModal.tsx
│ │ ├── mcp/
│ │ │ ├── McpContainerLogsModal.tsx
│ │ │ ├── McpEditServerModal.tsx
│ │ │ └── McpToolListModal.tsx
│ │ ├── navigation/
│ │ │ ├── ChatTopNavContent.tsx
│ │ │ ├── FooterLayout.tsx
│ │ │ ├── SideNavigation.tsx
│ │ │ └── TopNavbar.tsx
│ │ ├── permission/
│ │ │ ├── Can.tsx
│ │ │ └── Cannot.tsx
│ │ ├── providers/
│ │ │ ├── AuthenticationProvider.tsx
│ │ │ ├── AuthorizationProvider.tsx
│ │ │ ├── I18nProviderWrapper.tsx
│ │ │ ├── deploymentProvider.tsx
│ │ │ └── rootProvider.tsx
│ │ ├── tool-config/
│ │ │ ├── KnowledgeBaseSelectorModal.tsx
│ │ │ └── index.ts
│ │ └── ui/
│ │ ├── AgentCallRelationshipModal.tsx
│ │ ├── Diagram.tsx
│ │ ├── card.tsx
│ │ ├── copyButton.tsx
│ │ ├── input.tsx
│ │ ├── loading.tsx
│ │ ├── markdownRenderer.tsx
│ │ ├── scrollArea.tsx
│ │ ├── statusBadge.tsx
│ │ ├── textarea.tsx
│ │ └── tooltip.tsx
│ ├── components.json
│ ├── const/
│ │ ├── agentConfig.ts
│ │ ├── auth.ts
│ │ ├── avatar.ts
│ │ ├── chatConfig.ts
│ │ ├── constants.ts
│ │ ├── errorCode.ts
│ │ ├── errorMessage.ts
│ │ ├── errorMessageI18n.ts
│ │ ├── knowledgeBase.ts
│ │ ├── knowledgeBaseLayout.ts
│ │ ├── layoutConstants.ts
│ │ ├── marketConfig.ts
│ │ ├── memoryConfig.ts
│ │ └── modelConfig.ts
│ ├── hooks/
│ │ ├── agent/
│ │ │ ├── useAgentInfo.ts
│ │ │ ├── useAgentList.ts
│ │ │ ├── useAgentVersion.ts
│ │ │ ├── useAgentVersionDetail.ts
│ │ │ ├── useAgentVersionList.ts
│ │ │ ├── usePublishedAgentList.ts
│ │ │ ├── useSaveGuard.ts
│ │ │ └── useToolList.ts
│ │ ├── auth/
│ │ │ ├── useAuthentication.ts
│ │ │ ├── useAuthenticationState.ts
│ │ │ ├── useAuthenticationUI.ts
│ │ │ ├── useAuthorization.ts
│ │ │ └── useSessionManager.ts
│ │ ├── chat/
│ │ │ └── useConversationManagement.ts
│ │ ├── group/
│ │ │ └── useGroupList.ts
│ │ ├── invitation/
│ │ │ └── useInvitationList.ts
│ │ ├── knowledge/
│ │ │ └── useKnowledgeList.ts
│ │ ├── mcp/
│ │ │ ├── useMcpContainerList.ts
│ │ │ └── useMcpServerList.ts
│ │ ├── model/
│ │ │ ├── useDashscopeModelList.ts
│ │ │ ├── useManageTenantModels.ts
│ │ │ ├── useModelList.ts
│ │ │ ├── useSiliconModelList.ts
│ │ │ └── useTokenponyModelList.ts
│ │ ├── permission/
│ │ │ └── usePermission.ts
│ │ ├── tenant/
│ │ │ └── useTenantList.ts
│ │ ├── tool/
│ │ │ └── useToolInfo.ts
│ │ ├── useAgentImport.ts
│ │ ├── useChatTaskMessage.ts
│ │ ├── useConfig.ts
│ │ ├── useConfirmModal.ts
│ │ ├── useErrorHandler.ts
│ │ ├── useKnowledgeBaseConfigChangeHandler.ts
│ │ ├── useKnowledgeBaseSelector.ts
│ │ ├── useMcpConfig.ts
│ │ ├── useMemory.ts
│ │ ├── useModalPosition.ts
│ │ ├── useResponsiveTextSize.ts
│ │ ├── useSetupFlow.ts
│ │ └── user/
│ │ └── useUserList.ts
│ ├── lib/
│ │ ├── agentDebugErrorCache.ts
│ │ ├── agentLabelMapper.ts
│ │ ├── auth.ts
│ │ ├── authEvents.ts
│ │ ├── avatar.tsx
│ │ ├── clipboard.ts
│ │ ├── date.ts
│ │ ├── language.ts
│ │ ├── logger.ts
│ │ ├── providerError.ts
│ │ ├── session.ts
│ │ ├── utils.ts
│ │ └── viewPersistence.ts
│ ├── middleware.ts
│ ├── next.config.mjs
│ ├── package.json
│ ├── pnpm-workspace.yaml
│ ├── postcss.config.mjs
│ ├── public/
│ │ └── locales/
│ │ ├── en/
│ │ │ └── common.json
│ │ └── zh/
│ │ └── common.json
│ ├── server.js
│ ├── services/
│ │ ├── agentConfigService.ts
│ │ ├── agentVersionService.ts
│ │ ├── api.ts
│ │ ├── authService.ts
│ │ ├── configService.ts
│ │ ├── conversationService.ts
│ │ ├── groupService.ts
│ │ ├── invitationService.ts
│ │ ├── knowledgeBasePollingService.ts
│ │ ├── knowledgeBaseService.ts
│ │ ├── marketService.ts
│ │ ├── mcpService.ts
│ │ ├── memoryService.ts
│ │ ├── modelService.ts
│ │ ├── promptService.ts
│ │ ├── sessionService.ts
│ │ ├── storageService.ts
│ │ ├── tenantService.ts
│ │ ├── tokenService.ts
│ │ ├── uploadService.ts
│ │ └── userService.ts
│ ├── stores/
│ │ └── agentConfigStore.ts
│ ├── styles/
│ │ ├── globals.css
│ │ └── react-markdown.css
│ ├── tailwind.config.ts
│ ├── tsconfig.json
│ └── types/
│ ├── agentConfig.ts
│ ├── auth.ts
│ ├── chat.ts
│ ├── conversation.ts
│ ├── knowledgeBase.ts
│ ├── market.ts
│ ├── memory.ts
│ └── modelConfig.ts
├── make/
│ ├── data_process/
│ │ └── Dockerfile
│ ├── docs/
│ │ └── Dockerfile
│ ├── main/
│ │ └── Dockerfile
│ ├── mcp/
│ │ └── Dockerfile
│ ├── terminal/
│ │ ├── Dockerfile
│ │ └── entrypoint.sh
│ └── web/
│ └── Dockerfile
├── pathology-ai/
│ ├── README.md
│ ├── agent-config.md
│ ├── architecture.md
│ ├── code-changes/
│ │ ├── backend/
│ │ │ └── local_mcp_service.py
│ │ ├── docker/
│ │ │ └── update_prompt_btn.sql
│ │ ├── frontend/
│ │ │ ├── DiagnosisConfidenceCard.tsx
│ │ │ ├── MedicalVisualizationPanel.tsx
│ │ │ ├── PathologyImageGallery.tsx
│ │ │ ├── SourceTag.tsx
│ │ │ ├── chatLeftSidebar.tsx
│ │ │ ├── conversationService.ts
│ │ │ ├── index.ts
│ │ │ └── markdownRenderer.tsx
│ │ └── medical_extension/
│ │ ├── __init__.py
│ │ ├── agent_templates.py
│ │ ├── api.py
│ │ ├── chain_of_diagnosis.py
│ │ ├── confidence_evaluator.py
│ │ ├── medical_prompts.py
│ │ └── test_medical.py
│ ├── custom-tools.md
│ └── frontend-improvements.md
├── sdk/
│ ├── nexent/
│ │ ├── __init__.py
│ │ ├── container/
│ │ │ ├── __init__.py
│ │ │ ├── container_client_base.py
│ │ │ ├── container_client_factory.py
│ │ │ ├── docker_client.py
│ │ │ └── docker_config.py
│ │ ├── core/
│ │ │ ├── __init__.py
│ │ │ ├── agents/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── agent_model.py
│ │ │ │ ├── core_agent.py
│ │ │ │ ├── nexent_agent.py
│ │ │ │ └── run_agent.py
│ │ │ ├── models/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── embedding_model.py
│ │ │ │ ├── message_utils.py
│ │ │ │ ├── openai_llm.py
│ │ │ │ ├── openai_long_context_model.py
│ │ │ │ ├── openai_vlm.py
│ │ │ │ ├── stt_model.py
│ │ │ │ └── tts_model.py
│ │ │ ├── nlp/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── stopwords.py
│ │ │ │ └── tokenizer.py
│ │ │ ├── prompts/
│ │ │ │ ├── analyze_file_en.yaml
│ │ │ │ ├── analyze_file_zh.yaml
│ │ │ │ ├── analyze_image_en.yaml
│ │ │ │ └── analyze_image_zh.yaml
│ │ │ ├── tools/
│ │ │ │ ├── README.md
│ │ │ │ ├── README_EN.md
│ │ │ │ ├── __init__.py
│ │ │ │ ├── analyze_image_tool.py
│ │ │ │ ├── analyze_text_file_tool.py
│ │ │ │ ├── create_directory_tool.py
│ │ │ │ ├── create_file_tool.py
│ │ │ │ ├── datamate_search_tool.py
│ │ │ │ ├── delete_directory_tool.py
│ │ │ │ ├── delete_file_tool.py
│ │ │ │ ├── dify_search_tool.py
│ │ │ │ ├── exa_search_tool.py
│ │ │ │ ├── get_email_tool.py
│ │ │ │ ├── idata_search_tool.py
│ │ │ │ ├── knowledge_base_search_tool.py
│ │ │ │ ├── linkup_search_tool.py
│ │ │ │ ├── list_directory_tool.py
│ │ │ │ ├── move_item_tool.py
│ │ │ │ ├── read_file_tool.py
│ │ │ │ ├── send_email_tool.py
│ │ │ │ ├── tavily_search_tool.py
│ │ │ │ └── terminal_tool.py
│ │ │ └── utils/
│ │ │ ├── __init__.py
│ │ │ ├── constants.py
│ │ │ ├── favicon_extractor.py
│ │ │ ├── observer.py
│ │ │ ├── prompt_template_utils.py
│ │ │ └── tools_common_message.py
│ │ ├── data_process/
│ │ │ ├── __init__.py
│ │ │ ├── base.py
│ │ │ ├── core.py
│ │ │ ├── openpyxl_processor.py
│ │ │ └── unstructured_processor.py
│ │ ├── datamate/
│ │ │ ├── __init__.py
│ │ │ └── datamate_client.py
│ │ ├── memory/
│ │ │ ├── __init__.py
│ │ │ ├── embedder_adaptor.py
│ │ │ ├── memory_core.py
│ │ │ ├── memory_service.py
│ │ │ └── memory_utils.py
│ │ ├── monitor/
│ │ │ ├── __init__.py
│ │ │ └── monitoring.py
│ │ ├── multi_modal/
│ │ │ ├── __init__.py
│ │ │ ├── load_save_object.py
│ │ │ └── utils.py
│ │ ├── storage/
│ │ │ ├── __init__.py
│ │ │ ├── minio.py
│ │ │ ├── minio_config.py
│ │ │ ├── storage_client_base.py
│ │ │ └── storage_client_factory.py
│ │ ├── utils/
│ │ │ ├── __init__.py
│ │ │ └── http_client_manager.py
│ │ └── vector_database/
│ │ ├── __init__.py
│ │ ├── base.py
│ │ ├── datamate_core.py
│ │ ├── elasticsearch_core.py
│ │ └── utils.py
│ └── pyproject.toml
└── test/
├── .coveragerc
├── __init__.py
├── assets/
│ ├── test_data_process_doc.txt
│ ├── test_data_process_sheet.xlsx
│ ├── test_prompt.yaml
│ ├── test_sub_prompt.yaml
│ └── test_voice.html
├── backend/
│ ├── __init__.py
│ ├── agents/
│ │ ├── test_agent_run_manager.py
│ │ ├── test_create_agent_info.py
│ │ └── test_preprocess_manager.py
│ ├── app/
│ │ ├── test_agent_app.py
│ │ ├── test_app_factory.py
│ │ ├── test_config_app.py
│ │ ├── test_config_sync_app.py
│ │ ├── test_conversation_management_app.py
│ │ ├── test_data_process_app.py
│ │ ├── test_datamate_app.py
│ │ ├── test_dify_app.py
│ │ ├── test_file_management_app.py
│ │ ├── test_group_app.py
│ │ ├── test_idata_app.py
│ │ ├── test_image_app.py
│ │ ├── test_invitation_app.py
│ │ ├── test_knowledge_summary_app.py
│ │ ├── test_memory_config_app.py
│ │ ├── test_mock_user_management_app.py
│ │ ├── test_model_managment_app.py
│ │ ├── test_northbound_app.py
│ │ ├── test_northbound_base_app.py
│ │ ├── test_remote_mcp_app.py
│ │ ├── test_tenant_app.py
│ │ ├── test_tenant_config_app.py
│ │ ├── test_tool_config_app.py
│ │ ├── test_user_app.py
│ │ ├── test_user_management_app.py
│ │ ├── test_vectordatabase_app.py
│ │ └── test_voice_app.py
│ ├── consts/
│ │ ├── test_error_code.py
│ │ ├── test_error_message.py
│ │ └── test_exceptions.py
│ ├── data_process/
│ │ ├── __init__.py
│ │ ├── test_ray_actors.py
│ │ ├── test_ray_config.py
│ │ ├── test_tasks.py
│ │ └── test_worker.py
│ ├── database/
│ │ ├── test_agent_db.py
│ │ ├── test_agent_version_db.py
│ │ ├── test_attachment_db.py
│ │ ├── test_client.py
│ │ ├── test_conversation_db.py
│ │ ├── test_group_db.py
│ │ ├── test_invitation_db.py
│ │ ├── test_knowledge_db.py
│ │ ├── test_memory_config_db.py
│ │ ├── test_model_managment_db.py
│ │ ├── test_partner_db.py
│ │ ├── test_remote_mcp_db.py
│ │ ├── test_role_permission_db.py
│ │ ├── test_tenant_config_db.py
│ │ ├── test_token_db.py
│ │ ├── test_tool_db.py
│ │ └── test_user_tenant_db.py
│ ├── middleware/
│ │ └── test_exception_handler.py
│ ├── services/
│ │ ├── __init__.py
│ │ ├── providers/
│ │ │ ├── __init__.py
│ │ │ ├── test_base.py
│ │ │ ├── test_dashscope_provider.py
│ │ │ ├── test_modelengine_provider.py
│ │ │ ├── test_silicon_provider.py
│ │ │ └── test_tokenpony_provider.py
│ │ ├── test_agent_service.py
│ │ ├── test_agent_version_service.py
│ │ ├── test_config_sync_service.py
│ │ ├── test_conversation_management_service.py
│ │ ├── test_data_process_service.py
│ │ ├── test_datamate_service.py
│ │ ├── test_dify_service.py
│ │ ├── test_file_management_service.py
│ │ ├── test_group_service.py
│ │ ├── test_idata_service.py
│ │ ├── test_image_service.py
│ │ ├── test_invitation_service.py
│ │ ├── test_mcp_container_service.py
│ │ ├── test_memory_config_service.py
│ │ ├── test_model_health_service.py
│ │ ├── test_model_management_service.py
│ │ ├── test_model_provider_service.py
│ │ ├── test_northbound_service.py
│ │ ├── test_prompt_service.py
│ │ ├── test_redis_service.py
│ │ ├── test_remote_mcp_service.py
│ │ ├── test_tenant_service.py
│ │ ├── test_tool_configuration_service.py
│ │ ├── test_user_management_service.py
│ │ ├── test_user_service.py
│ │ ├── test_vectordatabase_service.py
│ │ └── test_voice_service.py
│ ├── test_cluster_summarization.py
│ ├── test_document_vector_integration.py
│ ├── test_document_vector_utils.py
│ ├── test_document_vector_utils_coverage.py
│ ├── test_llm_integration.py
│ ├── test_model_consts.py
│ ├── test_runtime_service.py
│ ├── test_summary_formatting.py
│ └── utils/
│ ├── __init__.py
│ ├── test_auth_utils.py
│ ├── test_config_utils.py
│ ├── test_file_management_utils.py
│ ├── test_langchain_utils.py
│ ├── test_llm_utils.py
│ ├── test_memory_utils.py
│ ├── test_model_name_utils.py
│ ├── test_monitoring.py
│ ├── test_prompt_template_utils.py
│ └── test_str_utils.py
├── common/
│ ├── __init__.py
│ └── test_mocks.py
├── conftest.py
├── pytest.ini
├── run_all_test.py
└── sdk/
├── __init__.py
├── container/
│ ├── __init__.py
│ ├── test_container_client_base.py
│ ├── test_container_client_factory.py
│ ├── test_docker_client.py
│ └── test_docker_config.py
├── core/
│ ├── agents/
│ │ ├── test_core_agent.py
│ │ ├── test_nexent_agent.py
│ │ └── test_run_agent.py
│ ├── models/
│ │ ├── test_embedding_model.py
│ │ ├── test_message_utils.py
│ │ ├── test_openai_llm.py
│ │ ├── test_openai_long_context_model.py
│ │ ├── test_openai_vlm.py
│ │ ├── test_stt_model.py
│ │ └── test_tts_model.py
│ ├── tools/
│ │ ├── test_analyze_image_tool.py
│ │ ├── test_analyze_text_file_tool.py
│ │ ├── test_create_directory_tool.py
│ │ ├── test_create_file_tool.py
│ │ ├── test_datamate_search_tool.py
│ │ ├── test_delete_directory_tool.py
│ │ ├── test_delete_file_tool.py
│ │ ├── test_dify_search_tool.py
│ │ ├── test_exa_search_tool.py
│ │ ├── test_get_email_tool.py
│ │ ├── test_idata_search_tool.py
│ │ ├── test_knowledge_base_search_tool.py
│ │ ├── test_send_email_tool.py
│ │ ├── test_tavily_search_tool.py
│ │ └── test_terminal_tool.py
│ └── utils/
│ ├── test_observer.py
│ └── test_prompt_template_utils.py
├── data_process/
│ ├── __init__.py
│ ├── test_core.py
│ ├── test_openpyxl_processor.py
│ └── test_unstructured_processor.py
├── datamate/
│ └── test_datamate_client.py
├── memory/
│ └── test_memory_service.py
├── monitor/
│ ├── __init__.py
│ ├── conftest.py
│ └── test_monitoring.py
├── multi_modal/
│ ├── test_load_save_object.py
│ └── test_utils.py
├── storage/
│ ├── __init__.py
│ ├── test_minio.py
│ ├── test_minio_config.py
│ └── test_storage_client_factory.py
├── utils/
│ └── test_http_client_manager.py
└── vector_database/
├── __init__.py
├── test_datamate_core.py
└── test_elasticsearch_core.py
================================================
FILE CONTENTS
================================================
================================================
FILE: .claude/skills/prompts-writing/SKILL.md
================================================
---
name: prompt-writing
description: Create, refine, and optimize high-quality YAML prompts for AI assistants. Use when working with prompt templates, system prompts, agent prompts, or any prompt engineering tasks. Provides structure guidelines, template patterns, and quality standards for YAML-based prompts.
license: Complete terms in LICENSE.txt
---
# Prompt Writing
Create and optimize YAML-based prompts for AI assistants following industry best practices.
## Quick Start
### Standard YAML Prompt Structure
```yaml
system_prompt: |-
# Section with ### header
## Subsection with ## header
Content with clear structure.
**Bold key concepts**
- Bullet points for requirements
- Consistent indentation (2 spaces)
1. Numbered lists for sequences
2. Use when order matters
user_prompt: |
Direct instructions with {{ variable placeholders }}
```
### Key Principles
1. **Structure**: Use `|-` for multi-line system prompts, `|` for user prompts
2. **Templating**: Use `{{ variable }}` for dynamic content
3. **Separators**: Use `---` sparingly, only between major sections
4. **Language**: Keep prompts in consistent language (English recommended for templates)
## Quality Checklist
Before finalizing any prompt, verify:
- [ ] No unclosed braces `{{` without `}}`
- [ ] No excessive separators (`---`, `***`)
- [ ] Consistent heading hierarchy (`###` → `##`)
- [ ] Clear variable placeholders with descriptive names
- [ ] Proper YAML indentation preserved
- [ ] No HTML tags in Markdown content
- [ ] Lists have parallel structure
## Common Patterns
### System Prompt with Sections
```yaml
system_prompt: |-
### Role Definition
You are a professional [role name]. Your task is to [core responsibility].
### Requirements
1. First requirement
2. Second requirement
3. Third requirement
### Guidelines
- Do this
- Don't do that
- Always do this
### Output Format
Respond in plain text without separators.
```
### Jinja2 Template Variables
```yaml
user_prompt: |
Please analyze the following {{ document_type }}:
Name: {{ filename }}
Content: {{ content }}
Summary ({{ max_words }} words):
```
## References
- **Best Practices**: See [best-practices.md](best-practices.md) for detailed guidelines
- **Templates**: See [templates.md](templates.md) for reusable patterns
- **Examples**: See [examples.md](examples.md) for real-world samples
## Related Tools
When working with prompts, also consider:
- YAML validation tools
- Jinja2 syntax checkers
- Markdown linters
================================================
FILE: .claude/skills/prompts-writing/examples.md
================================================
# Prompt Writing Examples
Real-world YAML prompt examples for AI assistants with explanations.
## 1. Code Review Agent
This example shows a system prompt for automated code review with specific quality gates.
```yaml
system_prompt: |-
### Role
You are a professional code review assistant. Your task is to analyze code and provide constructive feedback.
### Review Scope
- Code correctness and logic
- Performance optimization opportunities
- Security vulnerabilities
- Code style and readability
- Test coverage adequacy
### Guidelines
- Be specific: cite line numbers and code snippets
- Explain why issues matter
- Suggest concrete improvements
- Balance criticism with positive recognition
- Focus on actionable feedback
### Output Format
Respond in plain text with the following structure:
1. Summary of findings
2. Critical issues (if any)
3. Recommended improvements
4. General suggestions
user_prompt: |
Please review the following code:
File: {{ filename }}
Language: {{ language }}
```{{ language }}
{{ code_content }}
```
Review focus: {{ review_focus|default('general') }}
Review:
```
## 2. Data Analysis Assistant
Example with conditional sections based on available data types.
```yaml
system_prompt: |-
### Role
You are a professional data analyst assistant.
### Core Task
Analyze the provided data and generate actionable insights.
{%- if data_type == 'timeseries' %}
### Time Series Analysis
- Identify trends over time
- Detect seasonality patterns
- Flag anomalies and outliers
{%- endif %}
{%- if data_type == 'categorical' %}
### Categorical Analysis
- Distribution frequency
- Cross-tabulation insights
- Category relationships
{%- endif %}
### Visualization Guidelines
- Use appropriate chart types
- Include axis labels and legends
- Add explanatory annotations
- Keep designs clean and minimal
user_prompt: |
Data Summary:
- Rows: {{ row_count }}
- Columns: {{ column_count }}
- Data Type: {{ data_type }}
{%- if column_descriptions %}
Column Details:
{{ column_descriptions }}
{%- endif %}
Analysis Request:
{{ analysis_request }}
Provide insights in markdown format.
```
## 3. Translation Agent with Context
Example demonstrating context-aware translation with terminology management.
```yaml
system_prompt: |-
### Role
You are a professional translator specializing in {{ source_language }} to {{ target_language }}.
### Translation Principles
1. Accuracy: Preserve meaning faithfully
2. Fluency: Natural target language phrasing
3. Consistency: Use consistent terminology
4. Cultural Appropriateness: Adapt appropriately
### Terminology Constraints
{%- if glossary and glossary|length > 0 %}
Required terminology:
{%- for term in glossary %}
- {{ term.source }} → {{ term.target }}
{%- endfor %}
{%- else %}
Use standard terminology for the domain.
{%- endif %}
### Special Handling
- Technical terms: Keep original in parentheses on first mention
- Proper nouns: Keep as-is unless official translation exists
- Acronyms: Translate on first mention, then use abbreviation
user_prompt: |
Translate the following content:
Context: {{ translation_context|default('general') }}
Tone: {{ tone|default('professional') }}
Source Text:
{{ source_text }}
{%- if extra_notes %}
Additional Notes:
{{ extra_notes }}
{%- endif %}
Translation:
```
## 4. Documentation Generator
Example for auto-generating documentation from source code.
```yaml
system_prompt: |-
### Role
You are a technical documentation writer.
### Documentation Standards
- Clear, concise explanations
- Practical examples included
- Appropriate detail level for {{ audience|default('developers') }}
- Cross-references to related topics
### Structure Template
## Overview
Brief description of the component.
## Installation
Prerequisites and setup steps.
## Usage
Basic usage patterns with examples.
## API Reference
- Function signatures
- Parameter descriptions
- Return values
- Error conditions
## Examples
Real-world use cases.
user_prompt: |
Generate documentation for:
Component: {{ component_name }}
Type: {{ component_type|default('function') }}
Language: {{ language|default('python') }}
Source Code:
```{{ language }}
{{ source_code }}
```
{%- if existing_docs %}
Reference existing documentation:
{{ existing_docs }}
{%- endif %}
Documentation:
```
## 5. Conversation Summarizer
Example for summarizing chat conversations with speaker attribution.
```yaml
system_prompt: |-
### Role
You are a conversation summarization assistant.
### Summary Requirements
1. Capture key topics and decisions
2. Attribute statements to speakers
3. Note unresolved items
4. Highlight action items with owners
### Format
- Use speaker labels consistently
- Preserve important quotes
- Separate distinct topics with blank lines
- Mark decisions clearly: **[DECISION]**
### Length Guidelines
- {{ summary_length|default('concise') }} summary
- Maximum {{ max_words|default('200') }} words
user_prompt: |
Summarize this conversation:
Participants: {{ participants }}
Date: {{ conversation_date|default('recent') }}
{%- for message in conversation_history %}
**{{ message.speaker }}**: {{ message.content }}
{%- endfor %}
Summary:
```
## 6. Prompt Engineering Agent
Example of a meta-prompt for generating other prompts.
```yaml
system_prompt: |-
### Role
You are an expert prompt engineer. Your task is to create effective prompts for AI assistants.
### Prompt Design Principles
1. Clear Role Definition
2. Specific Task Description
3. Concrete Requirements
4. Defined Output Format
5. Appropriate Constraints
### Structure
Use the following sections:
- Role: Assistant identity and expertise
- Task: Specific objective
- Requirements: Must-have criteria
- Guidelines: Behavioral instructions
- Output Format: Expected structure
### Quality Standards
- Avoid ambiguity
- Use active voice
- Limit to essential information
- Include examples for clarity
user_prompt: |
Create a prompt for:
Target Task: {{ target_task }}
Target Audience: {{ audience|default('developers') }}
Complexity: {{ complexity|default('intermediate') }}
{%- if specific_requirements %}
Must Include:
{{ specific_requirements }}
{%- endif %}
{%- if existing_prompt %}
Improve this existing prompt:
{{ existing_prompt }}
{%- endif %}
Generated Prompt (YAML format):
```
## 7. Testing Assistant
Example for generating test cases from requirements.
```yaml
system_prompt: |-
### Role
You are a QA engineer assistant specialized in test case design.
### Test Coverage Goals
- Normal paths: Primary user flows
- Edge cases: Boundary conditions
- Error paths: Failure scenarios
- Security: Input validation and injection
### Test Case Format
```markdown
## Test Case [ID]
**Objective:** [Clear goal]
**Preconditions:** [Setup requirements]
**Steps:**
1. Step one
2. Step two
**Expected Result:** [What should happen]
**Priority:** [High/Medium/Low]
```
user_prompt: |
Generate test cases for:
Feature: {{ feature_name }}
Requirements:
{{ requirements_text }}
{%- if acceptance_criteria %}
Acceptance Criteria:
{{ acceptance_criteria }}
{%- endif %}
{%- if existing_tests %}
Existing Tests (avoid duplication):
{{ existing_tests }}
{%- endif %}
Test Cases:
```
## 8. Email Composer
Example with tone adaptation and email structure.
```yaml
system_prompt: |-
### Role
You are a professional email writer.
### Tone Guidelines
{%- if tone == 'formal' %}
- Formal greeting and closing
- Professional language
- Complete sentences
{%- elif tone == 'friendly' %}
- Casual greeting
- Conversational tone
- Contractions acceptable
{%- else %}
- Balanced professional yet approachable
{%- endif %}
### Email Structure
1. Appropriate greeting
2. Clear opening statement
3. Main content (organized, scannable)
4. Call to action (if applicable)
5. Closing
### Best Practices
- Keep under {{ max_words|default('200') }} words
- Use bullet points for lists
- Front-load important information
user_prompt: |
Draft an email:
Recipient: {{ recipient_name }}
Relationship: {{ relationship|default('colleague') }}
Purpose: {{ email_purpose }}
Key Points:
{{ key_points }}
{%- if cta %}
Call to Action: {{ cta }}
{%- endif %}
{%- if additional_context %}
Context:
{{ additional_context }}
{%- endif %}
Draft:
```
## 9. REST API Documentation
Example for documenting API endpoints.
```yaml
system_prompt: |-
### Role
You are a technical writer specializing in API documentation.
### Documentation Structure
## Endpoint
`{{ method }} {{ path }}`
## Description
{{ description }}
## Authentication
{%- if auth_type == 'bearer' %}
Bearer token required
{%- elif auth_type == 'apikey' %}
API key required in header
{%- elif auth_type == 'none' %}
No authentication required
{%- else %}
{{ auth_type }}
{%- endif %}
## Request Parameters
{%- if path_params %}
### Path Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
{%- for param in path_params %}
| {{ param.name }} | {{ param.type }} | {{ param.required|default('Yes') }} | {{ param.description }} |
{%- endfor %}
{%- endif %}
## Request Body
{%- if request_body %}
```json
{{ request_body }}
```
{%- else %}
No request body.
{%- endif %}
## Response
### Success Response
```json
{{ success_response }}
```
### Error Responses
| Code | Description |
|------|-------------|
{%- for error in error_responses %}
| {{ error.code }} | {{ error.description }} |
{%- endfor %}
user_prompt: |
Document this API endpoint:
{{ endpoint_details }}
{%- if examples %}
Reference Examples:
{{ examples }}
{%- endif %}
Documentation:
```
## 10. Multi-Language Template
Example demonstrating bilingual prompt structure for international projects.
```yaml
system_prompt: |-
### Role / 角色
You are a professional technical writer. / 你是一位专业技术作家。
### Core Task / 核心任务
{%- if language == 'zh' %}
根据提供的技术规范生成文档。
{%- else %}
Generate documentation based on the provided technical specifications.
{%- endif %}
### Requirements / 要求
1. {{ requirement_1 }}
2. {{ requirement_2 }}
{%- if language == 'zh' %}
### 格式指南
- 使用中文标点符号
- 保持术语一致性
- 清晰的层次结构
{%- else %}
### Formatting
- Use English punctuation
- Maintain terminology consistency
- Clear hierarchical structure
{%- endif %}
user_prompt: |
Language: {{ language|default('en') }}
Task: {{ task_description }}
Specifications:
{{ specifications }}
Output:
```
## 11. Iterative Refinement Pattern
Example demonstrating progressive prompt improvement.
```yaml
system_prompt: |-
### Role
You are a {{ role_name }}.
### Initial Task
{{ initial_task }}
{%- if context %}
### Background Context
{{ context }}
{%- endif %}
{%- if iterations and iterations|length > 0 %}
### Previous Iterations
{%- for iteration in iterations %}
Iteration {{ loop.index }}:
- Input: {{ iteration.input }}
- Output: {{ iteration.output }}
- Feedback: {{ iteration.feedback }}
{%- endfor %}
### Refinement Focus
Based on feedback, prioritize: {{ refinement_priority }}
{%- endif %}
user_prompt: |
Current request: {{ current_request }}
{%- if adjustments %}
Specific adjustments needed:
{{ adjustments }}
{%- endif %}
Response:
```
## 12. Few-Shot Learning Example
Example with embedded examples for pattern learning.
```yaml
system_prompt: |-
### Role
You are a sentiment analysis assistant.
### Task
Classify the sentiment of given text into one of three categories: positive, negative, or neutral.
### Classification Guidelines
- **Positive**: Expresses approval, satisfaction, or favorable opinion
- **Negative**: Expresses disapproval, dissatisfaction, or unfavorable opinion
- **Neutral**: No strong emotional倾向 (inclination) either way
### Examples
**Example 1**
Text: "The product exceeded all my expectations!"
Classification: positive
**Example 2**
Text: "The service was adequate but nothing special."
Classification: neutral
**Example 3**
Text: "Completely wasted my money. Never buying again."
Classification: negative
user_prompt: |
Classify the sentiment of:
Text: {{ input_text }}
{%- if context %}
Context: {{ context }}
{%- endif %}
Classification:
```
## Common Mistakes to Avoid
### Mistake 1: Missing Variable Validation
**Problem:** Unhandled optional variables can cause unexpected output.
```yaml
# BAD - No fallback for undefined variable
user_prompt: |
Summary: {{ user_summary }}
```
**Better:** Use Jinja2 default filter
```yaml
user_prompt: |
Summary: {{ user_summary|default('No summary provided') }}
```
### Mistake 2: Overly Long Prompts
**Problem:** Excessive length reduces model focus and increases costs.
**Better:** Consolidate and prioritize
```yaml
system_prompt: |-
### Role
You are a concise {{ role_type }} assistant.
### Core Task
{{ primary_task }}
### Top 3 Priorities
1. {{ priority_1 }}
2. {{ priority_2 }}
3. {{ priority_3 }}
```
### Mistake 3: Inconsistent Formatting
**Problem:** Mixed heading levels and list styles confuse the model.
**Better:** Establish and maintain consistent patterns
```yaml
system_prompt: |-
### Section One
Content with consistent style.
### Section Two
- Bullet point
- Another bullet
### Section Three
1. Numbered item
2. Another numbered
```
## Best Practices Summary
1. **Start with clear role definition**
2. **Use consistent heading hierarchy**
3. **Provide concrete examples (few-shot)**
4. **Handle optional variables gracefully**
5. **Limit scope to essential information**
6. **Test prompts with various inputs**
7. **Iterate based on output quality**
8. **Document prompt versions**
## Related Resources
- See [best-practices.md](best-practices.md) for detailed guidelines
- See [templates.md](templates.md) for reusable patterns
================================================
FILE: .claude/skills/prompts-writing/references/best-practices.md
================================================
# Prompt Writing Best Practices
This document provides comprehensive guidelines for creating high-quality YAML prompts.
## 1. YAML Syntax Fundamentals
### Multi-line String Handling
| Syntax | Use Case | Example |
|--------|----------|---------|
| `\|-` | System prompts (strips trailing newline) | `system_prompt: \|-` |
| `|` | User prompts (preserves newlines) | `user_prompt: \|` |
| `>` | Long single lines (rarely used) | `description: >` |
### Indentation Rules
- Use 2 spaces for indentation (no tabs)
- Nested structures under each field
- List items align at parent level
```yaml
system_prompt: |-
### Section Title
Content here.
- List item 1
Nested item (2 spaces)
- List item 2
```
## 2. Structure Guidelines
### Heading Hierarchy
Use headings to create logical sections:
```yaml
system_prompt: |-
### Primary Section (most important)
Core role and primary responsibilities.
### Secondary Section
Additional requirements.
## Less Important Section
Background context.
### Specific Guidelines
- Concrete rules
```
**Rules:**
- Never skip heading levels (e.g., `###` to `#####`)
- Maximum heading depth: `####` for most prompts
- Use `###` for major sections, `####` for subsections
### Separator Usage
Separators (`---`, `***`) create visual clutter and should be avoided:
**DO:**
```yaml
system_prompt: |-
### Requirements
1. Be concise
2. Be clear
### Output Format
Plain text response.
```
**DON'T:**
```yaml
system_prompt: |-
### Requirements
1. Be concise
2. Be clear
---
### Output Format
Plain text response.
***
Additional notes.
```
**Exception:** Use `---` only when truly separating distinct document types or sections in complex templates.
## 3. Writing Style
### Sentence Structure
**DO:**
- Use active voice: "You are a helpful assistant."
- Be direct: "Generate a summary."
- Keep sentences under 25 words.
**DON'T:**
- Passive voice: "A summary should be generated by you."
- Vague instructions: "Maybe you could try to..."
- Run-on sentences.
### Conciseness Principles
**Before (verbose):**
```
You are a document summarization assistant and your main job and responsibility is to read through the document that is provided to you and create a summary of it. You should make sure to...
```
**After (concise):**
```
You are a professional document summarization assistant. Generate a concise summary based on the provided content.
```
### List Consistency
**DO (all items parallel):**
```yaml
- Be accurate
- Be concise
- Be helpful
```
**DON'T (mixed structures):**
```yaml
- Be accurate
- Creating summaries
- You should be helpful
```
### Punctuation Rules
| Element | Rule | Example |
|---------|------|---------|
| Lists | Period only if complex sentences | `- Item one` or `- First item. Second sentence.` |
| Headings | No period at end | `### Requirements` |
| Variables | Spaces around braces | `{{ filename }}` not `{{filename}}` |
| Code blocks | Language tag required | ```python |
## 4. Variable Placeholder Standards
### Naming Conventions
Use descriptive, lowercase names with underscores:
| Good | Bad |
|------|-----|
| `{{ document_title }}` | `{{ title }}` |
| `{{ max_word_count }}` | `{{ max }}` |
| `{{ user_query }}` | `{{ q }}` |
### Variable Types
```yaml
# String variables
user_prompt: |
Analyze: {{ document_content }}
# Numeric variables with constraints
user_prompt: |
Summary ({{ max_words }} words maximum):
# Optional variables (with Jinja2 default)
{{ time|default('current time') }}
# Conditional variables
{%- if memory_list and memory_list|length > 0 %}
### Contextual Memory
...
{%- endif %}
```
## 5. Common Sections
### Role Definition
```yaml
system_prompt: |-
### Role
You are a professional [domain] assistant specialized in [specific task].
```
### Requirements
```yaml
### Requirements
1. First requirement (most important)
2. Second requirement
3. Third requirement
```
### Guidelines
```yaml
### Guidelines
- Do this (positive instruction)
- Don't do that (negative instruction)
- Always do this (mandatory)
```
### Output Format
```yaml
### Output Format
Respond in plain text without:
- Separators (---, ***)
- HTML tags
- Special formatting
```
## 6. Anti-Patterns to Avoid
### Anti-Pattern 1: Excessive Instructions
```yaml
# BAD - Too many nested rules
system_prompt: |-
You are an assistant. Your name is X. You were created by Y.
You should always be helpful. Being helpful means you should:
1. Greet the user
2. Listen carefully
3. Respond appropriately
...
```
**Better:**
```yaml
system_prompt: |-
You are a helpful assistant specialized in {{ task_type }}.
```
### Anti-Pattern 2: Vague Instructions
```yaml
# BAD - Not actionable
system_prompt: |-
You should do a good job at summarizing. Make sure it's good.
```
**Better:**
```yaml
system_prompt: |-
### Task
Generate a {{ word_count }}-word summary that captures:
- Main topic
- Key arguments
- Supporting evidence
```
### Anti-Pattern 3: Mixed Languages
```yaml
# BAD - Inconsistent language
system_prompt: |-
### Role
You are a professional assistant.
### 要求
保持简洁。
```
**Better (choose one language):**
```yaml
system_prompt: |-
### Role
You are a professional assistant.
### Requirements
Keep responses concise.
```
### Anti-Pattern 4: Unbalanced Lists
```yaml
# BAD - Missing items
- Do A
- Do B
# Better - Complete list
- Do A
- Do B
- Do C
```
## 7. Language Guidelines
### English Prompts
- Use American or British English consistently
- Prefer simple vocabulary over complex terms
- Use "you" for direct addressing
### Chinese Prompts
- Use Simplified Chinese (简体中文)
- Follow Chinese punctuation standards
- Keep technical terms in English when appropriate
### Mixed-Language Projects
When maintaining both EN and ZH versions:
```yaml
# Filename pattern: prompt_name_en.yaml
# Corresponding file: prompt_name_zh.yaml
# Key terms translation:
# - "Requirements" → "要求"
# - "Guidelines" → "指南"
# - "Output Format" → "输出格式"
```
## 8. Quality Validation Checklist
### Before Finalizing
```markdown
□ All braces are balanced ({{ }})
□ No trailing spaces at line ends
□ Consistent heading hierarchy
□ Parallel list structure
□ Proper YAML indentation (2 spaces)
□ No HTML tags in Markdown
□ Variables have descriptive names
□ Language is consistent throughout
□ No excessive separators
□ Sentence case for list items
```
### Automated Checks
Consider using:
1. YAML linter (yamllint)
2. Jinja2 syntax validator
3. Markdown formatter
## 9. Performance Considerations
### Prompt Length
- System prompts: 500-2000 tokens typical
- User prompts: 100-500 tokens typical
- Longer isn't always better—be concise
### Token Efficiency
- Avoid repetitive phrasing
- Use variables for repeated content
- Trim unnecessary sections
## 10. Version Control
### File Naming
```yaml
# Format: {purpose}_{lang}.yaml
manager_system_prompt_template_en.yaml
manager_system_prompt_template_zh.yaml
document_summary_agent_en.yaml
```
### Changelog Practices
When modifying prompts:
1. Update file in place
2. Document significant changes
3. Consider version history for major revisions
================================================
FILE: .claude/skills/prompts-writing/references/templates.md
================================================
# Prompt Templates
This document provides reusable template patterns for YAML-based prompts.
## 1. Agent System Prompt Template
```yaml
system_prompt: |-
### Basic Information
You are {{APP_NAME}}, {{APP_DESCRIPTION}}, it is {{time|default('current time')}} now
### Core Responsibilities
{{ duty }}
### Principles
Legal Compliance: Strictly adhere to all laws and regulations;
Security Protection: Do not respond to dangerous requests;
Ethical Guidelines: Refuse harmful content.
### Execution Process
1. Think: Analyze the task and plan approach
2. Code: Execute using tools/agents
3. Observe Results: Review and iterate
### Available Resources
{%- if tools and tools.values() | list %}
- Available tools:
{%- for tool in tools.values() %}
- {{ tool.name }}: {{ tool.description }}
{%- endfor %}
{%- else %}
- No tools available
{%- endif %}
### Resource Usage Requirements
{{ constraint }}
### Example Templates
{{ few_shots }}
managed_agent:
task: |-
You are '{{name}}'. Your manager has submitted this task:
---
{{task}}
---
Provide comprehensive assistance.
report: |-
{{final_answer}}
planning:
initial_plan: |-
update_plan_pre_messages: |-
update_plan_post_messages: |-
final_answer:
pre_messages: |-
post_messages: |-
```
## 2. Document Summary Agent Template
```yaml
system_prompt: |-
You are a professional document summarization assistant.
**Summary Requirements:**
1. Extract main themes and key topics
2. Generate representative summary
3. Ensure accuracy and coherence
4. Respect word limit
**Guidelines:**
- Focus on main themes
- Highlight important concepts
- Use clear, concise language
- Avoid redundancy
- **Important: No separators, plain text only**
user_prompt: |
Generate a summary for:
Document name: {{ filename }}
Content snippets:
{{ content }}
Summary (max {{ max_words }} words):
```
## 3. Cluster Summary Agent Template
```yaml
system_prompt: |-
You are a professional knowledge summarization assistant.
**Summary Requirements:**
1. Analyze multiple documents
2. Extract common themes
3. Generate collective summary
4. Respect word limit
**Guidelines:**
- Focus on shared themes
- Highlight key concepts
- Use concise language
- Avoid listing individual titles
user_prompt: |
Summarize this document cluster:
{{ cluster_content }}
Summary ({{ max_words }} words):
```
## 4. Image Analysis Template
```yaml
image_analysis:
system_prompt: |-
The user asks: {{ query }}. Describe this image concisely (200 words max).
**Requirements:**
1. Focus on question-relevant content
2. Keep descriptions clear and concise
3. Avoid irrelevant details
4. Maintain objective description
user_prompt: |
Observe and describe this image for the user's question.
```
## 5. Long Text Analysis Template
```yaml
long_text_analysis:
system_prompt: |-
The user asks: {{ query }}. Summarize this text concisely (200 words max).
**Requirements:**
1. Extract question-relevant content
2. Highlight core information
3. Preserve key viewpoints
4. Avoid redundancy
user_prompt: |
Read and analyze this text:
```
## 6. Conditional Content Template
```yaml
system_prompt: |-
### Basic Information
You are {{APP_NAME}}.
{%- if memory_list and memory_list|length > 0 %}
### Contextual Memory
{%- set level_order = ['tenant', 'user_agent', 'user', 'agent'] %}
{%- for level in level_order %}
{%- if level in memory_by_level %}
**{{ level|title }} Level Memory:**
{%- for item in memory_by_level[level] %}
- {{ item.memory }}
{%- endfor %}
{%- endif %}
{%- endfor %}
{%- endif %}
### Core Task
{{ duty }}
```
## 7. Tool-Only Agent Template
```yaml
system_prompt: |-
You have access to specific tools only.
{%- if tools and tools.values() | list %}
### Available Tools
{%- for tool in tools.values() %}
- {{ tool.name }}: {{ tool.description }}
Input: {{tool.inputs}}
Output: {{tool.output_type}}
{%- endfor %}
{%- else %}
- No tools available.
{%- endif %}
### Workflow
1. Understand the user's request
2. Select appropriate tools
3. Execute tool calls
4. Synthesize results
### Guidelines
- Call tools only when needed
- Use correct parameters
- Handle errors gracefully
user_prompt: |
Task: {{ task }}
{%- if context %}
Context:
{{ context }}
{%- endif %}
Result:
```
## 8. Memory Integration Template
```yaml
system_prompt: |-
### Role
You are {{agent_name}}.
{%- if memory_list and memory_list|length > 0 %}
### Contextual Memory
{%- set level_order = ['tenant', 'user_agent', 'user', 'agent'] %}
{%- set memory_by_level = memory_list|groupby('memory_level') %}
{%- for level in level_order %}
{%- for group_level, memories in memory_by_level %}
{%- if group_level == level %}
**{{ level|title }} Level Memory:**
{%- for item in memories %}
- {{ item.memory }} `({{ "%.2f"|format(item.score|float) }})`
{%- endfor %}
{%- endif %}
{%- endfor %}
{%- endfor %}
**Memory Usage:**
- Conflicts: Earlier items take precedence
- Integration: Weave memories naturally
{%- endif %}
### Task
{{ task }}
```
## 9. Output Format Specification Template
```yaml
system_prompt: |-
### Role
You are {{role_name}}.
### Task
{{task_description}}
### Output Requirements
1. **Markdown Format:**
- Standard Markdown syntax
- Single blank line between paragraphs
- Inline formulas: $formula$
- Block formulas: $$formula$$
2. **Reference Marks:**
- Format: `[[letter+number]]` (e.g., `[[a1]]`)
- Place after relevant sentences
- Multiple marks: `[[a1]][[b2]]`
3. **Code:**
- Use language tags: ```python
- Maintain original format
4. **Restrictions:**
- No HTML tags
- No separators
- No extra escape characters
user_prompt: |
{{ user_input }}
Response:
```
## 10. Minimal Template
For simple, focused prompts:
```yaml
system_prompt: |-
You are a {{role_type}} assistant. Your task is to {{primary_task}}.
Requirements:
1. {{requirement_1}}
2. {{requirement_2}}
Guidelines:
- {{guideline_1}}
- {{guideline_2}}
user_prompt: |
{{ input_content }}
{{ output_instruction }}:
```
## Template Variables Summary
| Variable | Type | Description | Example |
|----------|------|-------------|---------|
| `{{APP_NAME}}` | String | Application name | "Nexent" |
| `{{APP_DESCRIPTION}}` | String | App description | "An AI assistant" |
| `{{time}}` | String/datetime | Current time | "2024-01-01" |
| `{{duty}}` | String | Core responsibilities | "Summarize documents" |
| `{{constraint}}` | String | Resource constraints | "Max 500 words" |
| `{{few_shots}}` | String | Example templates | "Q:... A:..." |
| `{{filename}}` | String | Document filename | "report.pdf" |
| `{{content}}` | String | Document content | "..." |
| `{{max_words}}` | Integer | Word limit | 200 |
| `{{task}}` | String | Task description | "Analyze..." |
| `{{query}}` | String | User query | "..." |
| `{{memory_list}}` | List | Context memories | [...] |
================================================
FILE: .claude/skills/skill-creator/.openskills.json
================================================
{
"source": "anthropics/skills",
"sourceType": "git",
"repoUrl": "https://github.com/anthropics/skills",
"subpath": "skills\\skill-creator",
"installedAt": "2026-02-04T07:52:42.984Z"
}
================================================
FILE: .claude/skills/skill-creator/LICENSE.txt
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: .claude/skills/skill-creator/SKILL.md
================================================
---
name: skill-creator
description: Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
license: Complete terms in LICENSE.txt
---
# Skill Creator
This skill provides guidance for creating effective skills.
## About Skills
Skills are modular, self-contained packages that extend Claude's capabilities by providing
specialized knowledge, workflows, and tools. Think of them as "onboarding guides" for specific
domains or tasks—they transform Claude from a general-purpose agent into a specialized agent
equipped with procedural knowledge that no model can fully possess.
### What Skills Provide
1. Specialized workflows - Multi-step procedures for specific domains
2. Tool integrations - Instructions for working with specific file formats or APIs
3. Domain expertise - Company-specific knowledge, schemas, business logic
4. Bundled resources - Scripts, references, and assets for complex and repetitive tasks
## Core Principles
### Concise is Key
The context window is a public good. Skills share the context window with everything else Claude needs: system prompt, conversation history, other Skills' metadata, and the actual user request.
**Default assumption: Claude is already very smart.** Only add context Claude doesn't already have. Challenge each piece of information: "Does Claude really need this explanation?" and "Does this paragraph justify its token cost?"
Prefer concise examples over verbose explanations.
### Set Appropriate Degrees of Freedom
Match the level of specificity to the task's fragility and variability:
**High freedom (text-based instructions)**: Use when multiple approaches are valid, decisions depend on context, or heuristics guide the approach.
**Medium freedom (pseudocode or scripts with parameters)**: Use when a preferred pattern exists, some variation is acceptable, or configuration affects behavior.
**Low freedom (specific scripts, few parameters)**: Use when operations are fragile and error-prone, consistency is critical, or a specific sequence must be followed.
Think of Claude as exploring a path: a narrow bridge with cliffs needs specific guardrails (low freedom), while an open field allows many routes (high freedom).
### Anatomy of a Skill
Every skill consists of a required SKILL.md file and optional bundled resources:
```
skill-name/
├── SKILL.md (required)
│ ├── YAML frontmatter metadata (required)
│ │ ├── name: (required)
│ │ └── description: (required)
│ └── Markdown instructions (required)
└── Bundled Resources (optional)
├── scripts/ - Executable code (Python/Bash/etc.)
├── references/ - Documentation intended to be loaded into context as needed
└── assets/ - Files used in output (templates, icons, fonts, etc.)
```
#### SKILL.md (required)
Every SKILL.md consists of:
- **Frontmatter** (YAML): Contains `name` and `description` fields. These are the only fields that Claude reads to determine when the skill gets used, thus it is very important to be clear and comprehensive in describing what the skill is, and when it should be used.
- **Body** (Markdown): Instructions and guidance for using the skill. Only loaded AFTER the skill triggers (if at all).
#### Bundled Resources (optional)
##### Scripts (`scripts/`)
Executable code (Python/Bash/etc.) for tasks that require deterministic reliability or are repeatedly rewritten.
- **When to include**: When the same code is being rewritten repeatedly or deterministic reliability is needed
- **Example**: `scripts/rotate_pdf.py` for PDF rotation tasks
- **Benefits**: Token efficient, deterministic, may be executed without loading into context
- **Note**: Scripts may still need to be read by Claude for patching or environment-specific adjustments
##### References (`references/`)
Documentation and reference material intended to be loaded as needed into context to inform Claude's process and thinking.
- **When to include**: For documentation that Claude should reference while working
- **Examples**: `references/finance.md` for financial schemas, `references/mnda.md` for company NDA template, `references/policies.md` for company policies, `references/api_docs.md` for API specifications
- **Use cases**: Database schemas, API documentation, domain knowledge, company policies, detailed workflow guides
- **Benefits**: Keeps SKILL.md lean, loaded only when Claude determines it's needed
- **Best practice**: If files are large (>10k words), include grep search patterns in SKILL.md
- **Avoid duplication**: Information should live in either SKILL.md or references files, not both. Prefer references files for detailed information unless it's truly core to the skill—this keeps SKILL.md lean while making information discoverable without hogging the context window. Keep only essential procedural instructions and workflow guidance in SKILL.md; move detailed reference material, schemas, and examples to references files.
##### Assets (`assets/`)
Files not intended to be loaded into context, but rather used within the output Claude produces.
- **When to include**: When the skill needs files that will be used in the final output
- **Examples**: `assets/logo.png` for brand assets, `assets/slides.pptx` for PowerPoint templates, `assets/frontend-template/` for HTML/React boilerplate, `assets/font.ttf` for typography
- **Use cases**: Templates, images, icons, boilerplate code, fonts, sample documents that get copied or modified
- **Benefits**: Separates output resources from documentation, enables Claude to use files without loading them into context
#### What to Not Include in a Skill
A skill should only contain essential files that directly support its functionality. Do NOT create extraneous documentation or auxiliary files, including:
- README.md
- INSTALLATION_GUIDE.md
- QUICK_REFERENCE.md
- CHANGELOG.md
- etc.
The skill should only contain the information needed for an AI agent to do the job at hand. It should not contain auxilary context about the process that went into creating it, setup and testing procedures, user-facing documentation, etc. Creating additional documentation files just adds clutter and confusion.
### Progressive Disclosure Design Principle
Skills use a three-level loading system to manage context efficiently:
1. **Metadata (name + description)** - Always in context (~100 words)
2. **SKILL.md body** - When skill triggers (<5k words)
3. **Bundled resources** - As needed by Claude (Unlimited because scripts can be executed without reading into context window)
#### Progressive Disclosure Patterns
Keep SKILL.md body to the essentials and under 500 lines to minimize context bloat. Split content into separate files when approaching this limit. When splitting out content into other files, it is very important to reference them from SKILL.md and describe clearly when to read them, to ensure the reader of the skill knows they exist and when to use them.
**Key principle:** When a skill supports multiple variations, frameworks, or options, keep only the core workflow and selection guidance in SKILL.md. Move variant-specific details (patterns, examples, configuration) into separate reference files.
**Pattern 1: High-level guide with references**
```markdown
# PDF Processing
## Quick start
Extract text with pdfplumber:
[code example]
## Advanced features
- **Form filling**: See [FORMS.md](FORMS.md) for complete guide
- **API reference**: See [REFERENCE.md](REFERENCE.md) for all methods
- **Examples**: See [EXAMPLES.md](EXAMPLES.md) for common patterns
```
Claude loads FORMS.md, REFERENCE.md, or EXAMPLES.md only when needed.
**Pattern 2: Domain-specific organization**
For Skills with multiple domains, organize content by domain to avoid loading irrelevant context:
```
bigquery-skill/
├── SKILL.md (overview and navigation)
└── reference/
├── finance.md (revenue, billing metrics)
├── sales.md (opportunities, pipeline)
├── product.md (API usage, features)
└── marketing.md (campaigns, attribution)
```
When a user asks about sales metrics, Claude only reads sales.md.
Similarly, for skills supporting multiple frameworks or variants, organize by variant:
```
cloud-deploy/
├── SKILL.md (workflow + provider selection)
└── references/
├── aws.md (AWS deployment patterns)
├── gcp.md (GCP deployment patterns)
└── azure.md (Azure deployment patterns)
```
When the user chooses AWS, Claude only reads aws.md.
**Pattern 3: Conditional details**
Show basic content, link to advanced content:
```markdown
# DOCX Processing
## Creating documents
Use docx-js for new documents. See [DOCX-JS.md](DOCX-JS.md).
## Editing documents
For simple edits, modify the XML directly.
**For tracked changes**: See [REDLINING.md](REDLINING.md)
**For OOXML details**: See [OOXML.md](OOXML.md)
```
Claude reads REDLINING.md or OOXML.md only when the user needs those features.
**Important guidelines:**
- **Avoid deeply nested references** - Keep references one level deep from SKILL.md. All reference files should link directly from SKILL.md.
- **Structure longer reference files** - For files longer than 100 lines, include a table of contents at the top so Claude can see the full scope when previewing.
## Skill Creation Process
Skill creation involves these steps:
1. Understand the skill with concrete examples
2. Plan reusable skill contents (scripts, references, assets)
3. Initialize the skill (run init_skill.py)
4. Edit the skill (implement resources and write SKILL.md)
5. Package the skill (run package_skill.py)
6. Iterate based on real usage
Follow these steps in order, skipping only if there is a clear reason why they are not applicable.
### Step 1: Understanding the Skill with Concrete Examples
Skip this step only when the skill's usage patterns are already clearly understood. It remains valuable even when working with an existing skill.
To create an effective skill, clearly understand concrete examples of how the skill will be used. This understanding can come from either direct user examples or generated examples that are validated with user feedback.
For example, when building an image-editor skill, relevant questions include:
- "What functionality should the image-editor skill support? Editing, rotating, anything else?"
- "Can you give some examples of how this skill would be used?"
- "I can imagine users asking for things like 'Remove the red-eye from this image' or 'Rotate this image'. Are there other ways you imagine this skill being used?"
- "What would a user say that should trigger this skill?"
To avoid overwhelming users, avoid asking too many questions in a single message. Start with the most important questions and follow up as needed for better effectiveness.
Conclude this step when there is a clear sense of the functionality the skill should support.
### Step 2: Planning the Reusable Skill Contents
To turn concrete examples into an effective skill, analyze each example by:
1. Considering how to execute on the example from scratch
2. Identifying what scripts, references, and assets would be helpful when executing these workflows repeatedly
Example: When building a `pdf-editor` skill to handle queries like "Help me rotate this PDF," the analysis shows:
1. Rotating a PDF requires re-writing the same code each time
2. A `scripts/rotate_pdf.py` script would be helpful to store in the skill
Example: When designing a `frontend-webapp-builder` skill for queries like "Build me a todo app" or "Build me a dashboard to track my steps," the analysis shows:
1. Writing a frontend webapp requires the same boilerplate HTML/React each time
2. An `assets/hello-world/` template containing the boilerplate HTML/React project files would be helpful to store in the skill
Example: When building a `big-query` skill to handle queries like "How many users have logged in today?" the analysis shows:
1. Querying BigQuery requires re-discovering the table schemas and relationships each time
2. A `references/schema.md` file documenting the table schemas would be helpful to store in the skill
To establish the skill's contents, analyze each concrete example to create a list of the reusable resources to include: scripts, references, and assets.
### Step 3: Initializing the Skill
At this point, it is time to actually create the skill.
Skip this step only if the skill being developed already exists, and iteration or packaging is needed. In this case, continue to the next step.
When creating a new skill from scratch, always run the `init_skill.py` script. The script conveniently generates a new template skill directory that automatically includes everything a skill requires, making the skill creation process much more efficient and reliable.
Usage:
```bash
scripts/init_skill.py <skill-name> --path <output-directory>
```
The script:
- Creates the skill directory at the specified path
- Generates a SKILL.md template with proper frontmatter and TODO placeholders
- Creates example resource directories: `scripts/`, `references/`, and `assets/`
- Adds example files in each directory that can be customized or deleted
After initialization, customize or remove the generated SKILL.md and example files as needed.
### Step 4: Edit the Skill
When editing the (newly-generated or existing) skill, remember that the skill is being created for another instance of Claude to use. Include information that would be beneficial and non-obvious to Claude. Consider what procedural knowledge, domain-specific details, or reusable assets would help another Claude instance execute these tasks more effectively.
#### Learn Proven Design Patterns
Consult these helpful guides based on your skill's needs:
- **Multi-step processes**: See references/workflows.md for sequential workflows and conditional logic
- **Specific output formats or quality standards**: See references/output-patterns.md for template and example patterns
These files contain established best practices for effective skill design.
#### Start with Reusable Skill Contents
To begin implementation, start with the reusable resources identified above: `scripts/`, `references/`, and `assets/` files. Note that this step may require user input. For example, when implementing a `brand-guidelines` skill, the user may need to provide brand assets or templates to store in `assets/`, or documentation to store in `references/`.
Added scripts must be tested by actually running them to ensure there are no bugs and that the output matches what is expected. If there are many similar scripts, only a representative sample needs to be tested to ensure confidence that they all work while balancing time to completion.
Any example files and directories not needed for the skill should be deleted. The initialization script creates example files in `scripts/`, `references/`, and `assets/` to demonstrate structure, but most skills won't need all of them.
#### Update SKILL.md
**Writing Guidelines:** Always use imperative/infinitive form.
##### Frontmatter
Write the YAML frontmatter with `name` and `description`:
- `name`: The skill name
- `description`: This is the primary triggering mechanism for your skill, and helps Claude understand when to use the skill.
- Include both what the Skill does and specific triggers/contexts for when to use it.
- Include all "when to use" information here - Not in the body. The body is only loaded after triggering, so "When to Use This Skill" sections in the body are not helpful to Claude.
- Example description for a `docx` skill: "Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. Use when Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks"
Do not include any other fields in YAML frontmatter.
##### Body
Write instructions for using the skill and its bundled resources.
### Step 5: Packaging a Skill
Once development of the skill is complete, it must be packaged into a distributable .skill file that gets shared with the user. The packaging process automatically validates the skill first to ensure it meets all requirements:
```bash
scripts/package_skill.py <path/to/skill-folder>
```
Optional output directory specification:
```bash
scripts/package_skill.py <path/to/skill-folder> ./dist
```
The packaging script will:
1. **Validate** the skill automatically, checking:
- YAML frontmatter format and required fields
- Skill naming conventions and directory structure
- Description completeness and quality
- File organization and resource references
2. **Package** the skill if validation passes, creating a .skill file named after the skill (e.g., `my-skill.skill`) that includes all files and maintains the proper directory structure for distribution. The .skill file is a zip file with a .skill extension.
If validation fails, the script will report the errors and exit without creating a package. Fix any validation errors and run the packaging command again.
### Step 6: Iterate
After testing the skill, users may request improvements. Often this happens right after using the skill, with fresh context of how the skill performed.
**Iteration workflow:**
1. Use the skill on real tasks
2. Notice struggles or inefficiencies
3. Identify how SKILL.md or bundled resources should be updated
4. Implement changes and test again
================================================
FILE: .claude/skills/skill-creator/references/output-patterns.md
================================================
# Output Patterns
Use these patterns when skills need to produce consistent, high-quality output.
## Template Pattern
Provide templates for output format. Match the level of strictness to your needs.
**For strict requirements (like API responses or data formats):**
```markdown
## Report structure
ALWAYS use this exact template structure:
# [Analysis Title]
## Executive summary
[One-paragraph overview of key findings]
## Key findings
- Finding 1 with supporting data
- Finding 2 with supporting data
- Finding 3 with supporting data
## Recommendations
1. Specific actionable recommendation
2. Specific actionable recommendation
```
**For flexible guidance (when adaptation is useful):**
```markdown
## Report structure
Here is a sensible default format, but use your best judgment:
# [Analysis Title]
## Executive summary
[Overview]
## Key findings
[Adapt sections based on what you discover]
## Recommendations
[Tailor to the specific context]
Adjust sections as needed for the specific analysis type.
```
## Examples Pattern
For skills where output quality depends on seeing examples, provide input/output pairs:
```markdown
## Commit message format
Generate commit messages following these examples:
**Example 1:**
Input: Added user authentication with JWT tokens
Output:
```
feat(auth): implement JWT-based authentication
Add login endpoint and token validation middleware
```
**Example 2:**
Input: Fixed bug where dates displayed incorrectly in reports
Output:
```
fix(reports): correct date formatting in timezone conversion
Use UTC timestamps consistently across report generation
```
Follow this style: type(scope): brief description, then detailed explanation.
```
Examples help Claude understand the desired style and level of detail more clearly than descriptions alone.
================================================
FILE: .claude/skills/skill-creator/references/workflows.md
================================================
# Workflow Patterns
## Sequential Workflows
For complex tasks, break operations into clear, sequential steps. It is often helpful to give Claude an overview of the process towards the beginning of SKILL.md:
```markdown
Filling a PDF form involves these steps:
1. Analyze the form (run analyze_form.py)
2. Create field mapping (edit fields.json)
3. Validate mapping (run validate_fields.py)
4. Fill the form (run fill_form.py)
5. Verify output (run verify_output.py)
```
## Conditional Workflows
For tasks with branching logic, guide Claude through decision points:
```markdown
1. Determine the modification type:
**Creating new content?** → Follow "Creation workflow" below
**Editing existing content?** → Follow "Editing workflow" below
2. Creation workflow: [steps]
3. Editing workflow: [steps]
```
================================================
FILE: .claude/skills/skill-creator/scripts/init_skill.py
================================================
#!/usr/bin/env python3
"""
Skill Initializer - Creates a new skill from template
Usage:
init_skill.py <skill-name> --path <path>
Examples:
init_skill.py my-new-skill --path skills/public
init_skill.py my-api-helper --path skills/private
init_skill.py custom-skill --path /custom/location
"""
import sys
from pathlib import Path
SKILL_TEMPLATE = """---
name: {skill_name}
description: [TODO: Complete and informative explanation of what the skill does and when to use it. Include WHEN to use this skill - specific scenarios, file types, or tasks that trigger it.]
---
# {skill_title}
## Overview
[TODO: 1-2 sentences explaining what this skill enables]
## Structuring This Skill
[TODO: Choose the structure that best fits this skill's purpose. Common patterns:
**1. Workflow-Based** (best for sequential processes)
- Works well when there are clear step-by-step procedures
- Example: DOCX skill with "Workflow Decision Tree" → "Reading" → "Creating" → "Editing"
- Structure: ## Overview → ## Workflow Decision Tree → ## Step 1 → ## Step 2...
**2. Task-Based** (best for tool collections)
- Works well when the skill offers different operations/capabilities
- Example: PDF skill with "Quick Start" → "Merge PDFs" → "Split PDFs" → "Extract Text"
- Structure: ## Overview → ## Quick Start → ## Task Category 1 → ## Task Category 2...
**3. Reference/Guidelines** (best for standards or specifications)
- Works well for brand guidelines, coding standards, or requirements
- Example: Brand styling with "Brand Guidelines" → "Colors" → "Typography" → "Features"
- Structure: ## Overview → ## Guidelines → ## Specifications → ## Usage...
**4. Capabilities-Based** (best for integrated systems)
- Works well when the skill provides multiple interrelated features
- Example: Product Management with "Core Capabilities" → numbered capability list
- Structure: ## Overview → ## Core Capabilities → ### 1. Feature → ### 2. Feature...
Patterns can be mixed and matched as needed. Most skills combine patterns (e.g., start with task-based, add workflow for complex operations).
Delete this entire "Structuring This Skill" section when done - it's just guidance.]
## [TODO: Replace with the first main section based on chosen structure]
[TODO: Add content here. See examples in existing skills:
- Code samples for technical skills
- Decision trees for complex workflows
- Concrete examples with realistic user requests
- References to scripts/templates/references as needed]
## Resources
This skill includes example resource directories that demonstrate how to organize different types of bundled resources:
### scripts/
Executable code (Python/Bash/etc.) that can be run directly to perform specific operations.
**Examples from other skills:**
- PDF skill: `fill_fillable_fields.py`, `extract_form_field_info.py` - utilities for PDF manipulation
- DOCX skill: `document.py`, `utilities.py` - Python modules for document processing
**Appropriate for:** Python scripts, shell scripts, or any executable code that performs automation, data processing, or specific operations.
**Note:** Scripts may be executed without loading into context, but can still be read by Claude for patching or environment adjustments.
### references/
Documentation and reference material intended to be loaded into context to inform Claude's process and thinking.
**Examples from other skills:**
- Product management: `communication.md`, `context_building.md` - detailed workflow guides
- BigQuery: API reference documentation and query examples
- Finance: Schema documentation, company policies
**Appropriate for:** In-depth documentation, API references, database schemas, comprehensive guides, or any detailed information that Claude should reference while working.
### assets/
Files not intended to be loaded into context, but rather used within the output Claude produces.
**Examples from other skills:**
- Brand styling: PowerPoint template files (.pptx), logo files
- Frontend builder: HTML/React boilerplate project directories
- Typography: Font files (.ttf, .woff2)
**Appropriate for:** Templates, boilerplate code, document templates, images, icons, fonts, or any files meant to be copied or used in the final output.
---
**Any unneeded directories can be deleted.** Not every skill requires all three types of resources.
"""
EXAMPLE_SCRIPT = '''#!/usr/bin/env python3
"""
Example helper script for {skill_name}
This is a placeholder script that can be executed directly.
Replace with actual implementation or delete if not needed.
Example real scripts from other skills:
- pdf/scripts/fill_fillable_fields.py - Fills PDF form fields
- pdf/scripts/convert_pdf_to_images.py - Converts PDF pages to images
"""
def main():
print("This is an example script for {skill_name}")
# TODO: Add actual script logic here
# This could be data processing, file conversion, API calls, etc.
if __name__ == "__main__":
main()
'''
EXAMPLE_REFERENCE = """# Reference Documentation for {skill_title}
This is a placeholder for detailed reference documentation.
Replace with actual reference content or delete if not needed.
Example real reference docs from other skills:
- product-management/references/communication.md - Comprehensive guide for status updates
- product-management/references/context_building.md - Deep-dive on gathering context
- bigquery/references/ - API references and query examples
## When Reference Docs Are Useful
Reference docs are ideal for:
- Comprehensive API documentation
- Detailed workflow guides
- Complex multi-step processes
- Information too lengthy for main SKILL.md
- Content that's only needed for specific use cases
## Structure Suggestions
### API Reference Example
- Overview
- Authentication
- Endpoints with examples
- Error codes
- Rate limits
### Workflow Guide Example
- Prerequisites
- Step-by-step instructions
- Common patterns
- Troubleshooting
- Best practices
"""
EXAMPLE_ASSET = """# Example Asset File
This placeholder represents where asset files would be stored.
Replace with actual asset files (templates, images, fonts, etc.) or delete if not needed.
Asset files are NOT intended to be loaded into context, but rather used within
the output Claude produces.
Example asset files from other skills:
- Brand guidelines: logo.png, slides_template.pptx
- Frontend builder: hello-world/ directory with HTML/React boilerplate
- Typography: custom-font.ttf, font-family.woff2
- Data: sample_data.csv, test_dataset.json
## Common Asset Types
- Templates: .pptx, .docx, boilerplate directories
- Images: .png, .jpg, .svg, .gif
- Fonts: .ttf, .otf, .woff, .woff2
- Boilerplate code: Project directories, starter files
- Icons: .ico, .svg
- Data files: .csv, .json, .xml, .yaml
Note: This is a text placeholder. Actual assets can be any file type.
"""
def title_case_skill_name(skill_name):
"""Convert hyphenated skill name to Title Case for display."""
return ' '.join(word.capitalize() for word in skill_name.split('-'))
def init_skill(skill_name, path):
"""
Initialize a new skill directory with template SKILL.md.
Args:
skill_name: Name of the skill
path: Path where the skill directory should be created
Returns:
Path to created skill directory, or None if error
"""
# Determine skill directory path
skill_dir = Path(path).resolve() / skill_name
# Check if directory already exists
if skill_dir.exists():
print(f"❌ Error: Skill directory already exists: {skill_dir}")
return None
# Create skill directory
try:
skill_dir.mkdir(parents=True, exist_ok=False)
print(f"✅ Created skill directory: {skill_dir}")
except Exception as e:
print(f"❌ Error creating directory: {e}")
return None
# Create SKILL.md from template
skill_title = title_case_skill_name(skill_name)
skill_content = SKILL_TEMPLATE.format(
skill_name=skill_name,
skill_title=skill_title
)
skill_md_path = skill_dir / 'SKILL.md'
try:
skill_md_path.write_text(skill_content)
print("✅ Created SKILL.md")
except Exception as e:
print(f"❌ Error creating SKILL.md: {e}")
return None
# Create resource directories with example files
try:
# Create scripts/ directory with example script
scripts_dir = skill_dir / 'scripts'
scripts_dir.mkdir(exist_ok=True)
example_script = scripts_dir / 'example.py'
example_script.write_text(EXAMPLE_SCRIPT.format(skill_name=skill_name))
example_script.chmod(0o755)
print("✅ Created scripts/example.py")
# Create references/ directory with example reference doc
references_dir = skill_dir / 'references'
references_dir.mkdir(exist_ok=True)
example_reference = references_dir / 'api_reference.md'
example_reference.write_text(EXAMPLE_REFERENCE.format(skill_title=skill_title))
print("✅ Created references/api_reference.md")
# Create assets/ directory with example asset placeholder
assets_dir = skill_dir / 'assets'
assets_dir.mkdir(exist_ok=True)
example_asset = assets_dir / 'example_asset.txt'
example_asset.write_text(EXAMPLE_ASSET)
print("✅ Created assets/example_asset.txt")
except Exception as e:
print(f"❌ Error creating resource directories: {e}")
return None
# Print next steps
print(f"\n✅ Skill '{skill_name}' initialized successfully at {skill_dir}")
print("\nNext steps:")
print("1. Edit SKILL.md to complete the TODO items and update the description")
print("2. Customize or delete the example files in scripts/, references/, and assets/")
print("3. Run the validator when ready to check the skill structure")
return skill_dir
def main():
if len(sys.argv) < 4 or sys.argv[2] != '--path':
print("Usage: init_skill.py <skill-name> --path <path>")
print("\nSkill name requirements:")
print(" - Hyphen-case identifier (e.g., 'data-analyzer')")
print(" - Lowercase letters, digits, and hyphens only")
print(" - Max 40 characters")
print(" - Must match directory name exactly")
print("\nExamples:")
print(" init_skill.py my-new-skill --path skills/public")
print(" init_skill.py my-api-helper --path skills/private")
print(" init_skill.py custom-skill --path /custom/location")
sys.exit(1)
skill_name = sys.argv[1]
path = sys.argv[3]
print(f"🚀 Initializing skill: {skill_name}")
print(f" Location: {path}")
print()
result = init_skill(skill_name, path)
if result:
sys.exit(0)
else:
sys.exit(1)
if __name__ == "__main__":
main()
================================================
FILE: .claude/skills/skill-creator/scripts/package_skill.py
================================================
#!/usr/bin/env python3
"""
Skill Packager - Creates a distributable .skill file of a skill folder
Usage:
python utils/package_skill.py <path/to/skill-folder> [output-directory]
Example:
python utils/package_skill.py skills/public/my-skill
python utils/package_skill.py skills/public/my-skill ./dist
"""
import sys
import zipfile
from pathlib import Path
from quick_validate import validate_skill
def package_skill(skill_path, output_dir=None):
"""
Package a skill folder into a .skill file.
Args:
skill_path: Path to the skill folder
output_dir: Optional output directory for the .skill file (defaults to current directory)
Returns:
Path to the created .skill file, or None if error
"""
skill_path = Path(skill_path).resolve()
# Validate skill folder exists
if not skill_path.exists():
print(f"❌ Error: Skill folder not found: {skill_path}")
return None
if not skill_path.is_dir():
print(f"❌ Error: Path is not a directory: {skill_path}")
return None
# Validate SKILL.md exists
skill_md = skill_path / "SKILL.md"
if not skill_md.exists():
print(f"❌ Error: SKILL.md not found in {skill_path}")
return None
# Run validation before packaging
print("🔍 Validating skill...")
valid, message = validate_skill(skill_path)
if not valid:
print(f"❌ Validation failed: {message}")
print(" Please fix the validation errors before packaging.")
return None
print(f"✅ {message}\n")
# Determine output location
skill_name = skill_path.name
if output_dir:
output_path = Path(output_dir).resolve()
output_path.mkdir(parents=True, exist_ok=True)
else:
output_path = Path.cwd()
skill_filename = output_path / f"{skill_name}.skill"
# Create the .skill file (zip format)
try:
with zipfile.ZipFile(skill_filename, 'w', zipfile.ZIP_DEFLATED) as zipf:
# Walk through the skill directory
for file_path in skill_path.rglob('*'):
if file_path.is_file():
# Calculate the relative path within the zip
arcname = file_path.relative_to(skill_path.parent)
zipf.write(file_path, arcname)
print(f" Added: {arcname}")
print(f"\n✅ Successfully packaged skill to: {skill_filename}")
return skill_filename
except Exception as e:
print(f"❌ Error creating .skill file: {e}")
return None
def main():
if len(sys.argv) < 2:
print("Usage: python utils/package_skill.py <path/to/skill-folder> [output-directory]")
print("\nExample:")
print(" python utils/package_skill.py skills/public/my-skill")
print(" python utils/package_skill.py skills/public/my-skill ./dist")
sys.exit(1)
skill_path = sys.argv[1]
output_dir = sys.argv[2] if len(sys.argv) > 2 else None
print(f"📦 Packaging skill: {skill_path}")
if output_dir:
print(f" Output directory: {output_dir}")
print()
result = package_skill(skill_path, output_dir)
if result:
sys.exit(0)
else:
sys.exit(1)
if __name__ == "__main__":
main()
================================================
FILE: .claude/skills/skill-creator/scripts/quick_validate.py
================================================
#!/usr/bin/env python3
"""
Quick validation script for skills - minimal version
"""
import sys
import os
import re
import yaml
from pathlib import Path
def validate_skill(skill_path):
"""Basic validation of a skill"""
skill_path = Path(skill_path)
# Check SKILL.md exists
skill_md = skill_path / 'SKILL.md'
if not skill_md.exists():
return False, "SKILL.md not found"
# Read and validate frontmatter
content = skill_md.read_text()
if not content.startswith('---'):
return False, "No YAML frontmatter found"
# Extract frontmatter
match = re.match(r'^---\n(.*?)\n---', content, re.DOTALL)
if not match:
return False, "Invalid frontmatter format"
frontmatter_text = match.group(1)
# Parse YAML frontmatter
try:
frontmatter = yaml.safe_load(frontmatter_text)
if not isinstance(frontmatter, dict):
return False, "Frontmatter must be a YAML dictionary"
except yaml.YAMLError as e:
return False, f"Invalid YAML in frontmatter: {e}"
# Define allowed properties
ALLOWED_PROPERTIES = {'name', 'description', 'license', 'allowed-tools', 'metadata'}
# Check for unexpected properties (excluding nested keys under metadata)
unexpected_keys = set(frontmatter.keys()) - ALLOWED_PROPERTIES
if unexpected_keys:
return False, (
f"Unexpected key(s) in SKILL.md frontmatter: {', '.join(sorted(unexpected_keys))}. "
f"Allowed properties are: {', '.join(sorted(ALLOWED_PROPERTIES))}"
)
# Check required fields
if 'name' not in frontmatter:
return False, "Missing 'name' in frontmatter"
if 'description' not in frontmatter:
return False, "Missing 'description' in frontmatter"
# Extract name for validation
name = frontmatter.get('name', '')
if not isinstance(name, str):
return False, f"Name must be a string, got {type(name).__name__}"
name = name.strip()
if name:
# Check naming convention (hyphen-case: lowercase with hyphens)
if not re.match(r'^[a-z0-9-]+$', name):
return False, f"Name '{name}' should be hyphen-case (lowercase letters, digits, and hyphens only)"
if name.startswith('-') or name.endswith('-') or '--' in name:
return False, f"Name '{name}' cannot start/end with hyphen or contain consecutive hyphens"
# Check name length (max 64 characters per spec)
if len(name) > 64:
return False, f"Name is too long ({len(name)} characters). Maximum is 64 characters."
# Extract and validate description
description = frontmatter.get('description', '')
if not isinstance(description, str):
return False, f"Description must be a string, got {type(description).__name__}"
description = description.strip()
if description:
# Check for angle brackets
if '<' in description or '>' in description:
return False, "Description cannot contain angle brackets (< or >)"
# Check description length (max 1024 characters per spec)
if len(description) > 1024:
return False, f"Description is too long ({len(description)} characters). Maximum is 1024 characters."
return True, "Skill is valid!"
if __name__ == "__main__":
if len(sys.argv) != 2:
print("Usage: python quick_validate.py <skill_directory>")
sys.exit(1)
valid, message = validate_skill(sys.argv[1])
print(message)
sys.exit(0 if valid else 1)
================================================
FILE: .cursor/rules/backend/app_layer_rules.mdc
================================================
---
globs: backend/apps/**/*.py
description: App layer (API) contract for FastAPI endpoints in backend/apps. Parse/validate input, call services, map domain errors to HTTP, return JSONResponse on success.
---
### Purpose and Scope
- The App layer is the HTTP boundary for the backend. It applies to files under `backend/apps/*.py`.
- Responsibilities:
- Parse and validate HTTP inputs.
- Call underlying services; do not implement core business logic here.
- Translate domain/service exceptions into `HTTPException` with proper status codes.
- Return `JSONResponse(status_code=HTTPStatus.OK, content=payload)` on success.
- Configuration: Do not access environment variables directly. Read configuration via `consts.const` or pass values through from the request to services.
References: [backend/consts/exceptions.py](mdc:backend/consts/exceptions.py)
### Routing and URL Design
- Keep existing top-level prefixes for compatibility (e.g., `"/agent"`, `"/memory"`). When adding new modules or endpoints, follow these rules:
- Use plural nouns for collection-style resources (e.g., `"/agents"`, `"/memories"`).
- Use snake_case for all path segments. Avoid hyphens and camelCase.
- Prefer resource-oriented paths for CRUD-style operations. Example: `"/agents"` (collection), `"/agents/{agent_id}"` (single resource).
- Use action-style paths only when necessary to match current patterns or when the operation is not naturally CRUD (e.g., `"/agent/run"`, `"/agent/stop/{conversation_id}"`).
- Path parameters must be singular, semantic nouns: `"/agents/{agent_id}"`, `"/memories/{memory_id}"`.
- Keep backwards compatibility: do not rename existing routes; new routes should follow these conventions.
### HTTP Methods
- GET: Read and list operations only. Maintain existing special cases where GET performs safe actions (e.g., `GET /agent/stop/{conversation_id}`), but do not introduce new side-effecting GETs.
- POST: Create resources, perform searches, or trigger actions with side effects (e.g., `POST /memory/add`, `POST /memory/search`, `POST /agent/run`).
- DELETE: Delete resources or clear collections (e.g., `DELETE /memory/clear`). Ensure idempotency.
- PUT/PATCH: Update resources. Prefer `PUT` for full updates and `PATCH` for partial updates. Preserve legacy `POST /update` endpoints for compatibility but favor PUT/PATCH for new code.
### Authorization and Identity
- Retrieve the bearer token via header injection: `authorization: Optional[str] = Header(None)`.
- Use utility helpers to parse identity (prefer functions in `utils.auth_utils`, such as `get_current_user_id` or `get_current_user_info`) and pass `user_id` and/or `tenant_id` down to services. The App layer should not implement token parsing logic itself.
### Request Validation
- Prefer Pydantic models in `consts.model` as request bodies for complex payloads (e.g., `AgentRequest`).
- For simple atomic fields, use `Body(..., embed=True)` to pin the JSON key name.
- Use `Query(...)` for filters and pagination, `Path(...)` for path parameters, and `Header(...)` for headers.
- Pagination recommendations for listing endpoints: `page: int = Query(1, ge=1)`, `page_size: int = Query(20, ge=1, le=100)`, plus optional `order_by`, `filters` as appropriate. Return pagination metadata (`items`, `total`) or match existing return shapes in the codebase.
### Responses
- On success, return `JSONResponse(status_code=HTTPStatus.OK, content=payload)`.
- If a standard response model exists in the project (e.g., conversation responses), continue to use it for consistency.
- For new endpoints, return a structured content dictionary with necessary fields (e.g., `{"data": ..., "message": "OK"}`) while staying consistent with existing patterns.
### Exception Mapping
- Catch domain/service exceptions from `backend/consts/exceptions.py` and map to `HTTPException` with appropriate status codes. Examples:
- `UnauthorizedError` → 401 UNAUTHORIZED
- `LimitExceededError` → 429 TOO_MANY_REQUESTS
- Parameter/validation errors (e.g., invalid enum, unknown config key) → 400 BAD_REQUEST or 406 NOT_ACCEPTABLE (follow existing precedent such as `set_single_config` using 406)
- Unexpected errors → 500 INTERNAL_SERVER_ERROR (log the error; do not leak internal details)
### Logging and Observability
- Use a module-level logger: `logger = logging.getLogger("<module_name>")`.
- Log key events and errors. For listing/search endpoints, optionally log query scope and timing while avoiding sensitive data.
### Async/Sync Conventions
- Match the existing style in each module. Keep `async def` where already used.
- When calling async services, prefer direct `await`. When calling sync services, invoke them directly without creating new event loops.
### Backward Compatibility
- Do not break existing routes, payload shapes, or response structures.
- New endpoints should follow these conventions strictly to converge the API style across modules.
### Correct Example (parse input, call service, map exceptions, return JSONResponse)
```python
from http import HTTPStatus
import logging
from fastapi import APIRouter, HTTPException
from starlette.responses import JSONResponse
from consts.exceptions import LimitExceededError, AgentRunException, MemoryPreparationException
from services.agent_service import run_agent
logger = logging.getLogger(__name__)
router = APIRouter()
@router.post("/agent/run")
def run_agent_endpoint(payload: dict):
try:
result = run_agent(payload)
return JSONResponse(status_code=HTTPStatus.OK, content=result)
except LimitExceededError as exc:
raise HTTPException(status_code=HTTPStatus.TOO_MANY_REQUESTS, detail=str(exc))
except MemoryPreparationException as exc:
raise HTTPException(status_code=HTTPStatus.BAD_REQUEST, detail=str(exc))
except AgentRunException as exc:
raise HTTPException(status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail=str(exc))
```
### Incorrect Example (business logic in App layer or non-HTTP error handling)
```python
from starlette.responses import JSONResponse
def run_agent_endpoint(payload: dict):
# WRONG: performing core business logic inside the app layer
if payload.get("force"):
return {"status": "forced"} # WRONG: returns plain dict without HTTP status context
# WRONG: not translating domain errors to HTTP
result = risky_logic(payload)
return JSONResponse(result)
```
================================================
FILE: .cursor/rules/backend/database_layer_rules.mdc
================================================
---
globs: backend/database/**/*.py
description: Database layer standards for models, CRUD, transactions, and exceptions
---
# Database Layer Standards
Scope: all Python under `backend/database/**/*.py`. Concise standards for models, CRUD, transactions, and exceptions.
- Models: define in [backend/database/db_models.py](mdc:backend/database/db_models.py).
- Sessions: use `get_db_session()` from [backend/database/client.py](mdc:backend/database/client.py).
- Exceptions: share a DB exception type in [backend/consts/exceptions.py](mdc:backend/consts/exceptions.py).
- SQLAlchemy Core: prefer `insert`/`update`/`select` with `session.execute()`/`session.scalars()`; ORM `session.add()` is allowed but not default.
## 1) Models and audit fields
- Inherit all models from `TableBase`.
- Shared fields: `create_time`, `update_time`, `created_by`, `updated_by`, `delete_flag` (`Y`/`N`).
- Never re-declare shared fields; add only table-specific columns.
## 2) CRUD and audit
- Create: set `created_by`, `updated_by`, default `delete_flag='N'`; timestamps are server-managed.
- Update: set `updated_by`; do not change `create_time`/`created_by`.
- Delete: soft-delete only (`delete_flag='Y'`, set `updated_by`). Cascade by soft-deleting children in same transaction when needed.
- Read: exclude soft-deleted rows by default (`delete_flag='N'`).
## 3) Transactions and sessions
- Always use `with get_db_session() as session:`.
- Never call `commit()`, `rollback()`, or `close()` in DB-layer code.
- The context manager centrally handles commit/rollback/close.
## 4) Exceptions
- Do not catch DB exceptions in `backend/database/**`; let them propagate.
- Central handling occurs in `get_db_session()`.
- Services that must proceed non-blockingly may catch a shared type (e.g., `DatabaseOperationError`).
## 5) Exception flow (inside get_db_session)
- On exception: `rollback` → re-raise → `close` → propagate to callers.
## 6) Reference patterns (Core; no explicit commit/rollback)
```python
from sqlalchemy import insert, update, select
from database.client import get_db_session, as_dict
def create_entity(data: dict):
with get_db_session() as session:
return session.execute(
insert(SomeModel).values(**data).returning(SomeModel.id)
).scalar_one()
def update_entity(entity_id: int, updates: dict, actor: str):
with get_db_session() as session:
session.execute(
update(SomeModel)
.where(SomeModel.id == entity_id, SomeModel.delete_flag == 'N')
.values(**updates, updated_by=actor)
)
def soft_delete_entity(entity_id: int, actor: str):
with get_db_session() as session:
session.execute(
update(SomeModel)
.where(SomeModel.id == entity_id, SomeModel.delete_flag == 'N')
.values(delete_flag='Y', updated_by=actor)
)
def read_active_entity(entity_id: int):
with get_db_session() as session:
record = session.scalars(
select(SomeModel).where(
SomeModel.id == entity_id,
SomeModel.delete_flag == 'N',
)
).first()
return None if record is None else as_dict(record)
```
## 7) Validation checklist
- All models inherit `TableBase`; no duplicated audit fields.
- Deletes are soft deletes (`delete_flag='Y'`) and set `updated_by`.
- No direct `commit`/`rollback`/`close` outside `get_db_session()`.
- No DB exception catching in `backend/database/` modules.
- Reads default to `delete_flag='N'`.
- Services that must proceed on failure catch a shared DB exception type in `consts.exceptions`.
================================================
FILE: .cursor/rules/backend/service_layer_rules.mdc
================================================
---
globs: backend/services/**/*.py
description: Service layer implements core business logic orchestration; raise custom exceptions; no HTTP handling
---
### Service Layer Rules
- **Scope**: Applies to `backend/services/*.py`.
- **Goal**: Implement core business logic and orchestrate complex workflows. Coordinate repositories/SDKs. Keep HTTP concerns out of this layer.
- **Exceptions**: Raise domain/service exceptions declared in `backend/consts/exceptions.py`. If a new case is needed, add a new class there, then raise it here. Do not translate to HTTP here.
- **Environment variables**: Do not access `os.getenv()` directly. Read configuration from `consts.const` (see `environment_variable` rule) or accept parameters.
Reference: [backend/consts/exceptions.py](mdc:backend/consts/exceptions.py)
### Correct example (service orchestrates business logic and raises domain exceptions)
```python
# backend/services/agent_service.py
from typing import Any, Dict
from consts.exceptions import LimitExceededError, AgentRunException, MemoryPreparationException
# from consts.const import APPID, TOKEN # Example: read config via consts, not os.getenv
def run_agent(task_payload: Dict[str, Any]) -> Dict[str, Any]:
"""Run agent core workflow and return domain result dict.
Raises domain exceptions on failure; no HTTP concerns here.
"""
if _is_rate_limited(task_payload):
raise LimitExceededError("Too many requests for this tenant.")
try:
memory = _prepare_memory(task_payload)
except Exception as exc:
# Wrap low-level error in a domain exception for the app layer to translate
raise MemoryPreparationException("Failed to prepare memory.") from exc
try:
result = _execute_core_logic(task_payload, memory)
except Exception as exc:
raise AgentRunException("Agent execution failed.") from exc
# Return a plain Python object, not a Response
return {"status": "ok", "data": result}
def _is_rate_limited(_: Dict[str, Any]) -> bool:
return False
def _prepare_memory(_: Dict[str, Any]) -> Dict[str, Any]:
return {"memo": "prepared"}
def _execute_core_logic(_: Dict[str, Any], __: Dict[str, Any]) -> Dict[str, Any]:
return {"answer": "42"}
```
### Incorrect example (service leaks HTTP/web concerns or reads env directly)
```python
# backend/services/agent_service.py
from fastapi import HTTPException # WRONG: HTTP in service
from starlette.responses import JSONResponse # WRONG: Response in service
import os # WRONG: direct env access in service
def run_agent(_: dict):
# WRONG: translating to HTTP inside service
if os.getenv("RATE_LIMIT", "0") == "1": # WRONG: direct getenv here
raise HTTPException(status_code=429, detail="Too many requests")
# WRONG: returning framework response from service
return JSONResponse({"status": "ok"})
```
### Declaring a new custom exception (do this in exceptions module)
```python
# backend/consts/exceptions.py
class OrderProcessingError(Exception):
"""Raised when order processing fails in service layer."""
pass
```
### Existing exceptions (excerpt from current code)
```python
"""
Custom exception classes for the application.
"""
class AgentRunException(Exception):
"""Exception raised when agent run fails."""
pass
class LimitExceededError(Exception):
"""Raised when an outer platform calling too frequently"""
pass
class UnauthorizedError(Exception):
"""Raised when a user from outer platform is unauthorized."""
pass
class SignatureValidationError(Exception):
"""Raised when X-Signature header is missing or does not match the expected HMAC value."""
pass
class MemoryPreparationException(Exception):
"""Raised when memory preprocessing or retrieval fails prior to agent run."""
pass
```
================================================
FILE: .cursor/rules/english_comments.mdc
================================================
---
alwaysApply: true
description: Enforce English-only comments and docstrings across the codebase
---
# English-only Comments
- All comments and docstrings must be written in clear, concise English.
- Do not use non-English characters in comments (string literals may contain any language).
- Use proper grammar and spelling; avoid ambiguous abbreviations.
## Do
```python
# Initialize cache for 60 seconds
self.cache_ttl = 60
```
## Don't
```python
# 初始化缓存 60 秒 - FORBIDDEN
# データキャッシュ60秒 - FORBIDDEN
# 데이터 캐시 60초 - FORBIDDEN
```
## Scope
- Docstrings, inline comments, TODO/FIXME/NOTE, header comments
- Configuration comments in YAML/JSON and other config files
## Validation Checklist
- All comments are in English
- Docstrings use proper English grammar
- No non-Latin characters in comments (except inside strings)
- Comments are clear and provide value
## Optional Automation
- Pre-commit hook to detect non-English comments
- IDE extensions for real-time detection
- CI checks for compliance
================================================
FILE: .cursor/rules/environment_variable.mdc
================================================
---
globs: backend/**/*.py,sdk/**/*.py
alwaysApply: false
description: Centralize env var access in backend/consts/const.py; no direct os.getenv outside
---
# Environment Variables: Single Source of Truth
All environment variable access must go through [backend/consts/const.py](mdc:backend/consts/const.py). No direct `os.getenv()` or `os.environ.get()` calls elsewhere.
## Do
```python
# backend/consts/const.py
APPID = os.getenv("APPID", "")
TOKEN = os.getenv("TOKEN", "")
# other modules
from consts.const import APPID, TOKEN
```
## Don't
```python
# direct calls in other modules
import os
appid = os.getenv("APPID")
token = os.environ.get("TOKEN")
```
## Architecture
- **Single source**: Only `backend/consts/const.py` may read env vars.
- **SDK (`sdk/`)**: Never read env. Accept configuration via parameters. Remove `from_env()`.
- **Services (`backend/services/`)**: Read from `consts.const`; pass config to SDK.
- **Apps (`backend/apps/`)**: Read from `consts.const`; pass through to services/SDK. No business logic here.
## Migration checklist
1. Add new vars to `backend/consts/const.py`.
2. Update `.env.example`.
3. Remove all direct `os.getenv()`/`os.environ.get()` outside `const.py`.
4. Import from `consts.const` in backend modules.
5. Pass configuration as parameters to SDK.
6. Remove `from_env()` methods from config classes.
7. Update service constructors to read from `const.py`.
## Validation
- No direct env access outside `const.py`.
- No `from_env()` in config classes.
- All env vars defined in `const.py`.
- SDK modules accept configuration via parameters.
================================================
FILE: .cursor/rules/frontend/component_layer_rules.mdc
================================================
---
globs: frontend/components/**/*.tsx,frontend/app/**/components/**/*.tsx
description: Component layer rules for reusable and feature-specific UI components
---
### Purpose and Scope
- Component layer contains reusable UI components for `frontend/components/**/*.tsx` and feature-specific components under `frontend/app/**/components/**/*.tsx`
- Responsibilities: Create reusable components, implement business logic, handle interactions, provide consistent UI
- **MANDATORY**: All components must use TypeScript and functional components
### UI Library and Icons
- **Ant Design first**: Use Ant Design for forms, data display, modals, buttons, layouts. See [ui_standards_rules.mdc](mdc:frontend/ui_standards_rules.mdc).
- **Icons**: Lucide icons primary (`lucide-react`), `@ant-design/icons` as fallback when Lucide lacks the icon.
```tsx
// Prefer Lucide
import { Search, RefreshCw, Edit } from "lucide-react";
// Fallback when Lucide has no equivalent (e.g. ExclamationCircleFilled for modal)
import { ExclamationCircleFilled, InfoCircleFilled } from "@ant-design/icons";
```
### Component Organization
- **`components/auth/`** - Authentication-related components
- **`components/providers/`** - Context providers and global state management
### Component Structure
- Use functional components with TypeScript
- Define proper interfaces for all props
- Use React hooks for state management
- Implement proper error boundaries where needed
- Follow single responsibility principle
- **Single component file should not exceed ~1000 lines**: Split into subcomponents or extract logic to hooks/utils when a file grows. keep files digestible.
### Props and State Management
- All props must be typed with interfaces
- Use optional props with default values when appropriate
- Prefer controlled components over uncontrolled
- Use local state for component-specific data
- Use context for shared state across components
- **Avoid Prop Drilling**: When a component receives more than ~7–10 props, or props are passed through multiple layers only to reach a deep child, prefer:
- **Context** for cross-cutting state (auth, theme, feature flags)
- **Composition** (children, render props) instead of passing many callbacks
- **Custom hooks** to encapsulate shared logic; let children use the hook instead of receiving props from parent
- **CRITICAL**: All logging must use [logger.ts](mdc:frontend/lib/logger.ts) - never use console.log
### Styling and Design
- Use Ant Design components + Tailwind for spacing and simple styling
- Follow design system patterns and spacing
- Ensure responsive design with mobile-first approach
- Use CSS variables for theme colors
- Implement proper focus states and accessibility
### Internationalization
- All user-facing text must use `useTranslation` hook
- Use descriptive translation keys: `t('button.save')` instead of `t('save')`
- Provide fallback text for missing translations
- Group related translations in namespaces
### Error Handling
- Implement proper error boundaries for component trees
- Handle async operations with loading and error states
- Provide meaningful error messages to users
- Log errors appropriately for debugging
### Other Considerations
- **Colocate subcomponents**: When a component file grows, extract logically distinct subcomponents into separate files in the same folder. Avoid putting many unrelated components in one file.
- **Lean interfaces**: Group related props into objects when they form a cohesive concern (e.g. `user: { email, avatarUrl, role }`) instead of passing many flat props.
### Example
```tsx
// frontend/components/example-modal.tsx
import React from "react";
import { useTranslation } from "react-i18next";
import { Modal } from "antd";
import { AlertTriangle } from "lucide-react";
interface ExampleModalProps {
open: boolean;
onClose: () => void;
onConfirm: () => void;
}
export function ExampleModal({
open,
onClose,
onConfirm,
}: ExampleModalProps) {
const { t } = useTranslation("common");
return (
<Modal
open={open}
onCancel={onClose}
centered
okText={t("common.confirm")}
cancelText={t("common.cancel")}
onOk={onConfirm}
>
<div className="flex items-center gap-3">
<AlertTriangle className="h-5 w-5 text-amber-500" />
<span>{t("modal.exampleMessage")}</span>
</div>
</Modal>
);
}
```
================================================
FILE: .cursor/rules/frontend/frontend_overview_rules.mdc
================================================
---
globs: frontend/**/*.{ts,tsx}
description: Frontend overview - directory structure, layer responsibilities, and dependency rules
alwaysApply: false
---
# Frontend Overview
## Directory Structure
```
frontend/
├── app/[locale]/ # Routes with i18n (Next.js App Router)
│ ├── layout.tsx, page.tsx # Root layout and home
│ ├── i18n.tsx # i18n config
│ └── {feature}/ # e.g. chat, agents, knowledges, models
│ ├── page.tsx # Page entry (thin wrapper)
│ ├── components/ # Feature-specific components
│ └── {submodule}/ # e.g. versions/
├── components/ # Cross-feature reusable components
│ ├── auth/ # Auth-related UI
│ ├── providers/ # Global context providers
│ └── ... # Base UI: use Ant Design; avoid custom wrappers
├── hooks/ # Custom hooks (organized by domain)
│ ├── auth/ # useSessionManager, useAuthentication, etc.
│ ├── agent/ # useAgentList, useAgentInfo, etc.
│ ├── chat/ # useConversationManagement, etc.
│ └── ...
├── services/ # API calls (api.ts, *Service.ts)
├── lib/ # Utilities (logger, session, utils, etc.)
├── types/ # Shared type definitions
├── const/ # Constants and config
├── stores/ # Global state stores (if any)
├── styles/ # Global styles (theme, reset, AntD overrides)
└── public/ # Static assets
```
## Layer Responsibilities
| Directory | Purpose | Notes |
|-----------|---------|-------|
| `app/[locale]/{feature}/page.tsx` | Route entry, auth guard, config load | Thin wrapper; delegate UI to internal/components |
| `app/.../components/` | Feature-only UI pieces | Ant Design first; Lucide icons primary, `@ant-design/icons` fallback |
| `components/` | Shared UI across features | Ant Design first; Lucide icons primary, `@ant-design/icons` fallback |
| `hooks/` | State and side-effects | Shared API data: use TanStack React Query (`useQuery`); client-side filter/sort: `useMemo` on query data; mutations: `useMutation` + `queryClient.invalidateQueries` |
| `services/` | API calls | — |
| `lib/` | Pure utilities | — |
| `types/` | Type definitions only | `interface`, `type` only; do not store constants |
| `const/` | Runtime constants | Literals, enums, config objects, status codes; do not store `interface`/`type` |
| `styles/` | Global styles | Theme vars, reset, AntD overrides only; component-specific CSS: colocate in component (e.g. `*.module.css`) |
## General Principles
- **Avoid over-engineering**: Before abstracting code (extracting hooks, components, utils), confirm there is a concrete need (reuse, testability, or complexity). Prefer simple, inline solutions until the need is clear.
## Dependency Rules
- **No cross-feature imports**: Feature-level code (`components/` under a feature) must not import from other features. Use shared `components/` for cross-feature reuse.
- **Infrastructure does not depend on UI**: `services/`, `lib/`, `types/` must not import from `app/` or `components/`.
- **Minimize CSS**: Prefer Tailwind + Ant Design. Use CSS only when necessary; keep component-specific styles colocated (e.g. `*.module.css` next to the component).
## Path Aliases
- `@/*` → `frontend/*`
- `@/app/*` → `frontend/app/[locale]/*` (import without `[locale]` segment)
Example: `import { ChatInterface } from "@/app/chat/internal/chatInterface"`
## Where to Put New Code
| If you are adding... | Put it in |
|----------------------|-----------|
| A new route | `app/[locale]/{feature}/page.tsx` |
| Core feature logic | `app/[locale]/{feature}/internal/` |
| UI used only by one feature | `app/[locale]/{feature}/components/` |
| UI used by multiple features | `components/` (auth/, providers/, etc.); base UI from Ant Design |
| State/effect logic | `hooks/{domain}/` |
| API call | `services/` |
| Pure helper | `lib/` |
| Shared type | `types/` |
| Shared constant value | `const/` |
| Global styles (theme, reset) | `styles/` |
================================================
FILE: .cursor/rules/frontend/hook_layer_rules.mdc
================================================
---
globs: frontend/hooks/**/*.ts
description: Hook layer rules for custom React hooks and state management
---
### Purpose and Scope
- Hook layer contains custom React hooks for `frontend/hooks/**/*.ts`
- Responsibilities: Encapsulate state logic, provide service interfaces, handle loading/error states
- **MANDATORY**: All hooks must be named `useXxx` and use TypeScript
### Hook Organization
- **`hooks/useAuth.ts`** - Authentication state and operations
- **`hooks/useConfig.ts`** - Configuration management
- **`hooks/useChat.ts`** - Chat-related state and operations
- **`hooks/useMemory.ts`** - Memory management
- Use descriptive names indicating the hook's purpose
### Hook Structure
- Use TypeScript for all hook definitions
- Return objects with descriptive property names
- Handle loading, error, and success states consistently
- Implement proper cleanup for side effects
- Use proper dependency arrays in useEffect
### Essential Hook Usage
| Hook | Purpose | When to Use |
|------|---------|-------------|
| `useState` | Store component state | Simple state like toggles, counters |
| `useReducer` | Complex state logic | Multiple state dependencies |
| `useContext` | Share data between components | Theme, user info, global state |
| `useEffect` | Handle side effects | Data fetching, subscriptions, timers |
| `useCallback` | Prevent function recreation | Callbacks passed to child components |
| `useMemo` | Cache calculations | Expensive computations |
| `useRef` | Store mutable values | DOM nodes, timer IDs |
### State Management
- Use useState for local component state
- Use useReducer for complex state logic
- Use useContext for shared state across components
- Implement proper state updates and immutability
- Handle async state updates correctly
- **CRITICAL**: All logging must use [logger.ts](mdc:frontend/lib/logger.ts) - never use console.log
### Error Handling
- Handle async errors gracefully
- Provide meaningful error messages
- Log errors appropriately for debugging
- Implement retry logic for transient failures
### Example
```typescript
// frontend/hooks/useAuth.ts
import { useState, useEffect, useCallback } from 'react';
import { authService } from '@/services/authService';
export function useAuth() {
const [user, setUser] = useState(null);
const [isLoading, setIsLoading] = useState(true);
const [error, setError] = useState(null);
const login = useCallback(async (credentials) => {
setIsLoading(true);
setError(null);
try {
const response = await authService.login(credentials);
if (response.success) {
setUser(response.data.user);
} else {
setError(response.error);
}
} catch (err) {
setError(err.message);
} finally {
setIsLoading(false);
}
}, []);
return { user, isLoading, error, login };
}
```
================================================
FILE: .cursor/rules/frontend/page_layer_rules.mdc
================================================
---
globs: frontend/app/**/*.tsx
description: Page layer rules for Next.js App Router pages and layouts
---
### Purpose and Scope
- Page layer handles routing and layouts for `frontend/app/**/*.tsx`
- Responsibilities: Define routes, handle data fetching, provide layouts, coordinate state
- **MANDATORY**: All pages must support internationalization through `[locale]` dynamic route
### File Structure
- **`page.tsx`** - Page components that define routes
- **`layout.tsx`** - Layout components that wrap pages
- **`loading.tsx`** - Loading UI components
- Use kebab-case for new route segments
- Prefer nested layouts over prop drilling
### Internationalization
- Client components: `const { t } = useTranslation('namespace')`
- Server components: `getTranslations` from `next-intl`
- Organize translation keys by feature/namespace
### Data Fetching
- Use Server Components for initial data fetching
- Use `fetch` with proper caching for server-side data
- Client-side fetching: custom hooks in `hooks/` directory
- Handle loading and error states appropriately
### Layout and Metadata
- Define metadata in `layout.tsx` using Next.js metadata API
- Use dynamic metadata for page-specific information
- Ensure responsive design with Tailwind CSS
- Maintain consistent layout structure
### State Management
- Use React Context for shared page-level state
- Keep page-specific state local to component
- Use custom hooks for complex state logic
- Avoid prop drilling with context providers
- **CRITICAL**: All logging must use [logger.ts](mdc:frontend/lib/logger.ts) - never use console.log
### Example
```tsx
// frontend/app/[locale]/chat/page.tsx
import { useTranslations } from 'next-intl';
export default function ChatPage({ params }: { params: { locale: string } }) {
const t = useTranslations('chat');
return (
<div className="flex h-screen">
<h1 className="text-2xl font-bold p-4">{t('title')}</h1>
</div>
);
}
```
================================================
FILE: .cursor/rules/frontend/service_layer_rules.mdc
================================================
---
globs: frontend/services/**/*.ts
description: Compact service layer rules for API calls and data management
---
### Purpose and Scope
- Service layer handles API communication and data management for `frontend/services/**/*.ts`
- **CRITICAL**: All API URLs must come from [api.ts](mdc:frontend/services/api.ts) - never hardcode URLs
- Responsibilities: API calls, request/response transformation, error handling, type safety
### API URL Management
- **MANDATORY**: Import and use `API_ENDPOINTS` from [api.ts](mdc:frontend/services/api.ts)
- **FORBIDDEN**: Hardcoded URLs, direct string concatenation for endpoints
- Use `fetchWithErrorHandling` from [api.ts](mdc:frontend/services/api.ts) for all requests
### Service Organization
- **`services/api.ts`** - Base configuration, endpoints, error handling
- **`services/*Service.ts`** - Domain-specific API calls (auth, chat, config, etc.)
- Use descriptive names matching the domain they serve
### Error Handling
- Use `ApiError` class from [api.ts](mdc:frontend/services/api.ts)
- Handle 401/499 status codes for session expiration
- Provide meaningful error messages for user feedback
### Type Safety
- Define TypeScript interfaces for all request/response data
- Use generic types for reusable API functions
- Export types for use in components and hooks
- **CRITICAL**: All logging must use [logger.ts](mdc:frontend/lib/logger.ts) - never use console.log
### Example
```typescript
// frontend/services/authService.ts
import { API_ENDPOINTS, fetchWithErrorHandling, ApiError } from './api';
export const authService = {
async signin(credentials: SigninRequest): Promise<SigninResponse> {
const response = await fetchWithErrorHandling(API_ENDPOINTS.user.signin, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(credentials),
});
return response.json();
}
};
```
================================================
FILE: .cursor/rules/frontend/type_layer_rules.mdc
================================================
---
globs: frontend/types/**/*.ts
description: Type layer rules for TypeScript type definitions and interfaces
---
### Purpose and Scope
- Type layer contains TypeScript definitions for `frontend/types/**/*.ts`
- Responsibilities: Define type-safe interfaces, API types, reusable utilities, ensure consistency
- **MANDATORY**: All types must be exported and use TypeScript
### Type Organization
- **`types/auth.ts`** - Authentication-related types
- **`types/chat.ts`** - Chat and conversation types
- **`types/config.ts`** - Configuration types
- **`types/api.ts`** - API-related types
- Use descriptive names matching the domain they represent
### Type Definition Standards
- Use interfaces for object shapes and API contracts
- Use type aliases for unions, primitives, and computed types
- Use enums for fixed sets of string/number values
- Use generic types for reusable type patterns
- Export all types for use in other modules
### API Type Definitions
- Define separate interfaces for request and response data
- Use consistent naming conventions (e.g., `UserRequest`, `UserResponse`)
- Include optional fields with proper typing
- Use union types for status fields and enums
- Provide JSDoc comments for complex types
### Component Props Types
- Define interfaces for all component props
- Use descriptive property names
- Include proper optional/required field indicators
- Use generic types for reusable component patterns
- Export types for use in component files
- **CRITICAL**: All logging must use [logger.ts](mdc:frontend/lib/logger.ts) - never use console.log
### Utility Types
- Create utility types for common patterns
- Use mapped types for transformations
- Implement conditional types for complex logic
- Provide type guards for runtime validation
### Example
```typescript
// frontend/types/auth.ts
export interface User {
id: string;
email: string;
name: string;
avatar?: string;
role: UserRole;
createdAt: string;
updatedAt: string;
}
// Utility types
export type UserUpdateData = Partial<Pick<User, 'name' | 'avatar'>>;
export type UserCreateData = Omit<User, 'id' | 'createdAt' | 'updatedAt'>;
```
================================================
FILE: .cursor/rules/frontend/ui_standards_rules.mdc
================================================
---
globs: frontend/app/**,frontend/components/**
alwaysApply: false
---
# Frontend UI Standards Rules
## Principle
Use Ant Design as primary UI library with minimal Tailwind CSS. Prioritize mature Ant Design solutions for responsive layouts. Avoid secondary encapsulation unless necessary.
## Technology Usage Guidelines
- **Ant Design**: Forms, data display, complex interactions (`<Button>`, `<Modal>`, `<Form>`)
- **Tailwind CSS**: Spacing, layout, simple styling (`className="flex items-center gap-2 text-sm"`)
- **Inline Styles**: Special cases (`style={{ fontSize: "48px" }}`)
- **Override AntD**: Use `<style jsx global>` when necessary
## Layout Standards
### Global Layout
Use Header, Sider, Footer, Content structure. Reference: https://ant.design/components/layout-cn
```tsx
const { Header, Footer, Sider, Content } = Layout;
<Layout>
<Header>Header</Header>
<Layout>
<Sider width="25%">Sider</Sider>
<Content>Content</Content>
</Layout>
<Footer>Footer</Footer>
</Layout>
```
### Responsive Grid
Use AntD Grid for responsive layouts. Reference: https://ant.design/components/grid-cn
```tsx
<Row gutter={{ xs: 8, sm: 16, md: 24, lg: 32 }}>
<Col span={6}>col-6</Col>
<Col span={6}>col-6</Col>
<Col span={6}>col-6</Col>
<Col span={6}>col-6</Col>
</Row>
```
### Flex Layout
Use AntD Flex for component alignment. Reference: https://ant.design/components/flex-cn
```tsx
<Flex vertical className="h-full overflow-hidden">
<Row><Col>Content 1</Col></Row>
<Row><Col>Content 2</Col></Row>
<Row className="flex:1 min-h-0">
<Col><Flex className="h-full overflow-hidden">...</Flex></Col>
</Row>
</Flex>
```
## Component Standards
### Modals
1. **Complex Modal**: For reusable modals with custom content
2. **Simple Modal**: Use `useConfirmModal` for one-time confirmations
#### Modal Standards
- Use `centered` for positioning
- Confirm buttons: `type="primary" danger={true}`
- i18n keys: `common.cancel`, `common.confirm`
- Icon: `<ExclamationCircleFilled />` aligned with title
```tsx
// Complex modal
<Modal
open={isOpen}
centered
okButtonProps={{ type: "primary", danger: true }}
okText={t("common.confirm")}
>
<div className="flex items-start gap-4">
<ExclamationCircleFilled style={{ color: token.colorWarning, fontSize: '22px' }} />
<div>
<div className="font-medium">{t("title")}</div>
<div className="text-sm">{t("content")}</div>
</div>
</div>
</Modal>
// Simple modal
const { confirm } = useConfirmModal();
confirm({
title: t("delete.confirmTitle"),
content: t("delete.confirmContent"),
onOk: () => { /* ... */ }
});
```
### Icon Library
- **Primary**: `lucide-react` for consistency
- **Fallback**: `@ant-design/icons` when lucide-react lacks icons
```tsx
import { ExternalLink } from "lucide-react";
import { PlusOutlined } from '@ant-design/icons';
<ExternalLink />
<PlusOutlined />
```
## i18n Usage
```tsx
import { useTranslation, Trans } from "react-i18next";
// Simple text
t("common.confirm")
// HTML content
<Trans
i18nKey="modal.description"
values={{ title }}
components={{ strong: <strong /> }}
/>
```
================================================
FILE: .cursor/rules/pytest_unit_test_rules.mdc
================================================
---
globs: test/**/*.py
description: Pytest Unit Test Rules for this repository
---
## Pytest Unit Test Rules (Concise)
### Framework
- Use pytest exclusively; prefer fixtures; use pytest `assert` statements.
### Naming
- Files `test_*`; classes `Test*`; functions `test_*`.
### Imports
- Order: standard library, third‑party, project.
- Import only the unit under test; mock collaborators using `pytest-mock`.
### Import and Mock Rules
- Do not directly import external interfaces/clients/services into tests to exercise collaborators.
- Patch where the dependency is imported (lookup site) using a fully‑qualified path.
- Use `side_effect` to cover error paths when appropriate.
```python
from pytest_mock import MockFixture
from backend.apps.some_app import create_resource
def test_create_resource_success(mocker: MockFixture):
mocker.patch(
"backend.services.model_provider_service.ModelProviderService.create",
return_value={"id": "res-1"},
)
assert create_resource({...})["id"] == "res-1"
```
### Structure and Size
- Keep files under 500 lines or split by feature; include `__init__.py` in split directories; use `test_<module>_<feature>.py` names.
### Coverage and Async
- Cover success/error flows and boundaries; use `@pytest.mark.parametrize` for variants.
- Use `@pytest.mark.asyncio` for async tests.
### Isolation
- Use `autouse=True` fixtures to reset state; fully mock external I/O and APIs.
### Checklist
- [ ] pytest only (no unittest)
- [ ] naming conventions followed
- [ ] collaborators mocked with pytest-mock
- [ ] import/mocking rules followed
- [ ] async tests decorated when needed
- [ ] clear, specific assertions
- [ ] adequate coverage (normal and exception paths)
================================================
FILE: .devcontainer/devcontainer.json
================================================
{
"name": "nexent-data-process",
"dockerComposeFile": "../docker/docker-compose.dev.yml",
"service": "nexent-data-process",
"workspaceFolder": "/opt",
"forwardPorts": [3000, 5012],
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"remote.extensionKind": {
"ms-vscode.vscode-typescript-next": ["workspace"]
}
},
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-azuretools.vscode-docker"
]
}
},
"remoteUser": "root",
"shutdownAction": "none",
"containerEnv": {
"VSCODE_SERVER_ARCH": "linux-x64"
}
}
================================================
FILE: .dockerignore
================================================
# Python
**/.venv/
**/__pycache__/
**/*.pyc
**/*.pyo
**/*.pyd
**/.Python
**/pip-log.txt
**/pip-delete-this-directory.txt
**/.pytest_cache/
**/.coverage
**/.mypy_cache/
# Git
.git
**/.git/
.gitignore
# Docker
.dockerignore
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Node
frontend/node_modules/
node_modules/
.pnpm-store/
.pnpm-lock.yaml
dist/
build/
.npm
*.tgz
# Backend
backend/assets/*
!backend/assets/test.wav
backend/flower_db.sqlite
uploads/
test/
assets/
# Github
.github/
# Cursor
.cursor/
# Dev Container
.devcontainer/
# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
================================================
FILE: .editorconfig
================================================
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.{js,jsx,ts,tsx,json}]
indent_style = space
indent_size = 2
[*.md]
trim_trailing_whitespace = false
================================================
FILE: .github/CODEOWNERS
================================================
# These owners will be the default owners for everything in the repo
* @Phinease @WMC001
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.yml
================================================
name: 'Bug Report'
description: 'Report errors or unexpected behavior'
title: '[Bug] '
type: Bug
labels: ['unconfirm']
body:
- type: markdown
attributes:
value: |
Before creating a new Issue, please [search existing issues](https://github.com/AI-Application-Innovation/nexent/issues), including closed ones.
- type: input
attributes:
label: 'Nexent Version'
- type: textarea
attributes:
label: 'Problem Description'
description: Please provide a clear and concise description of the issue.
validations:
required: true
- type: textarea
attributes:
label: 'Reproduction Steps'
description: Please provide clear and concise steps to reproduce the issue.
- type: textarea
attributes:
label: 'Additional Information'
description: If your issue requires further explanation or cannot be reproduced in a simple example, please provide more information here.
================================================
FILE: .github/ISSUE_TEMPLATE/document_issue.yml
================================================
name: 'Document Issue'
description: 'Report an issue with the documentation'
title: '[Document] '
type: Feature
labels: ['documentation']
body:
- type: markdown
attributes:
value: |
Before creating a new Issue, please [search existing issues](https://github.com/AI-Application-Innovation/nexent/issues), including closed ones.
- type: textarea
attributes:
label: 'Document Change Description'
description: Please describe which document needs to be corrected and why.
validations:
required: true
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.yml
================================================
name: 'Feature Request'
description: 'Suggest an idea'
title: '[Request] '
type: Feature
labels: ['enhancement']
body:
- type: markdown
attributes:
value: |
Before creating a new Issue, please [search existing issues](https://github.com/AI-Application-Innovation/nexent/issues), including closed ones.
- type: textarea
attributes:
label: 'Feature Description'
description: Please add a clear and concise description of the problem you are seeking to solve with this feature request.
validations:
required: true
- type: textarea
attributes:
label: 'Proposed Solution'
description: Describe the solution you'd like in a clear and concise manner.
- type: textarea
attributes:
label: 'Additional Information'
description: Add any other context about the problem here.
================================================
FILE: .github/ISSUE_TEMPLATE/improvement_proposal.yml
================================================
name: 'Improvement Proposal'
description: 'Suggest enhancements or new features'
title: '[Improvement] '
type: Feature
labels: ['enhancement']
body:
- type: markdown
attributes:
value: |
Before creating a new Issue, please [search existing issues](https://github.com/AI-Application-Innovation/nexent/issues), including closed ones.
- type: textarea
attributes:
label: 'Improvement Description'
description: 'Clearly articulate the proposed improvement, including its benefits and potential impact.'
validations:
required: true
================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
- package-ecosystem: "npm"
directory: "/frontend"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
labels:
- "dependencies"
- package-ecosystem: "npm"
directory: "/doc"
schedule:
interval: "weekly"
open-pull-requests-limit: 2
labels:
- "dependencies"
- package-ecosystem: "pip"
directory: "/backend"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
labels:
- "dependencies"
- package-ecosystem: "pip"
directory: "/sdk"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
labels:
- "dependencies"
================================================
FILE: .github/workflows/auto-build-data-process-dev.yml
================================================
name: Docker Build Data-Process Images
concurrency:
group: docker-build-data-process-dev-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
pull_request:
branches: [develop]
paths:
- 'backend/**'
- 'sdk/**'
- 'make/data_process/**'
- '.github/workflows/**'
push:
branches: [develop]
paths:
- 'backend/**'
- 'sdk/**'
- 'make/data_process/**'
- '.github/workflows/**'
jobs:
build-data-process-amd64:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Clone model
run: |
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/Nexent-AI/model-assets
cd ./model-assets
GIT_TRACE=1 GIT_CURL_VERBOSE=1 GIT_LFS_LOG=debug git lfs pull
rm -rf .git .gitattributes
- name: Build data process image (amd64) and load locally
run: |
docker build --platform linux/amd64 -t nexent/nexent-data-process:dev-amd64 -f make/data_process/Dockerfile .
build-data-process-arm64:
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Clone model
run: |
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/Nexent-AI/model-assets
cd ./model-assets
GIT_TRACE=1 GIT_CURL_VERBOSE=1 GIT_LFS_LOG=debug git lfs pull
rm -rf .git .gitattributes
- name: Build data process image (arm64) and load locally
run: |
docker build --platform linux/arm64 -t nexent/nexent-data-process:dev-arm64 -f make/data_process/Dockerfile .
================================================
FILE: .github/workflows/auto-build-doc-dev.yml
================================================
name: Docker Build Doc Check
concurrency:
group: docker-build-doc-dev-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
pull_request:
branches: [develop]
paths:
- 'doc/**'
- '.github/workflows/**'
push:
branches: [develop]
paths:
- 'doc/**'
- '.github/workflows/**'
jobs:
build-docs-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: |
cd doc
npm install
- name: Build doc
run: |
cd doc
npm run docs:build
BUILD_EXIT_CODE=$?
if [ $BUILD_EXIT_CODE -ne 0 ]; then
echo "❌ Doc build failed with exit code $BUILD_EXIT_CODE"
exit $BUILD_EXIT_CODE
else
echo "✅ Doc build completed successfully"
fi
================================================
FILE: .github/workflows/auto-build-main-dev.yml
================================================
name: Docker Build Main Images
concurrency:
group: docker-build-main-dev-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
pull_request:
branches: [develop]
paths:
- 'backend/**'
- 'sdk/**'
- 'make/main/**'
- '.github/workflows/**'
push:
branches: [develop]
paths:
- 'backend/**'
- 'sdk/**'
- 'make/main/**'
- '.github/workflows/**'
jobs:
build-main-amd64:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build main image (amd64) and load locally
run: |
docker build --platform linux/amd64 -t nexent/nexent:dev-amd64 -f make/main/Dockerfile .
build-main-arm64:
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build main image (arm64) and load locally
run: |
docker build --platform linux/arm64 -t nexent/nexent:dev-arm64 -f make/main/Dockerfile .
================================================
FILE: .github/workflows/auto-build-mcp-dev.yml
================================================
name: Docker Build MCP Images
concurrency:
group: docker-build-mcp-dev-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
pull_request:
branches: [develop]
paths:
- 'backend/**'
- 'sdk/**'
- 'make/mcp/**'
- '.github/workflows/**'
push:
branches: [develop]
paths:
- 'backend/**'
- 'sdk/**'
- 'make/mcp/**'
- '.github/workflows/**'
jobs:
build-mcp-amd64:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build MCP image (amd64) and load locally
run: |
docker build --platform linux/amd64 -t nexent/nexent-mcp:dev-amd64 -f make/mcp/Dockerfile .
build-mcp-arm64:
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build MCP image (arm64) and load locally
run: |
docker build --platform linux/arm64 -t nexent/nexent-mcp:dev-arm64 -f make/mcp/Dockerfile .
================================================
FILE: .github/workflows/auto-build-terminal-dev.yml
================================================
name: Docker Build Terminal Images
concurrency:
group: docker-build-terminal-dev-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
pull_request:
branches: [develop]
paths:
- 'make/terminal/**'
- '.github/workflows/**'
push:
branches: [develop]
paths:
- 'make/terminal/**'
- '.github/workflows/**'
jobs:
build-terminal-amd64:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build terminal image (amd64) and load locally
run: |
docker build --platform linux/amd64 -t nexent/nexent-ubuntu-terminal:dev-amd64 -f make/terminal/Dockerfile .
build-terminal-arm64:
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build terminal image (arm64) and load locally
run: |
docker build --platform linux/arm64 -t nexent/nexent-ubuntu-terminal:dev-arm64 -f make/terminal/Dockerfile .
================================================
FILE: .github/workflows/auto-build-web-dev.yml
================================================
name: Docker Build Web Images
concurrency:
group: docker-build-web-dev-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
pull_request:
branches: [develop]
paths:
- 'frontend/**'
- 'make/web/**'
- '.github/workflows/**'
push:
branches: [develop]
paths:
- 'frontend/**'
- 'make/web/**'
- '.github/workflows/**'
jobs:
build-web-amd64:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build web image (amd64) and load locally
run: |
docker build --platform linux/amd64 -t nexent/nexent-web:dev-amd64 -f make/web/Dockerfile .
build-web-arm64:
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build web image (arm64) and load locally
run: |
docker build --platform linux/arm64 -t nexent/nexent-web:dev-arm64 -f make/web/Dockerfile .
================================================
FILE: .github/workflows/auto-image-pull-test.yml
================================================
name: Docker Image Pull Test
on:
schedule:
# Run every 30 minutes (at minute 0 and 30 of every hour)
- cron: '0,30 * * * *'
workflow_dispatch:
inputs:
runner_label_json:
description: 'runner array in json format (e.g. ["ubuntu-latest"] or ["self-hosted"])'
required: true
default: '["ubuntu-latest"]'
env:
NEXENT_IMAGE: nexent/nexent:latest
NEXENT_WEB_IMAGE: nexent/nexent-web:latest
NEXENT_DATA_PROCESS_IMAGE: nexent/nexent-data-process:latest
OPENSSH_SERVER_IMAGE: nexent/nexent-ubuntu-terminal:latest
jobs:
test-image-pull:
runs-on: ${{ github.event_name == 'workflow_dispatch' && fromJson(inputs.runner_label_json) || fromJson('["ubuntu-latest"]') }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Generate random pull count
id: random-count
run: |
# Generate a random number between 2-5
RANDOM_COUNT=$(shuf -i 2-5 -n 1)
echo "pull-count=$RANDOM_COUNT" >> "$GITHUB_OUTPUT"
echo "Will pull each image $RANDOM_COUNT times"
- name: Clean existing images
run: |
echo "Cleaning existing images..."
docker rmi -f ${{ env.NEXENT_IMAGE }} 2>/dev/null || echo "Image ${{ env.NEXENT_IMAGE }} not found locally"
docker rmi -f ${{ env.NEXENT_WEB_IMAGE }} 2>/dev/null || echo "Image ${{ env.NEXENT_WEB_IMAGE }} not found locally"
docker rmi -f ${{ env.NEXENT_DATA_PROCESS_IMAGE }} 2>/dev/null || echo "Image ${{ env.NEXENT_DATA_PROCESS_IMAGE }} not found locally"
docker rmi -f ${{ env.OPENSSH_SERVER_IMAGE }} 2>/dev/null || echo "Image ${{ env.OPENSSH_SERVER_IMAGE }} not found locally"
# Clean up dangling images
docker image prune -f 2>/dev/null || echo "No dangling images to remove"
echo "Image cleanup completed"
- name: Test pull nexent/nexent:latest
run: |
echo "Testing nexent/nexent:latest image pull..."
PULL_COUNT=${{ steps.random-count.outputs.pull-count }}
for i in $(seq 1 $PULL_COUNT); do
echo "Pull attempt $i/$PULL_COUNT for nexent/nexent:latest"
if docker pull ${{ env.NEXENT_IMAGE }}; then
echo "✅ Successfully pulled nexent/nexent:latest (attempt $i)"
# Remove image after successful pull to prepare for next pull
docker rmi -f ${{ env.NEXENT_IMAGE }} 2>/dev/null || true
else
echo "❌ Failed to pull nexent/nexent:latest (attempt $i)"
exit 1
fi
# Wait 5 seconds if not the last pull attempt
if [ $i -lt $PULL_COUNT ]; then
sleep 5
fi
done
- name: Test pull nexent/nexent-web:latest
run: |
echo "Testing nexent/nexent-web:latest image pull..."
PULL_COUNT=${{ steps.random-count.outputs.pull-count }}
for i in $(seq 1 $PULL_COUNT); do
echo "Pull attempt $i/$PULL_COUNT for nexent/nexent-web:latest"
if docker pull ${{ env.NEXENT_WEB_IMAGE }}; then
echo "✅ Successfully pulled nexent/nexent-web:latest (attempt $i)"
# Remove image after successful pull to prepare for next pull
docker rmi -f ${{ env.NEXENT_WEB_IMAGE }} 2>/dev/null || true
else
echo "❌ Failed to pull nexent/nexent-web:latest (attempt $i)"
exit 1
fi
# Wait 5 seconds if not the last pull attempt
if [ $i -lt $PULL_COUNT ]; then
sleep 5
fi
done
- name: Test pull nexent/nexent-data-process:latest
run: |
echo "Testing nexent/nexent-data-process:latest image pull..."
PULL_COUNT=${{ steps.random-count.outputs.pull-count }}
for i in $(seq 1 $PULL_COUNT); do
echo "Pull attempt $i/$PULL_COUNT for nexent/nexent-data-process:latest"
if docker pull ${{ env.NEXENT_DATA_PROCESS_IMAGE }}; then
echo "✅ Successfully pulled nexent/nexent-data-process:latest (attempt $i)"
# Remove image after successful pull to prepare for next pull
docker rmi -f ${{ env.NEXENT_DATA_PROCESS_IMAGE }} 2>/dev/null || true
else
echo "❌ Failed to pull nexent/nexent-data-process:latest (attempt $i)"
exit 1
fi
# Wait 5 seconds if not the last pull attempt
if [ $i -lt $PULL_COUNT ]; then
sleep 5
fi
done
- name: Test pull nexent/nexent-ubuntu-terminal:latest
run: |
echo "Testing nexent/nexent-ubuntu-terminal:latest image pull..."
PULL_COUNT=${{ steps.random-count.outputs.pull-count }}
for i in $(seq 1 $PULL_COUNT); do
echo "Pull attempt $i/$PULL_COUNT for nexent/nexent-ubuntu-terminal:latest"
if docker pull ${{ env.OPENSSH_SERVER_IMAGE }}; then
echo "✅ Successfully pulled nexent/nexent-ubuntu-terminal:latest (attempt $i)"
# Remove image after successful pull to prepare for next pull
docker rmi -f ${{ env.OPENSSH_SERVER_IMAGE }} 2>/dev/null || true
else
echo "❌ Failed to pull nexent/nexent-ubuntu-terminal:latest (attempt $i)"
exit 1
fi
# Wait 5 seconds if not the last pull attempt
if [ $i -lt $PULL_COUNT ]; then
sleep 5
fi
done
- name: Final cleanup
if: always()
run: |
echo "Performing final cleanup..."
docker rmi -f ${{ env.NEXENT_IMAGE }} 2>/dev/null || echo "Image ${{ env.NEXENT_IMAGE }} already removed"
docker rmi -f ${{ env.NEXENT_WEB_IMAGE }} 2>/dev/null || echo "Image ${{ env.NEXENT_WEB_IMAGE }} already removed"
docker rmi -f ${{ env.NEXENT_DATA_PROCESS_IMAGE }} 2>/dev/null || echo "Image ${{ env.NEXENT_DATA_PROCESS_IMAGE }} already removed"
docker rmi -f ${{ env.OPENSSH_SERVER_IMAGE }} 2>/dev/null || echo "Image ${{ env.OPENSSH_SERVER_IMAGE }} already removed"
# Clean up dangling and unused images
docker image prune -f 2>/dev/null || echo "No images to prune"
echo "Final cleanup completed"
- name: Test Summary
if: always()
run: |
echo "🎯 Docker Image Pull Test Summary"
echo "================================="
echo "Test run completed with ${{ steps.random-count.outputs.pull-count }} pull attempts per image"
echo "Images tested:"
echo " - nexent/nexent:latest"
echo " - nexent/nexent-web:latest"
echo " - nexent/nexent-data-process:latest"
echo " - nexent/nexent-ubuntu-terminal:latest"
echo "Next scheduled run: in 30 minutes"
================================================
FILE: .github/workflows/auto-unit-test.yml
================================================
name: Run Automated Unit Tests
concurrency:
group: automated-unit-test-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
inputs:
runner_label_json:
description: 'runner array in json format (e.g. ["ubuntu-latest"] or ["self-hosted"])'
required: false
default: '["ubuntu-24.04-arm"]'
pull_request:
branches: [develop]
paths:
- 'backend/**'
- 'sdk/**'
- 'test/**'
- '.github/workflows/**'
push:
branches: [develop]
paths:
- 'backend/**'
- 'sdk/**'
- 'test/**'
- '.github/workflows/**'
jobs:
test:
runs-on: ${{ fromJson(github.event.inputs.runner_label_json || '["ubuntu-24.04-arm"]') }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install uv
run: pip install --upgrade uv
- name: Install dependencies
run: |
cd backend
uv sync --extra data-process --extra test
uv pip install -e "../sdk[dev]"
cd ..
- name: Run all tests and collect coverage
run: |
source backend/.venv/bin/activate && python test/run_all_test.py
TEST_EXIT_CODE=$?
if [ -f "test/coverage.xml" ]; then
echo "✅ Coverage XML file generated successfully."
else
echo "❌ Coverage XML file not found."
exit 1
fi
# Check if tests actually passed
if [ $TEST_EXIT_CODE -ne 0 ]; then
echo "❌ Tests failed with exit code $TEST_EXIT_CODE"
exit $TEST_EXIT_CODE
else
echo "✅ All tests passed successfully."
fi
# Detect architecture
- name: Detect architecture
id: arch
run: echo "arch=$(uname -m)" >> $GITHUB_OUTPUT
# Use Python uploader on ARM
- name: Upload coverage to Codecov (Python uploader on ARM)
if: startsWith(steps.arch.outputs.arch, 'arm') || startsWith(steps.arch.outputs.arch, 'aarch64')
run: |
pip install --upgrade codecov
codecov \
-t ${{ secrets.CODECOV_TOKEN }} \
-f test/coverage.xml \
-F unittests \
-n codecov-umbrella \
-v
# Use official action on x86
- name: Upload coverage to Codecov (Official Action on x86)
if: steps.arch.outputs.arch == 'x86_64'
uses: codecov/codecov-action@v4
with:
files: test/coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
verbose: true
directory: .
================================================
FILE: .github/workflows/auto-web-check-dev.yml
================================================
name: Run Auto Web Type Check
concurrency:
group: auto-web-type-check-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
inputs:
runner_label_json:
description: 'runner array in json format (e.g. ["ubuntu-latest"] or ["self-hosted"])'
default: '["ubuntu-latest"]'
pull_request:
branches: [develop]
paths:
- 'frontend/**'
- '.github/workflows/**'
push:
branches: [develop]
paths:
- 'frontend/**'
- '.github/workflows/**'
jobs:
type-check:
runs-on: ${{ fromJson(github.event.inputs.runner_label_json || '["ubuntu-latest"]') }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: |
cd frontend
npm install
- name: Run TypeScript type check
run: |
cd frontend
npm run type-check
TYPE_CHECK_EXIT_CODE=$?
# Check if type check actually passed
if [ $TYPE_CHECK_EXIT_CODE -ne 0 ]; then
echo "❌ Type check failed with exit code $TYPE_CHECK_EXIT_CODE"
exit $TYPE_CHECK_EXIT_CODE
else
echo "✅ Type check passed successfully."
fi
================================================
FILE: .github/workflows/codeql.yml
================================================
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced"
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
schedule:
- cron: '23 5 * * 2'
jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
# only required for workflows in private repositories
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: actions
build-mode: none
- language: javascript-typescript
build-mode: none
- language: python
build-mode: none
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
# or others). This is typically only required for manual builds.
# - name: Setup runtime (example)
# uses: actions/setup-example@v1
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
================================================
FILE: .github/workflows/codeql_main.yml
================================================
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '40 13 * * 6'
jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
# only required for workflows in private repositories
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: actions
build-mode: none
- language: javascript-typescript
build-mode: none
- language: python
build-mode: none
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
# or others). This is typically only required for manual builds.
# - name: Setup runtime (example)
# uses: actions/setup-example@v1
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- name: Run manual build steps
if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{matrix.language}}"
================================================
FILE: .github/workflows/deploy-docs.yml
================================================
# Workflow to build VitePress site and deploy it to GitHub Pages
#
name: Deploy VitePress Docs to Pages
on:
# Run on pushes to the `develop` branch
push:
branches: [develop]
# Only trigger when files in the doc directory change
paths:
- 'doc/**'
# Allow manual running of this workflow from the Actions tab
workflow_dispatch:
# Set GITHUB_TOKEN permissions to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Only allow one deployment at a time, skip runs queued between the running run and the latest queue
# However, do not cancel the running run, as we want to allow these production deployments to complete
concurrency:
group: pages
cancel-in-progress: false
jobs:
# Build job
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./doc
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: npm install
- name: Build with VitePress
run: npm run docs:build
env:
GITHUB_PAGES: true
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./doc/docs/.vitepress/dist
# Deploy job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
================================================
FILE: .github/workflows/docker-build-push-mainland.yml
================================================
name: Docker Build and Push All Images to tencentyun
on:
workflow_dispatch:
inputs:
version:
description: 'Image version tag (e.g. v1.0.0 or latest)'
required: true
default: 'latest'
push_latest:
description: 'Also push latest tag'
required: false
default: false
type: boolean
runner_label_json:
description: 'runner array in json format (e.g. ["ubuntu-latest"] or ["self-hosted"])'
required: true
default: '["ubuntu-latest"]'
jobs:
build-and-push-main-amd64:
runs-on: ${{ fromJson(inputs.runner_label_json) }}
steps:
- name: Set up Docker Buildx
run: |
if ! docker buildx inspect nexent_builder > /dev/null 2>&1; then
docker buildx create --name nexent_builder --use
else
docker buildx use nexent_builder
fi
- name: Checkout code
uses: actions/checkout@v4
- name: Build main image (amd64) and load locally
run: |
docker buildx build --platform linux/amd64 --load -t ccr.ccs.tencentyun.com/nexent-hub/nexent:${{ inputs.version }}-amd64 -f make/main/Dockerfile --build-arg MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple --build-arg APT_MIRROR=tsinghua .
- name: Login to Tencent Cloud
run: echo ${{ secrets.TCR_PASSWORD }} | docker login ccr.ccs.tencentyun.com --username=${{ secrets.TCR_USERNAME }} --password-stdin
- name: Push main image (amd64) to Tencent Cloud
run: docker push ccr.ccs.tencentyun.com/nexent-hub/nexent:${{ inputs.version }}-amd64
- name: Tag main image (amd64) as latest
if: inputs.push_latest == 'true'
run: docker tag ccr.ccs.tencentyun.com/nexent-hub/nexent:${{ inputs.version }}-amd64 ccr.ccs.tencentyun.com/nexent-hub/nexent:amd64
- name: Push latest main image (amd64) to Tencent Cloud
if: inputs.push_latest == 'true'
run: docker push ccr.ccs.tencentyun.com/nexent-hub/nexent:amd64
build-and-push-main-arm64:
runs-on: ${{ fromJson(inputs.runner_label_json) }}
steps:
- name: Set up Docker Buildx
run: |
if ! docker buildx inspect nexent_builder > /dev/null 2>&1; then
docker buildx create --name nexent_builder --use
else
docker buildx use nexent_builder
fi
- name: Checkout code
uses: actions/checkout@v4
- name: Build main image (arm64) and load locally
run: |
docker buildx build --platform linux/arm64 --load -t ccr.ccs.tencentyun.com/nexent-hub/nexent:${{ inputs.version }}-arm64 -f make/main/Dockerfile --build-arg MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple --build-arg APT_MIRROR=tsinghua .
- name: Login to Tencent Cloud
run: echo ${{ secrets.TCR_PASSWORD }} | docker login ccr.ccs.tencentyun.com --username=${{ secrets.TCR_USERNAME }} --password-stdin
- name: Push main image (arm64) to Tencent Cloud
run: docker push ccr.ccs.tencentyun.com/nexent-hub/nexent:${{ inputs.version }}-arm64
- name: Tag main image (arm64) as latest
if: inputs.push_latest == 'true'
run: docker tag ccr.ccs.tencentyun.com/nexent-hub/nexent:${{ inputs.version }}-arm64 ccr.ccs.tencentyun.com/nexent-hub/nexent:arm64
- name: Push latest main image (arm64) to Tencent Cloud
if: inputs.push_latest == 'true'
run: docker push ccr.ccs.tencentyun.com/nexent-hub/nexent:arm64
build-and-push-data-process-amd64:
runs-on: ${{ fromJson(inputs.runner_label_json) }}
steps:
- name: Free up disk space on GitHub runner
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
- name: Set up Docker Buildx
run: |
if ! docker buildx inspect nexent_builder > /dev/null 2>&1; then
docker buildx create --name nexent_builder --use
else
docker buildx use nexent_builder
fi
- name: Checkout code
uses: actions/checkout@v4
- name: Clone model
run: |
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/Nexent-AI/model-assets
cd ./model-assets
GIT_TRACE=1 GIT_CURL_VERBOSE=1 GIT_LFS_LOG=debug git lfs pull
rm -rf .git .gitattributes
- name: Build data process image (amd64) and load locally
run: |
docker buildx build --platform linux/amd64 --load -t ccr.ccs.tencentyun.com/nexent-hub/nexent-data-process:${{ inputs.version }}-amd64 -f make/data_process/Dockerfile --build-arg MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple --build-arg APT_MIRROR=tsinghua .
- name: Login to Tencent Cloud
run: echo ${{ secrets.TCR_PASSWORD }} | docker login ccr.ccs.tencentyun.com --username=${{ secrets.TCR_USERNAME }} --password-stdin
- name: Push data process image (amd64) to Tencent Cloud
run: docker push ccr.ccs.tencentyun.com/nexent-hub/nexent-data-process:${{ inputs.version }}-amd64
- name: Tag data process image (amd64) as latest
if: inputs.push_latest == 'true'
run: docker tag ccr.ccs.tencentyun.com/nexent-hub/nexent-data-process:${{ inputs.version }}-amd64 ccr.ccs.tencentyun.com/nexent-hub/nexent-data-process:amd64
- name: Push latest data process image (amd64) to Tencent Cloud
if: inputs.push_latest == 'true'
run: docker push ccr.ccs.tencentyun.com/nexent-hub/nexent-data-process:amd64
build-and-push-data-process-arm64:
runs-on: ${{ fromJson(inputs.runner_label_json) }}
steps:
- name: Free up disk space on GitHub runner
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
- name: Set up Docker Buildx
run: |
if ! docker buildx inspect nexent_builder > /dev/null 2>&1; then
docker buildx create --name nexent_builder --use
else
docker buildx use nexent_builder
fi
- name: Checkout code
uses: actions/checkout@v4
- name: Clone model
run: |
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/Nexent-AI/model-assets
cd ./model-assets
GIT_TRACE=1 GIT_CURL_VERBOSE=1 GIT_LFS_LOG=debug git lfs pull
rm -rf .git .gitattributes
- name: Build data process image (arm64) and load locally
run: |
docker buildx build --platform linux/arm64 --load -t ccr.ccs.tencentyun.com/nexent-hub/nexent-data-process:${{ inputs.version }}-arm64 -f make/data_process/Dockerfile --build-arg MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple --build-arg APT_MIRROR=tsinghua .
- name: Login to Tencent Cloud
run: echo ${{ secrets.TCR_PASSWORD }} | docker login ccr.ccs.tencentyun.com --username=${{ secrets.TCR_USERNAME }} --password-stdin
- name: Push data process image (arm64) to Tencent Cloud
run: docker push ccr.ccs.tencentyun.com/nexent-hub/nexent-data-process:${{ inputs.version }}-arm64
- name: Tag data process image (arm64) as latest
if: inputs.push_latest == 'true'
run: docker tag ccr.ccs.tencentyun.com/nexent-hub/nexent-data-process:${{ inputs.version }}-arm64 ccr.ccs.tencentyun.com/nexent-hub/nexent-data-process:arm64
- name: Push latest data process image (arm64) to Tencent Cloud
if: inputs.push_latest == 'true'
run: docker push ccr.ccs.tencentyun.com/nexent-hub/nexent-data-process:arm64
build-and-push-web-amd64:
runs-on: ${{ fromJson(inputs.runner_label_json) }}
steps:
- name: Set up Docker Buildx
run: |
if ! docker buildx inspect nexent_builder > /dev/null 2>&1; then
docker buildx create --name nexent_builder --use
else
docker buildx use nexent_builder
fi
- name: Checkout code
uses: actions/checkout@v4
- name: Build web image (amd64) and load locally
run: |
docker buildx build --platform linux/amd64 --load -t ccr.ccs.tencentyun.com/nexent-hub/nexent-web:${{ inputs.version }}-amd64 -f make/web/Dockerfile --build-arg MIRROR=https://registry.npmmirror.com --build-arg APK_MIRROR=tsinghua .
- name: Login to Tencent Cloud
run: echo ${{ secrets.TCR_PASSWORD }} | docker login ccr.ccs.tencentyun.com --username=${{ secrets.TCR_USERNAME }} --password-stdin
- name: Push web image (amd64) to Tencent Cloud
run: docker push ccr.ccs.tencentyun.com/nexent-hub/nexent-web:${{ inputs.version }}-amd64
- name: Tag web image (amd64) as latest
if: inputs.push_latest == 'true'
run: docker tag ccr.ccs.tencentyun.com/nexent-hub/nexent-web:${{ inputs.version }}-amd64 ccr.ccs.tencentyun.com/nexent-hub/nexent-web:amd64
- name: Push latest web image (amd64) to Tencent Cloud
if: inputs.push_latest == 'true'
run: docker push ccr.ccs.tencentyun.com/nexent-hub/nexent-web:amd64
build-and-push-web-arm64:
runs-on: ${{ fromJson(inputs.runner_label_json) }}
steps:
- name: Set up Docker Buildx
run: |
if ! docker buildx inspect nexent_builder > /dev/null 2>&1; then
docker buildx create --name nexent_builder --use
else
docker buildx use nexent_builder
fi
- name: Checkout code
uses: actions/checkout@v4
- name: Build web image (arm64) and load locally
run: |
docker buildx build --platform linux/arm64 --load -t ccr.ccs.tencentyun.com/nexent-hub/nexent-web:${{ inputs.version }}-arm64 -f make/web/Dockerfile --build-arg MIRROR=https://registry.npmmirror.com --build-arg APK_MIRROR=tsinghua .
- name: Login to Tencent Cloud
run: echo ${{ secrets.TCR_PASSWORD }} | docker login ccr.ccs.tencentyun.com --username=${{ secrets.TCR_USERNAME }} --password-stdin
- name: Push web image (arm64) to Tencent Cloud
run: docker push ccr.ccs.tencentyun.com/nexent-hub/nexent-web:${{ inputs.version }}-arm64
- name: Tag web image (arm64) as latest
if: inputs.push_latest == 'true'
run: docker tag ccr.ccs.tencentyun.com/nexent-hub/nexent-web:${{ inputs.version }}-arm64 ccr.ccs.tencentyun.com/nexent-hub/nexent-web:arm64
- name: Push latest web image (arm64) to Tencent Cloud
if: inputs.push_latest == 'true'
run: docker push ccr.ccs.tencentyun.com/nexent-hub/nexent-web:arm64
build-and-push-terminal-amd64:
runs-on: ${{ fromJson(inputs.runner_label_json) }}
steps:
- name: Set up Docker Buildx
run: |
if ! docker buildx inspect nexent_builder > /dev/null 2>&1; then
docker buildx create --name nexent_builder --use
else
docker buildx use nexent_builder
fi
- name: Checkout code
uses: actions/checkout@v4
- name: Build terminal image (amd64) and load locally
run: |
docker buildx build --platform linux/amd64 --load -t ccr.ccs.tencentyun.com/nexent-hub/nexent-ubuntu-terminal:${{ inputs.version }}-amd64 -f make/terminal/Dockerfile .
- name: Login to Tencent Cloud
run: echo ${{ secrets.TCR_PASSWORD }} | docker login ccr.ccs.tencentyun.com --username=${{ secrets.TCR_USERNAME }} --password-stdin
- name: Push terminal image (amd64) to Tencent Cloud
run: docker push ccr.ccs.tencentyun.com/nexent-hub/nexent-ubuntu-terminal:${{ inputs.version }}-amd64
- name: Tag terminal image (amd64) as latest
if: inputs.push_latest == 'true'
run: docker tag ccr.ccs.tencentyun.com/nexent-hub/nexent-ubuntu-terminal:${{ inputs.version }}-amd64 ccr.ccs.tencentyun.com/nexent-hub/nexent-ubuntu-terminal:amd64
- name: Push latest terminal image (amd64) to Tencent Cloud
if: inputs.push_latest == 'true'
run: docker push ccr.ccs.tencentyun.com/nexent-hub/nexent-ubuntu-terminal:amd64
build-and-push-terminal-arm64:
runs-on: ${{ fromJson(inputs.runner_label_json) }}
steps:
- name: Set up Docker Buildx
run: |
if ! docker buildx inspect nexent_builder > /dev/null 2>&1; then
docker buildx create --name nexent_builder --use
else
docker buildx use nexent_builder
fi
- name: Checkout code
uses: actions/checkout@v4
- name: Build terminal image (arm64) and load locally
run: |
docker buildx build --platform linux/arm64 --load -t ccr.ccs.tencentyun.com/nexent-hub/nexent-ubuntu-terminal:${{ inputs.version }}-arm64 -f make/terminal/Dockerfile .
- name: Login to Tencent Cloud
run: echo ${{ secrets.TCR_PASSWORD }} | docker login ccr.ccs.tencentyun.com --username=${{ secrets.TCR_USERNAME }} --password-stdin
- name: Push terminal image (arm64) to Tencent Cloud
run: docker push ccr.ccs.tencentyun.com/nexent-hub/nexent-ubuntu-terminal:${{ inputs.version }}-arm64
- name: Tag terminal image (arm64) as latest
if: inputs.push_latest == 'true'
run: docker tag ccr.ccs.tencentyun.com/nexent-hub/nexent-ubuntu-terminal:${{ inputs.version }}-arm64 ccr.ccs.tencentyun.com/nexent-hub/nexent-ubuntu-terminal:arm64
- name: Push latest terminal image (arm64) to Tencent Cloud
if: inputs.push_latest == 'true'
run: docker push ccr.ccs.tencentyun.com/nexent-hub/nexent-ubuntu-terminal:arm64
build-and-push-mcp-amd64:
runs-on: ${{ fromJson(inputs.runner_label_json) }}
steps:
- name: Set up Docker Buildx
run: |
if ! docker buildx inspect nexent_builder > /dev/null 2>&1; then
docker buildx create --name nexent_builder --use
else
docker buildx use nexent_builder
fi
- name: Checkout code
uses: actions/checkout@v4
- name: Build MCP image (amd64) and load locally
run: |
docker buildx build --platform linux/amd64 --load -t ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:${{ inputs.version }}-amd64 -f make/mcp/Dockerfile --build-arg MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple --build-arg APT_MIRROR=tsinghua .
- name: Login to Tencent Cloud
run: echo ${{ secrets.TCR_PASSWORD }} | docker login ccr.ccs.tencentyun.com --username=${{ secrets.TCR_USERNAME }} --password-stdin
- name: Push MCP image (amd64) to Tencent Cloud
run: docker push ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:${{ inputs.version }}-amd64
- name: Tag MCP image (amd64) as latest
if: inputs.push_latest == 'true'
run: docker tag ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:${{ inputs.version }}-amd64 ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:amd64
- name: Push latest MCP image (amd64) to Tencent Cloud
if: inputs.push_latest == 'true'
run: docker push ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:amd64
build-and-push-mcp-arm64:
runs-on: ${{ fromJson(inputs.runner_label_json) }}
steps:
- name: Set up Docker Buildx
run: |
if ! docker buildx inspect nexent_builder > /dev/null 2>&1; then
docker buildx create --name nexent_builder --use
else
docker buildx use nexent_builder
fi
- name: Checkout code
uses: actions/checkout@v4
- name: Build MCP image (arm64) and load locally
run: |
docker buildx build --platform linux/arm64 --load -t ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:${{ inputs.version }}-arm64 -f make/mcp/Dockerfile --build-arg MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple --build-arg APT_MIRROR=tsinghua .
- name: Login to Tencent Cloud
run: echo ${{ secrets.TCR_PASSWORD }} | docker login ccr.ccs.tencentyun.com --username=${{ secrets.TCR_USERNAME }} --password-stdin
- name: Push MCP image (arm64) to Tencent Cloud
run: docker push ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:${{ inputs.version }}-arm64
- name: Tag MCP image (arm64) as latest
if: inputs.push_latest == 'true'
run: docker tag ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:${{ inputs.version }}-arm64 ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:arm64
- name: Push latest MCP image (arm64) to Tencent Cloud
if: inputs.push_latest == 'true'
run: docker push ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:arm64
manifest-push-main:
runs-on: ubuntu-latest
needs:
- build-and-push-main-amd64
- build-and-push-main-arm64
steps:
- name: Login to Tencent Cloud
run: echo ${{ secrets.TCR_PASSWORD }} | docker login ccr.ccs.tencentyun.com --username=${{ secrets.TCR_USERNAME }} --password-stdin
- name: Create and push manifest for main (Tencent Cloud)
run: |
docker manifest create ccr.ccs.tencentyun.com/nexent-hub/nexent:${{ inputs.version }} \
ccr.ccs.tencentyun.com/nexent-hub/nexent:${{ inputs.version }}-amd64 \
ccr.ccs.tencentyun.com/nexent-hub/nexent:${{ inputs.version }}-arm64
docker manifest push ccr.ccs.tencentyun.com/nexent-hub/nexent:${{ inputs.version }}
- name: Create and push latest manifest for main (Tencent Cloud)
if: inputs.push_latest == 'true'
run: |
docker manifest create ccr.ccs.tencentyun.com/nexent-hub/nexent:latest \
ccr.ccs.tencentyun.com/nexent-hub/nexent:amd64 \
ccr.ccs.tencentyun.com/nexent-hub/nexent:arm64
docker manifest push ccr.ccs.tencentyun.com/nexent-hub/nexent:latest
manifest-push-data-process:
runs-on: ubuntu-latest
needs:
- build-and-push-data-process-amd64
- build-and-push-data-process-arm64
steps:
- name: Login to Tencent Cloud
run: echo ${{ secrets.TCR_PASSWORD }} | docker login ccr.ccs.tencentyun.com --username=${{ secrets.TCR_USERNAME }} --password-stdin
- name: Create and push manifest for data-process (Tencent Cloud)
run: |
docker manifest create ccr.ccs.tencentyun.com/nexent-hub/nexent-data-process:${{ inputs.version }} \
ccr.ccs.tencentyun.com/nexent-hub/nexent-data-process:${{ inputs.version }}-amd64 \
ccr.ccs.tencentyun.com/nexent-hub/nexent-data-process:${{ inputs.version }}-arm64
docker manifest push ccr.ccs.tencentyun.com/nexent-hub/nexent-data-process:${{ inputs.version }}
- name: Create and push latest manifest for data-process (Tencent Cloud)
if: inputs.push_latest == 'true'
run: |
docker manifest create ccr.ccs.tencentyun.com/nexent-hub/nexent-data-process:latest \
ccr.ccs.tencentyun.com/nexent-hub/nexent-data-process:amd64 \
ccr.ccs.tencentyun.com/nexent-hub/nexent-data-process:arm64
docker manifest push ccr.ccs.tencentyun.com/nexent-hub/nexent-data-process:latest
manifest-push-web:
runs-on: ubuntu-latest
needs:
- build-and-push-web-amd64
- build-and-push-web-arm64
steps:
- name: Login to Tencent Cloud
run: echo ${{ secrets.TCR_PASSWORD }} | docker login ccr.ccs.tencentyun.com --username=${{ secrets.TCR_USERNAME }} --password-stdin
- name: Create and push manifest for web (Tencent Cloud)
run: |
docker manifest create ccr.ccs.tencentyun.com/nexent-hub/nexent-web:${{ inputs.version }} \
ccr.ccs.tencentyun.com/nexent-hub/nexent-web:${{ inputs.version }}-amd64 \
ccr.ccs.tencentyun.com/nexent-hub/nexent-web:${{ inputs.version }}-arm64
docker manifest push ccr.ccs.tencentyun.com/nexent-hub/nexent-web:${{ inputs.version }}
- name: Create and push latest manifest for web (Tencent Cloud)
if: inputs.push_latest == 'true'
run: |
docker manifest create ccr.ccs.tencentyun.com/nexent-hub/nexent-web:latest \
ccr.ccs.tencentyun.com/nexent-hub/nexent-web:amd64 \
ccr.ccs.tencentyun.com/nexent-hub/nexent-web:arm64
docker manifest push ccr.ccs.tencentyun.com/nexent-hub/nexent-web:latest
manifest-push-terminal:
runs-on: ubuntu-latest
needs:
- build-and-push-terminal-amd64
- build-and-push-terminal-arm64
steps:
- name: Login to Tencent Cloud
run: echo ${{ secrets.TCR_PASSWORD }} | docker login ccr.ccs.tencentyun.com --username=${{ secrets.TCR_USERNAME }} --password-stdin
- name: Create and push manifest for terminal (Tencent Cloud)
run: |
docker manifest create ccr.ccs.tencentyun.com/nexent-hub/nexent-ubuntu-terminal:${{ inputs.version }} \
ccr.ccs.tencentyun.com/nexent-hub/nexent-ubuntu-terminal:${{ inputs.version }}-amd64 \
ccr.ccs.tencentyun.com/nexent-hub/nexent-ubuntu-terminal:${{ inputs.version }}-arm64
docker manifest push ccr.ccs.tencentyun.com/nexent-hub/nexent-ubuntu-terminal:${{ inputs.version }}
- name: Create and push latest manifest for terminal (Tencent Cloud)
if: inputs.push_latest == 'true'
run: |
docker manifest create ccr.ccs.tencentyun.com/nexent-hub/nexent-ubuntu-terminal:latest \
ccr.ccs.tencentyun.com/nexent-hub/nexent-ubuntu-terminal:amd64 \
ccr.ccs.tencentyun.com/nexent-hub/nexent-ubuntu-terminal:arm64
docker manifest push ccr.ccs.tencentyun.com/nexent-hub/nexent-ubuntu-terminal:latest
manifest-push-mcp:
runs-on: ubuntu-latest
needs:
- build-and-push-mcp-amd64
- build-and-push-mcp-arm64
steps:
- name: Login to Tencent Cloud
run: echo ${{ secrets.TCR_PASSWORD }} | docker login ccr.ccs.tencentyun.com --username=${{ secrets.TCR_USERNAME }} --password-stdin
- name: Create and push manifest for mcp (Tencent Cloud)
run: |
docker manifest create ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:${{ inputs.version }} \
ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:${{ inputs.version }}-amd64 \
ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:${{ inputs.version }}-arm64
docker manifest push ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:${{ inputs.version }}
- name: Create and push latest manifest for mcp (Tencent Cloud)
if: inputs.push_latest == 'true'
run: |
docker manifest create ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:latest \
ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:amd64 \
ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:arm64
docker manifest push ccr.ccs.tencentyun.com/nexent-hub/nexent-mcp:latest
================================================
FILE: .github/workflows/docker-build-push-overseas.yml
================================================
name: Docker Build and Push All Images to DockerHub
on:
workflow_dispatch:
inputs:
version:
description: 'Image version tag (e.g. v1.0.0 or latest)'
required: true
default: 'latest'
push_latest:
description: 'Also push latest tag'
required: false
default: false
type: boolean
runner_label_json:
description: 'runner array in json format (e.g. ["ubuntu-latest"] or ["self-hosted"])'
required: true
default: '["ubuntu-latest"]'
jobs:
build-and-push-main-amd64:
runs-on: ${{ fromJson(inputs.runner_label_json) }}
steps:
- name: Set up Docker Buildx
run: |
if ! docker buildx inspect nexent_builder > /dev/null 2>&1; then
docker buildx create --name nexent_builder --use
else
docker buildx use nexent_builder
fi
- name: Checkout code
uses: actions/checkout@v4
- name: Build main image (amd64) and load locally
run: |
docker buildx build --platform linux/amd64 -t nexent/nexent:${{ inputs.version }}-amd64 --load -f make/main/Dockerfile .
- name: Login to DockerHub
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u nexent --password-stdin
- name: Push main image (amd64) to DockerHub
run: docker push nexent/nexent:${{ inputs.version }}-amd64
- name: Tag main image (amd64) as latest
if: inputs.push_latest == 'true'
run: docker tag nexent/nexent:${{ inputs.version }}-amd64 nexent/nexent:amd64
- name: Push latest main image (amd64) to DockerHub
if: inputs.push_latest == 'true'
run: docker push nexent/nexent:amd64
build-and-push-main-arm64:
runs-on: ${{ fromJson(inputs.runner_label_json) }}
steps:
- name: Set up Docker Buildx
run: |
if ! docker buildx inspect nexent_builder > /dev/null 2>&1; then
docker buildx create --name nexent_builder --use
else
docker buildx use nexent_builder
fi
- name: Checkout code
uses: actions/checkout@v4
- name: Build main image (arm64) and load locally
run: |
docker buildx build --platform linux/arm64 -t nexent/nexent:${{ inputs.version }}-arm64 --load -f make/main/Dockerfile .
- name: Login to DockerHub
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u nexent --password-stdin
- name: Push main image (arm64) to DockerHub
run: docker push nexent/nexent:${{ inputs.version }}-arm64
- name: Tag main image (arm64) as latest
if: inputs.push_latest == 'true'
run: docker tag nexent/nexent:${{ inputs.version }}-arm64 nexent/nexent:arm64
- name: Push latest main image (arm64) to DockerHub
if: inputs.push_latest == 'true'
run: docker push nexent/nexent:arm64
build-and-push-data-process-amd64:
runs-on: ${{ fromJson(inputs.runner_label_json) }}
steps:
- name: Free up disk space on GitHub runner
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
- name: Set up Docker Buildx
run: |
if ! docker buildx inspect nexent_builder > /dev/null 2>&1; then
docker buildx create --name nexent_builder --use
else
docker buildx use nexent_builder
fi
- name: Checkout code
uses: actions/checkout@v4
- name: Clone model
run: |
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/Nexent-AI/model-assets
cd ./model-assets
GIT_TRACE=1 GIT_CURL_VERBOSE=1 GIT_LFS_LOG=debug git lfs pull
rm -rf .git .gitattributes
- name: Build data process image (amd64) and load locally
run: |
docker buildx build --platform linux/amd64 -t nexent/nexent-data-process:${{ inputs.version }}-amd64 --load -f make/data_process/Dockerfile .
- name: Login to DockerHub
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u nexent --password-stdin
- name: Push data process image (amd64) to DockerHub
run: docker push nexent/nexent-data-process:${{ inputs.version }}-amd64
- name: Tag data process image (amd64) as latest
if: inputs.push_latest == 'true'
run: docker tag nexent/nexent-data-process:${{ inputs.version }}-amd64 nexent/nexent-data-process:amd64
- name: Push latest data process image (amd64) to DockerHub
if: inputs.push_latest == 'true'
run: docker push nexent/nexent-data-process:amd64
build-and-push-data-process-arm64:
runs-on: ${{ fromJson(inputs.runner_label_json) }}
steps:
- name: Free up disk space on GitHub runner
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
- name: Set up Docker Buildx
run: |
if ! docker buildx inspect nexent_builder > /dev/null 2>&1; then
docker buildx create --name nexent_builder --use
else
docker buildx use nexent_builder
fi
- name: Checkout code
uses: actions/checkout@v4
- name: Clone model
run: |
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/Nexent-AI/model-assets
cd ./model-assets
GIT_TRACE=1 GIT_CURL_VERBOSE=1 GIT_LFS_LOG=debug git lfs pull
rm -rf .git .gitattributes
- name: Build data process image (arm64) and load locally
run: |
docker buildx build --platform linux/arm64 -t nexent/nexent-data-process:${{ inputs.version }}-arm64 --load -f make/data_process/Dockerfile .
- name: Login to DockerHub
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u nexent --password-stdin
- name: Push data process image (arm64) to DockerHub
run: docker push nexent/nexent-data-process:${{ inputs.version }}-arm64
- name: Tag data process image (arm64) as latest
if: inputs.push_latest == 'true'
run: docker tag nexent/nexent-data-process:${{ inputs.version }}-arm64 nexent/nexent-data-process:arm64
- name: Push latest data process image (arm64) to DockerHub
if: inputs.push_latest == 'true'
run: docker push nexent/nexent-data-process:arm64
build-and-push-web-amd64:
runs-on: ${{ fromJson(inputs.runner_label_json) }}
steps:
- name: Set up Docker Buildx
run: |
if ! docker buildx inspect nexent_builder > /dev/null 2>&1; then
docker buildx create --name nexent_builder --use
else
docker buildx use nexent_builder
fi
- name: Checkout code
uses: actions/checkout@v4
- name: Build web image (amd64) and load locally
run: |
docker buildx build --platform linux/amd64 -t nexent/nexent-web:${{ inputs.version }}-amd64 --load -f make/web/Dockerfile .
- name: Login to DockerHub
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u nexent --password-stdin
- name: Push web image (amd64) to DockerHub
run: docker push nexent/nexent-web:${{ inputs.version }}-amd64
- name: Tag web image (amd64) as latest
if: inputs.push_latest == 'true'
run: docker tag nexent/nexent-web:${{ inputs.version }}-amd64 nexent/nexent-web:amd64
- name: Push latest web image (amd64) to DockerHub
if: inputs.push_latest == 'true'
run: docker push nexent/nexent-web:amd64
build-and-push-web-arm64:
runs-on: ${{ fromJson(inputs.runner_label_json) }}
steps:
- name: Set up Docker Buildx
run: |
if ! docker buildx inspect nexent_builder > /dev/null 2>&1; then
docker buildx create --name nexent_builder --use
else
docker buildx use nexent_builder
fi
- name: Checkout code
uses: actions/checkout@v4
- name: Build web image (arm64) and load locally
run: |
docker buildx build --platform linux/arm64 -t nexent/nexent-web:${{ inputs.version }}-arm64 --load -f make/web/Dockerfile .
- name: Login to DockerHub
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u nexent --password-stdin
- name: Push web image (arm64) to DockerHub
run: docker push nexent/nexent-web:${{ inputs.version }}-arm64
- name: Tag web image (arm64) as latest
if: inputs.push_latest == 'true'
run: docker tag nexent/nexent-web:${{ inputs.version }}-arm64 nexent/nexent-web:arm64
- name: Push latest web image (arm64) to DockerHub
if: inputs.push_latest == 'true'
run: docker push nexent/nexent-web:arm64
build-and-push-terminal-amd64:
runs-on: ${{ fromJson(inputs.runner_label_json) }}
steps:
- name: Set up Docker Buildx
run: |
if ! docker buildx inspect nexent_builder > /dev/null 2>&1; then
docker buildx create --name nexent_builder --use
else
docker buildx use nexent_builder
fi
- name: Checkout code
uses: actions/checkout@v4
- name: Build terminal image (amd64) and load locally
run: |
docker buildx build --platform linux/amd64 -t nexent/nexent-ubuntu-terminal:${{ inputs.version }}-amd64 --load -f make/terminal/Dockerfile .
- name: Login to DockerHub
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u nexent --password-stdin
- name: Push terminal image (amd64) to DockerHub
run: docker push nexent/nexent-ubuntu-terminal:${{ inputs.version }}-amd64
- name: Tag terminal image (amd64) as latest
if: inputs.push_latest == 'true'
run: docker tag nexent/nexent-ubuntu-terminal:${{ inputs.version }}-amd64 nexent/nexent-ubuntu-terminal:amd64
- name: Push latest terminal image (amd64) to DockerHub
if: inputs.push_latest == 'true'
run: docker push nexent/nexent-ubuntu-terminal:amd64
build-and-push-terminal-arm64:
runs-on: ${{ fromJson(inputs.runner_label_json) }}
steps:
- name: Set up Docker Buildx
run: |
if ! docker buildx inspect nexent_builder > /dev/null 2>&1; then
docker buildx create --name nexent_builder --use
else
docker buildx use nexent_builder
fi
- name: Checkout code
uses: actions/checkout@v4
- name: Build terminal image (arm64) and load locally
run: |
docker buildx build --platform linux/arm64 -t nexent/nexent-ubuntu-terminal:${{ inputs.version }}-arm64 --load -f make/terminal/Dockerfile .
- name: Login to DockerHub
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u nexent --password-stdin
- name: Push terminal image (arm64) to DockerHub
run: docker push nexent/nexent-ubuntu-terminal:${{ inputs.version }}-arm64
- name: Tag terminal image (arm64) as latest
if: inputs.push_latest == 'true'
run: docker tag nexent/nexent-ubuntu-terminal:${{ inputs.version }}-arm64 nexent/nexent-ubuntu-terminal:arm64
- name: Push latest terminal image (arm64) to DockerHub
if: inputs.push_latest == 'true'
run: docker push nexent/nexent-ubuntu-terminal:arm64
build-and-push-mcp-amd64:
runs-on: ${{ fromJson(inputs.runner_label_json) }}
steps:
- name: Set up Docker Buildx
run: |
if ! docker buildx inspect nexent_builder > /dev/null 2>&1; then
docker buildx create --name nexent_builder --use
else
docker buildx use nexent_builder
fi
- name: Checkout code
uses: actions/checkout@v4
- name: Build MCP image (amd64) and load locally
run: |
docker buildx build --platform linux/amd64 -t nexent/nexent-mcp:${{ inputs.version }}-amd64 --load -f make/mcp/Dockerfile .
- name: Login to DockerHub
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u nexent --password-stdin
- name: Push MCP image (amd64) to DockerHub
run: docker push nexent/nexent-mcp:${{ inputs.version }}-amd64
- name: Tag MCP image (amd64) as latest
if: inputs.push_latest == 'true'
run: docker tag nexent/nexent-mcp:${{ inputs.version }}-amd64 nexent/nexent-mcp:amd64
- name: Push latest MCP image (amd64) to DockerHub
if: inputs.push_latest == 'true'
run: docker push nexent/nexent-mcp:amd64
build-and-push-mcp-arm64:
runs-on: ${{ fromJson(inputs.runner_label_json) }}
steps:
- name: Set up Docker Buildx
run: |
if ! docker buildx inspect nexent_builder > /dev/null 2>&1; then
docker buildx create --name nexent_builder --use
else
docker buildx use nexent_builder
fi
- name: Checkout code
uses: actions/checkout@v4
- name: Build MCP image (arm64) and load locally
run: |
docker buildx build --platform linux/arm64 -t nexent/nexent-mcp:${{ inputs.version }}-arm64 --load -f make/mcp/Dockerfile .
- name: Login to DockerHub
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u nexent --password-stdin
- name: Push MCP image (arm64) to DockerHub
run: docker push nexent/nexent-mcp:${{ inputs.version }}-arm64
- name: Tag MCP image (arm64) as latest
if: inputs.push_latest == 'true'
run: docker tag nexent/nexent-mcp:${{ inputs.version }}-arm64 nexent/nexent-mcp:arm64
- name: Push latest MCP image (arm64) to DockerHub
if: inputs.push_latest == 'true'
run: docker push nexent/nexent-mcp:arm64
manifest-push-main:
runs-on: ubuntu-latest
needs:
- build-and-push-main-amd64
- build-and-push-main-arm64
steps:
- name: Login to DockerHub
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u nexent --password-stdin
- name: Create and push manifest for main (DockerHub)
run: |
docker manifest create nexent/nexent:${{ inputs.version }} \
nexent/nexent:${{ inputs.version }}-amd64 \
nexent/nexent:${{ inputs.version }}-arm64
docker manifest push nexent/nexent:${{ inputs.version }}
- name: Create and push latest manifest for main (DockerHub)
if: inputs.push_latest == 'true'
run: |
docker manifest create nexent/nexent:latest \
nexent/nexent:amd64 \
nexent/nexent:arm64
docker manifest push nexent/nexent:latest
manifest-push-data-process:
runs-on: ubuntu-latest
needs:
- build-and-push-data-process-amd64
- build-and-push-data-process-arm64
steps:
- name: Login to DockerHub
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u nexent --password-stdin
- name: Create and push manifest for data-process (DockerHub)
run: |
docker manifest create nexent/nexent-data-process:${{ inputs.version }} \
nexent/nexent-data-process:${{ inputs.version }}-amd64 \
nexent/nexent-data-process:${{ inputs.version }}-arm64
docker manifest push nexent/nexent-data-process:${{ inputs.version }}
- name: Create and push latest manifest for data-process (DockerHub)
if: inputs.push_latest == 'true'
run: |
docker manifest create nexent/nexent-data-process:latest \
nexent/nexent-data-process:amd64 \
nexent/nexent-data-process:arm64
docker manifest push nexent/nexent-data-process:latest
manifest-push-web:
runs-on: ubuntu-latest
needs:
- build-and-push-web-amd64
- build-and-push-web-arm64
steps:
- name: Login to DockerHub
run: echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login -u nexent --password-stdin
- name: Create and push manifest for web (DockerHub)
run: |
docker manifest create nexent/nexent-web:${{ inputs.version }} \
nexent/nexent-web:${{ inputs.version }}-amd64 \
nexent/nexent-web:${{ inputs.version }}-arm64
docker manifest push nexent/nexent-web:${{ inputs.version }}
- name: Create and push latest manifest for web (DockerHub)
if: inputs.push_latest == 'true'
r
gitextract_mi96_yfc/
├── .claude/
│ └── skills/
│ ├── prompts-writing/
│ │ ├── SKILL.md
│ │ ├── examples.md
│ │ └── references/
│ │ ├── best-practices.md
│ │ └── templates.md
│ └── skill-creator/
│ ├── .openskills.json
│ ├── LICENSE.txt
│ ├── SKILL.md
│ ├── references/
│ │ ├── output-patterns.md
│ │ └── workflows.md
│ └── scripts/
│ ├── init_skill.py
│ ├── package_skill.py
│ └── quick_validate.py
├── .cursor/
│ └── rules/
│ ├── backend/
│ │ ├── app_layer_rules.mdc
│ │ ├── database_layer_rules.mdc
│ │ └── service_layer_rules.mdc
│ ├── english_comments.mdc
│ ├── environment_variable.mdc
│ ├── frontend/
│ │ ├── component_layer_rules.mdc
│ │ ├── frontend_overview_rules.mdc
│ │ ├── hook_layer_rules.mdc
│ │ ├── page_layer_rules.mdc
│ │ ├── service_layer_rules.mdc
│ │ ├── type_layer_rules.mdc
│ │ └── ui_standards_rules.mdc
│ └── pytest_unit_test_rules.mdc
├── .devcontainer/
│ └── devcontainer.json
├── .dockerignore
├── .editorconfig
├── .github/
│ ├── CODEOWNERS
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.yml
│ │ ├── document_issue.yml
│ │ ├── feature_request.yml
│ │ └── improvement_proposal.yml
│ ├── dependabot.yml
│ └── workflows/
│ ├── auto-build-data-process-dev.yml
│ ├── auto-build-doc-dev.yml
│ ├── auto-build-main-dev.yml
│ ├── auto-build-mcp-dev.yml
│ ├── auto-build-terminal-dev.yml
│ ├── auto-build-web-dev.yml
│ ├── auto-image-pull-test.yml
│ ├── auto-unit-test.yml
│ ├── auto-web-check-dev.yml
│ ├── codeql.yml
│ ├── codeql_main.yml
│ ├── deploy-docs.yml
│ ├── docker-build-push-mainland.yml
│ ├── docker-build-push-overseas.yml
│ ├── docker-deploy.yml
│ └── sdk_publish.yml
├── .gitignore
├── AGENTS.md
├── AUTHORS
├── CLAUDE.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── NOTICE
├── README.md
├── README_CN.md
├── SECURITY.md
├── backend/
│ ├── .gitignore
│ ├── __init__.py
│ ├── agents/
│ │ ├── agent_run_manager.py
│ │ ├── create_agent_info.py
│ │ ├── default_agents/
│ │ │ └── __init__.py
│ │ └── preprocess_manager.py
│ ├── apps/
│ │ ├── agent_app.py
│ │ ├── app_factory.py
│ │ ├── config_app.py
│ │ ├── config_sync_app.py
│ │ ├── conversation_management_app.py
│ │ ├── data_process_app.py
│ │ ├── datamate_app.py
│ │ ├── dify_app.py
│ │ ├── file_management_app.py
│ │ ├── group_app.py
│ │ ├── idata_app.py
│ │ ├── image_app.py
│ │ ├── invitation_app.py
│ │ ├── knowledge_summary_app.py
│ │ ├── memory_config_app.py
│ │ ├── mock_user_management_app.py
│ │ ├── model_managment_app.py
│ │ ├── northbound_app.py
│ │ ├── northbound_base_app.py
│ │ ├── prompt_app.py
│ │ ├── remote_mcp_app.py
│ │ ├── runtime_app.py
│ │ ├── tenant_app.py
│ │ ├── tenant_config_app.py
│ │ ├── tool_config_app.py
│ │ ├── user_app.py
│ │ ├── user_management_app.py
│ │ ├── vectordatabase_app.py
│ │ └── voice_app.py
│ ├── assets/
│ │ └── baidu_stopwords.txt
│ ├── config_service.py
│ ├── consts/
│ │ ├── __init__.py
│ │ ├── const.py
│ │ ├── error_code.py
│ │ ├── error_message.py
│ │ ├── exceptions.py
│ │ ├── model.py
│ │ └── provider.py
│ ├── data_process/
│ │ ├── __init__.py
│ │ ├── app.py
│ │ ├── ray_actors.py
│ │ ├── ray_config.py
│ │ ├── tasks.py
│ │ ├── utils.py
│ │ └── worker.py
│ ├── data_process_service.py
│ ├── database/
│ │ ├── __init__.py
│ │ ├── agent_db.py
│ │ ├── agent_version_db.py
│ │ ├── attachment_db.py
│ │ ├── client.py
│ │ ├── conversation_db.py
│ │ ├── db_models.py
│ │ ├── group_db.py
│ │ ├── invitation_db.py
│ │ ├── knowledge_db.py
│ │ ├── memory_config_db.py
│ │ ├── model_management_db.py
│ │ ├── partner_db.py
│ │ ├── remote_mcp_db.py
│ │ ├── role_permission_db.py
│ │ ├── tenant_config_db.py
│ │ ├── token_db.py
│ │ ├── tool_db.py
│ │ ├── user_tenant_db.py
│ │ └── utils.py
│ ├── mcp_service.py
│ ├── middleware/
│ │ ├── __init__.py
│ │ └── exception_handler.py
│ ├── northbound_service.py
│ ├── prompts/
│ │ ├── cluster_summary_reduce_en.yaml
│ │ ├── cluster_summary_reduce_zh.yaml
│ │ ├── document_summary_agent_en.yaml
│ │ ├── document_summary_agent_zh.yaml
│ │ ├── managed_system_prompt_template_en.yaml
│ │ ├── managed_system_prompt_template_zh.yaml
│ │ ├── manager_system_prompt_template_en.yaml
│ │ ├── manager_system_prompt_template_zh.yaml
│ │ └── utils/
│ │ ├── generate_title_en.yaml
│ │ ├── generate_title_zh.yaml
│ │ ├── prompt_generate_en.yaml
│ │ └── prompt_generate_zh.yaml
│ ├── pyproject.toml
│ ├── runtime_service.py
│ ├── services/
│ │ ├── __init__.py
│ │ ├── agent_service.py
│ │ ├── agent_version_service.py
│ │ ├── config_sync_service.py
│ │ ├── conversation_management_service.py
│ │ ├── data_process_service.py
│ │ ├── datamate_service.py
│ │ ├── dify_service.py
│ │ ├── file_management_service.py
│ │ ├── group_service.py
│ │ ├── idata_service.py
│ │ ├── image_service.py
│ │ ├── invitation_service.py
│ │ ├── mcp_container_service.py
│ │ ├── memory_config_service.py
│ │ ├── model_health_service.py
│ │ ├── model_management_service.py
│ │ ├── model_provider_service.py
│ │ ├── northbound_service.py
│ │ ├── prompt_service.py
│ │ ├── providers/
│ │ │ ├── __init__.py
│ │ │ ├── base.py
│ │ │ ├── dashscope_provider.py
│ │ │ ├── modelengine_provider.py
│ │ │ ├── silicon_provider.py
│ │ │ └── tokenpony_provider.py
│ │ ├── redis_service.py
│ │ ├── remote_mcp_service.py
│ │ ├── tenant_service.py
│ │ ├── tool_configuration_service.py
│ │ ├── user_management_service.py
│ │ ├── user_service.py
│ │ ├── vectordatabase_service.py
│ │ └── voice_service.py
│ ├── tool_collection/
│ │ ├── langchain/
│ │ │ └── compute_tool.py
│ │ └── mcp/
│ │ └── local_mcp_service.py
│ └── utils/
│ ├── __init__.py
│ ├── auth_utils.py
│ ├── config_utils.py
│ ├── document_vector_utils.py
│ ├── file_management_utils.py
│ ├── langchain_utils.py
│ ├── llm_utils.py
│ ├── logging_utils.py
│ ├── memory_utils.py
│ ├── model_name_utils.py
│ ├── monitoring.py
│ ├── prompt_template_utils.py
│ ├── str_utils.py
│ ├── task_status_utils.py
│ └── thread_utils.py
├── doc/
│ ├── .gitignore
│ ├── docs/
│ │ ├── .vitepress/
│ │ │ ├── config.mts
│ │ │ └── theme/
│ │ │ ├── index.ts
│ │ │ └── style.css
│ │ ├── en/
│ │ │ ├── backend/
│ │ │ │ ├── api-reference.md
│ │ │ │ ├── overview.md
│ │ │ │ ├── prompt-development.md
│ │ │ │ ├── tools/
│ │ │ │ │ ├── index.md
│ │ │ │ │ ├── langchain.md
│ │ │ │ │ ├── mcp.md
│ │ │ │ │ └── nexent-native.md
│ │ │ │ └── version-management.md
│ │ │ ├── code-of-conduct.md
│ │ │ ├── contributing.md
│ │ │ ├── contributors.md
│ │ │ ├── deployment/
│ │ │ │ ├── devcontainer.md
│ │ │ │ └── docker-build.md
│ │ │ ├── developer-guide/
│ │ │ │ ├── environment-setup.md
│ │ │ │ └── overview.md
│ │ │ ├── docs-development.md
│ │ │ ├── frontend/
│ │ │ │ └── overview.md
│ │ │ ├── getting-started/
│ │ │ │ ├── features.md
│ │ │ │ ├── overview.md
│ │ │ │ └── software-architecture.md
│ │ │ ├── license.md
│ │ │ ├── mcp-ecosystem/
│ │ │ │ ├── mcp-recommendations.md
│ │ │ │ ├── overview.md
│ │ │ │ └── use-cases.md
│ │ │ ├── opensource-memorial-wall.md
│ │ │ ├── quick-start/
│ │ │ │ ├── faq.md
│ │ │ │ ├── installation.md
│ │ │ │ └── upgrade-guide.md
│ │ │ ├── sdk/
│ │ │ │ ├── basic-usage.md
│ │ │ │ ├── core/
│ │ │ │ │ ├── agents.md
│ │ │ │ │ ├── models.md
│ │ │ │ │ ├── multimodal.md
│ │ │ │ │ └── tools.md
│ │ │ │ ├── data-process.md
│ │ │ │ ├── features.md
│ │ │ │ ├── monitoring.md
│ │ │ │ ├── overview.md
│ │ │ │ └── vector-database.md
│ │ │ ├── security.md
│ │ │ ├── testing/
│ │ │ │ ├── backend.md
│ │ │ │ └── overview.md
│ │ │ └── user-guide/
│ │ │ ├── agent-development.md
│ │ │ ├── agent-market.md
│ │ │ ├── agent-space.md
│ │ │ ├── home-page.md
│ │ │ ├── knowledge-base.md
│ │ │ ├── local-tools/
│ │ │ │ ├── email-tools.md
│ │ │ │ ├── file-tools.md
│ │ │ │ ├── index.md
│ │ │ │ ├── multimodal-tools.md
│ │ │ │ ├── search-tools.md
│ │ │ │ └── terminal-tool.md
│ │ │ ├── mcp-tools.md
│ │ │ ├── memory-management.md
│ │ │ ├── model-management.md
│ │ │ ├── monitor.md
│ │ │ ├── quick-setup.md
│ │ │ ├── start-chat.md
│ │ │ └── user-management.md
│ │ ├── index.md
│ │ └── zh/
│ │ ├── backend/
│ │ │ ├── api-reference.md
│ │ │ ├── overview.md
│ │ │ ├── prompt-development.md
│ │ │ ├── tools/
│ │ │ │ ├── index.md
│ │ │ │ ├── langchain.md
│ │ │ │ ├── mcp.md
│ │ │ │ └── nexent-native.md
│ │ │ └── version-management.md
│ │ ├── code-of-conduct.md
│ │ ├── contributing.md
│ │ ├── contributors.md
│ │ ├── deployment/
│ │ │ ├── devcontainer.md
│ │ │ └── docker-build.md
│ │ ├── developer-guide/
│ │ │ ├── environment-setup.md
│ │ │ └── overview.md
│ │ ├── docs-development.md
│ │ ├── frontend/
│ │ │ └── overview.md
│ │ ├── getting-started/
│ │ │ ├── features.md
│ │ │ ├── overview.md
│ │ │ └── software-architecture.md
│ │ ├── license.md
│ │ ├── mcp-ecosystem/
│ │ │ ├── mcp-recommendations.md
│ │ │ ├── overview.md
│ │ │ └── use-cases.md
│ │ ├── opensource-memorial-wall.md
│ │ ├── quick-start/
│ │ │ ├── faq.md
│ │ │ ├── installation.md
│ │ │ └── upgrade-guide.md
│ │ ├── sdk/
│ │ │ ├── basic-usage.md
│ │ │ ├── core/
│ │ │ │ ├── agents.md
│ │ │ │ ├── models.md
│ │ │ │ ├── multimodal.md
│ │ │ │ └── tools.md
│ │ │ ├── data-process.md
│ │ │ ├── features.md
│ │ │ ├── monitoring.md
│ │ │ ├── overview.md
│ │ │ └── vector-database.md
│ │ ├── security.md
│ │ ├── testing/
│ │ │ ├── backend.md
│ │ │ └── overview.md
│ │ └── user-guide/
│ │ ├── agent-development.md
│ │ ├── agent-market.md
│ │ ├── agent-space.md
│ │ ├── home-page.md
│ │ ├── knowledge-base.md
│ │ ├── local-tools/
│ │ │ ├── email-tools.md
│ │ │ ├── file-tools.md
│ │ │ ├── index.md
│ │ │ ├── multimodal-tools.md
│ │ │ ├── search-tools.md
│ │ │ └── terminal-tool.md
│ │ ├── mcp-tools.md
│ │ ├── memory-management.md
│ │ ├── model-management.md
│ │ ├── monitor.md
│ │ ├── quick-setup.md
│ │ ├── start-chat.md
│ │ └── user-management.md
│ ├── package.json
│ └── pnpm-workspace.yaml
├── docker/
│ ├── create-su.sh
│ ├── deploy.sh
│ ├── docker-compose-monitoring.yml
│ ├── docker-compose-supabase.prod.yml
│ ├── docker-compose-supabase.yml
│ ├── docker-compose.dev.yml
│ ├── docker-compose.prod.yml
│ ├── docker-compose.yml
│ ├── generate_env.sh
│ ├── init.sql
│ ├── monitoring/
│ │ ├── grafana/
│ │ │ ├── dashboards/
│ │ │ │ └── nexent-llm-performance.json
│ │ │ └── provisioning/
│ │ │ ├── dashboards/
│ │ │ │ └── dashboards.yml
│ │ │ └── datasources/
│ │ │ └── datasources.yml
│ │ ├── monitoring.env
│ │ ├── monitoring.env.example
│ │ ├── otel-collector-config.yml
│ │ └── prometheus.yml
│ ├── openssh-install-script.sh
│ ├── scripts/
│ │ ├── sync_user_supabase2pg.py
│ │ └── v180_sync_user_metadata.sh
│ ├── sql/
│ │ ├── v1.1.0_0619_add_tenant_config_t.sql
│ │ ├── v1.2.0_0627_increase_config_value_length.sql
│ │ ├── v1.3.0_0630_add_mcp_record_t.sql
│ │ ├── v1.4.0_0708_add_user_tenant_t.sql
│ │ ├── v1.5.0_0715_add_knowledge_describe_length.sql
│ │ ├── v1.5.0_0716_add_status_to_mcp_record_t.sql
│ │ ├── v1.6.0_0722_modify_tenant_agent.sql
│ │ ├── v1.6.0_0723_add_agent_relation_t.sql
│ │ ├── v1.7.1_0805_add_deep_thinking_to_model_record_t.sql
│ │ ├── v1.7.1_0806_add_memory_user_config.sql
│ │ ├── v1.7.2.2_0820_add_partner_mapping_id_t.sql
│ │ ├── v1.7.2_0809_add_name_zh_to_ag_tenant_agent_t.sql
│ │ ├── v1.7.2_0812_modify_model_record_t.sql
│ │ ├── v1.7.3.2_0902_add_model_name_to_knowledge_record_t.sql
│ │ ├── v1.7.4.1_1011_add_origin_tool_name_to_ag_tool_info.sql
│ │ ├── v1.7.4.1_1013_add_tool_group_to_ag_tool_info.sql
│ │ ├── v1.7.4_0928_add_model_id_to_ag_tenant_agent_t.sql
│ │ ├── v1.7.5.1_1028_add_chunk_size_to_model_record_t.sql
│ │ ├── v1.7.5_1024_add_business_logic_model_fields.sql
│ │ ├── v1.7.5_1024_alter_tenant_config_t_config_value.sql
│ │ ├── v1.7.7_1129_add_ssl_verify_to_model_record_t.sql
│ │ ├── v1.7.8_1204_add_knowledge_name_to_knowledge_record_t.sql
│ │ ├── v1.7.8_add_author_to_ag_tenant_agent_t.sql
│ │ ├── v1.7.9.2_1226_add_invitation_and_group_system.sql
│ │ ├── v1.7.9.3_0122_add_is_new_to_ag_tenant_agent_t.sql
│ │ ├── v1.7.9.3_0123_add_speed_user_tenant_t.sql
│ │ ├── v1.7.9_1219_add_container_id_to_mcp_record_t.sql
│ │ ├── v1.8.0.1_0224_init_agent_id_seq.sql
│ │ ├── v1.8.0.1_0225_delete_empty_tenant.sql
│ │ ├── v1.8.0.1_0226_add_authorization_token_to_mcp_record_t.sql
│ │ ├── v1.8.0.2_0227_add_ingroup_permission_to_ag_tenant_agent_t.sql
│ │ ├── v1.8.0.2_0302_add_tool_instance_id_seq_and_agent_relation_id_seq.sql
│ │ ├── v1.8.0_0204_init_tenant_group.sql
│ │ ├── v1.8.0_0206_add_ag_tenant_agent_version_t .sql
│ │ ├── v1.8.0_0206_init_role_permission_t.sql
│ │ └── v1.8.1_0306_add_user_token_info.sql
│ ├── start-monitoring.sh
│ ├── uninstall.sh
│ ├── upgrade.sh
│ └── volumes/
│ ├── api/
│ │ └── kong.yml
│ ├── db/
│ │ ├── _supabase.sql
│ │ ├── init/
│ │ │ └── data.sql
│ │ ├── jwt.sql
│ │ ├── logs.sql
│ │ ├── pooler.sql
│ │ ├── realtime.sql
│ │ ├── roles.sql
│ │ └── webhooks.sql
│ ├── functions/
│ │ ├── hello/
│ │ │ └── index.ts
│ │ └── main/
│ │ └── index.ts
│ ├── logs/
│ │ └── vector.yml
│ └── pooler/
│ └── pooler.exs
├── experimental/
│ └── tune/
│ ├── base/
│ │ ├── case.py
│ │ ├── constant.py
│ │ ├── context_manager.py
│ │ ├── exception.py
│ │ └── utils.py
│ ├── common/
│ │ ├── exception.py
│ │ └── singleton.py
│ ├── joint_evaluator.py
│ ├── joint_optimizer.py
│ └── joint_prompt_pool.yaml
├── frontend/
│ ├── .eslintrc.json
│ ├── .gitignore
│ ├── .prettierignore
│ ├── .prettierrc
│ ├── app/
│ │ └── [locale]/
│ │ ├── agents/
│ │ │ ├── AgentVersionCard.tsx
│ │ │ ├── AgentVersionManage.tsx
│ │ │ ├── components/
│ │ │ │ ├── AgentConfigComp.tsx
│ │ │ │ ├── AgentInfoComp.tsx
│ │ │ │ ├── AgentManageComp.tsx
│ │ │ │ ├── agentConfig/
│ │ │ │ │ ├── CollaborativeAgent.tsx
│ │ │ │ │ ├── McpConfigModal.tsx
│ │ │ │ │ ├── ToolManagement.tsx
│ │ │ │ │ └── tool/
│ │ │ │ │ ├── ToolConfigModal.tsx
│ │ │ │ │ └── ToolTestPanel.tsx
│ │ │ │ ├── agentInfo/
│ │ │ │ │ ├── AgentGenerateDetail.tsx
│ │ │ │ │ ├── DebugConfig.tsx
│ │ │ │ │ └── ExpandEditModal.tsx
│ │ │ │ └── agentManage/
│ │ │ │ ├── AgentCallRelationshipModal.tsx
│ │ │ │ └── AgentList.tsx
│ │ │ ├── page.tsx
│ │ │ └── versions/
│ │ │ ├── AgentVersionCompareModal.tsx
│ │ │ └── AgentVersionPubulishModal.tsx
│ │ ├── chat/
│ │ │ ├── components/
│ │ │ │ ├── chatAgentSelector.tsx
│ │ │ │ ├── chatHeader.tsx
│ │ │ │ ├── chatInput.tsx
│ │ │ │ ├── chatLeftSidebar.tsx
│ │ │ │ └── chatRightPanel.tsx
│ │ │ ├── internal/
│ │ │ │ ├── ChatTopNavContent.tsx
│ │ │ │ ├── chatAttachment.tsx
│ │ │ │ ├── chatHelpers.tsx
│ │ │ │ ├── chatInterface.tsx
│ │ │ │ ├── chatPreprocess.tsx
│ │ │ │ └── extractMsgFromHistoryResponse.tsx
│ │ │ ├── page.tsx
│ │ │ └── streaming/
│ │ │ ├── chatStreamFinalMessage.tsx
│ │ │ ├── chatStreamHandler.tsx
│ │ │ ├── chatStreamMain.tsx
│ │ │ ├── messageTransformer.ts
│ │ │ └── taskWindow.tsx
│ │ ├── i18n.tsx
│ │ ├── knowledges/
│ │ │ ├── KnowledgeBaseConfiguration.tsx
│ │ │ ├── components/
│ │ │ │ ├── document/
│ │ │ │ │ ├── DocumentChunk.tsx
│ │ │ │ │ ├── DocumentList.tsx
│ │ │ │ │ └── DocumentStatus.tsx
│ │ │ │ ├── knowledge/
│ │ │ │ │ ├── KnowledgeBaseEditModal.tsx
│ │ │ │ │ └── KnowledgeBaseList.tsx
│ │ │ │ └── upload/
│ │ │ │ ├── UploadArea.tsx
│ │ │ │ └── UploadAreaUI.tsx
│ │ │ ├── contexts/
│ │ │ │ ├── DocumentContext.tsx
│ │ │ │ ├── KnowledgeBaseContext.tsx
│ │ │ │ └── UIStateContext.tsx
│ │ │ └── page.tsx
│ │ ├── layout.client.tsx
│ │ ├── layout.tsx
│ │ ├── market/
│ │ │ ├── MarketContent.css
│ │ │ ├── components/
│ │ │ │ ├── AgentMarketCard.tsx
│ │ │ │ ├── MarketAgentDetailModal.tsx
│ │ │ │ └── MarketErrorState.tsx
│ │ │ └── page.tsx
│ │ ├── mcp-tools/
│ │ │ └── page.tsx
│ │ ├── memory/
│ │ │ ├── MemoryMenuList.tsx
│ │ │ ├── memory.css
│ │ │ └── page.tsx
│ │ ├── models/
│ │ │ ├── ModelConfiguration.tsx
│ │ │ ├── components/
│ │ │ │ ├── appConfig.tsx
│ │ │ │ ├── model/
│ │ │ │ │ ├── ModelAddDialog.tsx
│ │ │ │ │ ├── ModelChunkSizeSilder.tsx
│ │ │ │ │ ├── ModelDeleteDialog.tsx
│ │ │ │ │ ├── ModelEditDialog.tsx
│ │ │ │ │ └── ModelListCard.tsx
│ │ │ │ └── modelConfig.tsx
│ │ │ └── page.tsx
│ │ ├── monitoring/
│ │ │ └── page.tsx
│ │ ├── page.tsx
│ │ ├── setup/
│ │ │ └── page.tsx
│ │ ├── space/
│ │ │ ├── components/
│ │ │ │ ├── AgentCard.tsx
│ │ │ │ └── AgentDetailModal.tsx
│ │ │ └── page.tsx
│ │ ├── tenant-resources/
│ │ │ ├── components/
│ │ │ │ ├── UserManageComp.tsx
│ │ │ │ └── resources/
│ │ │ │ ├── AgentList.tsx
│ │ │ │ ├── GroupList.tsx
│ │ │ │ ├── InvitationList.tsx
│ │ │ │ ├── KnowledgeList.tsx
│ │ │ │ ├── McpList.tsx
│ │ │ │ ├── ModelList.tsx
│ │ │ │ └── UserList.tsx
│ │ │ └── page.tsx
│ │ └── users/
│ │ ├── components/
│ │ │ └── UserProfileComp.tsx
│ │ └── page.tsx
│ ├── components/
│ │ ├── agent/
│ │ │ └── AgentImportWizard.tsx
│ │ ├── auth/
│ │ │ ├── AuthDialogs.tsx
│ │ │ ├── DeleteAccountModal.tsx
│ │ │ ├── avatarDropdown.tsx
│ │ │ ├── loginModal.tsx
│ │ │ └── registerModal.tsx
│ │ ├── mcp/
│ │ │ ├── McpContainerLogsModal.tsx
│ │ │ ├── McpEditServerModal.tsx
│ │ │ └── McpToolListModal.tsx
│ │ ├── navigation/
│ │ │ ├── ChatTopNavContent.tsx
│ │ │ ├── FooterLayout.tsx
│ │ │ ├── SideNavigation.tsx
│ │ │ └── TopNavbar.tsx
│ │ ├── permission/
│ │ │ ├── Can.tsx
│ │ │ └── Cannot.tsx
│ │ ├── providers/
│ │ │ ├── AuthenticationProvider.tsx
│ │ │ ├── AuthorizationProvider.tsx
│ │ │ ├── I18nProviderWrapper.tsx
│ │ │ ├── deploymentProvider.tsx
│ │ │ └── rootProvider.tsx
│ │ ├── tool-config/
│ │ │ ├── KnowledgeBaseSelectorModal.tsx
│ │ │ └── index.ts
│ │ └── ui/
│ │ ├── AgentCallRelationshipModal.tsx
│ │ ├── Diagram.tsx
│ │ ├── card.tsx
│ │ ├── copyButton.tsx
│ │ ├── input.tsx
│ │ ├── loading.tsx
│ │ ├── markdownRenderer.tsx
│ │ ├── scrollArea.tsx
│ │ ├── statusBadge.tsx
│ │ ├── textarea.tsx
│ │ └── tooltip.tsx
│ ├── components.json
│ ├── const/
│ │ ├── agentConfig.ts
│ │ ├── auth.ts
│ │ ├── avatar.ts
│ │ ├── chatConfig.ts
│ │ ├── constants.ts
│ │ ├── errorCode.ts
│ │ ├── errorMessage.ts
│ │ ├── errorMessageI18n.ts
│ │ ├── knowledgeBase.ts
│ │ ├── knowledgeBaseLayout.ts
│ │ ├── layoutConstants.ts
│ │ ├── marketConfig.ts
│ │ ├── memoryConfig.ts
│ │ └── modelConfig.ts
│ ├── hooks/
│ │ ├── agent/
│ │ │ ├── useAgentInfo.ts
│ │ │ ├── useAgentList.ts
│ │ │ ├── useAgentVersion.ts
│ │ │ ├── useAgentVersionDetail.ts
│ │ │ ├── useAgentVersionList.ts
│ │ │ ├── usePublishedAgentList.ts
│ │ │ ├── useSaveGuard.ts
│ │ │ └── useToolList.ts
│ │ ├── auth/
│ │ │ ├── useAuthentication.ts
│ │ │ ├── useAuthenticationState.ts
│ │ │ ├── useAuthenticationUI.ts
│ │ │ ├── useAuthorization.ts
│ │ │ └── useSessionManager.ts
│ │ ├── chat/
│ │ │ └── useConversationManagement.ts
│ │ ├── group/
│ │ │ └── useGroupList.ts
│ │ ├── invitation/
│ │ │ └── useInvitationList.ts
│ │ ├── knowledge/
│ │ │ └── useKnowledgeList.ts
│ │ ├── mcp/
│ │ │ ├── useMcpContainerList.ts
│ │ │ └── useMcpServerList.ts
│ │ ├── model/
│ │ │ ├── useDashscopeModelList.ts
│ │ │ ├── useManageTenantModels.ts
│ │ │ ├── useModelList.ts
│ │ │ ├── useSiliconModelList.ts
│ │ │ └── useTokenponyModelList.ts
│ │ ├── permission/
│ │ │ └── usePermission.ts
│ │ ├── tenant/
│ │ │ └── useTenantList.ts
│ │ ├── tool/
│ │ │ └── useToolInfo.ts
│ │ ├── useAgentImport.ts
│ │ ├── useChatTaskMessage.ts
│ │ ├── useConfig.ts
│ │ ├── useConfirmModal.ts
│ │ ├── useErrorHandler.ts
│ │ ├── useKnowledgeBaseConfigChangeHandler.ts
│ │ ├── useKnowledgeBaseSelector.ts
│ │ ├── useMcpConfig.ts
│ │ ├── useMemory.ts
│ │ ├── useModalPosition.ts
│ │ ├── useResponsiveTextSize.ts
│ │ ├── useSetupFlow.ts
│ │ └── user/
│ │ └── useUserList.ts
│ ├── lib/
│ │ ├── agentDebugErrorCache.ts
│ │ ├── agentLabelMapper.ts
│ │ ├── auth.ts
│ │ ├── authEvents.ts
│ │ ├── avatar.tsx
│ │ ├── clipboard.ts
│ │ ├── date.ts
│ │ ├── language.ts
│ │ ├── logger.ts
│ │ ├── providerError.ts
│ │ ├── session.ts
│ │ ├── utils.ts
│ │ └── viewPersistence.ts
│ ├── middleware.ts
│ ├── next.config.mjs
│ ├── package.json
│ ├── pnpm-workspace.yaml
│ ├── postcss.config.mjs
│ ├── public/
│ │ └── locales/
│ │ ├── en/
│ │ │ └── common.json
│ │ └── zh/
│ │ └── common.json
│ ├── server.js
│ ├── services/
│ │ ├── agentConfigService.ts
│ │ ├── agentVersionService.ts
│ │ ├── api.ts
│ │ ├── authService.ts
│ │ ├── configService.ts
│ │ ├── conversationService.ts
│ │ ├── groupService.ts
│ │ ├── invitationService.ts
│ │ ├── knowledgeBasePollingService.ts
│ │ ├── knowledgeBaseService.ts
│ │ ├── marketService.ts
│ │ ├── mcpService.ts
│ │ ├── memoryService.ts
│ │ ├── modelService.ts
│ │ ├── promptService.ts
│ │ ├── sessionService.ts
│ │ ├── storageService.ts
│ │ ├── tenantService.ts
│ │ ├── tokenService.ts
│ │ ├── uploadService.ts
│ │ └── userService.ts
│ ├── stores/
│ │ └── agentConfigStore.ts
│ ├── styles/
│ │ ├── globals.css
│ │ └── react-markdown.css
│ ├── tailwind.config.ts
│ ├── tsconfig.json
│ └── types/
│ ├── agentConfig.ts
│ ├── auth.ts
│ ├── chat.ts
│ ├── conversation.ts
│ ├── knowledgeBase.ts
│ ├── market.ts
│ ├── memory.ts
│ └── modelConfig.ts
├── make/
│ ├── data_process/
│ │ └── Dockerfile
│ ├── docs/
│ │ └── Dockerfile
│ ├── main/
│ │ └── Dockerfile
│ ├── mcp/
│ │ └── Dockerfile
│ ├── terminal/
│ │ ├── Dockerfile
│ │ └── entrypoint.sh
│ └── web/
│ └── Dockerfile
├── pathology-ai/
│ ├── README.md
│ ├── agent-config.md
│ ├── architecture.md
│ ├── code-changes/
│ │ ├── backend/
│ │ │ └── local_mcp_service.py
│ │ ├── docker/
│ │ │ └── update_prompt_btn.sql
│ │ ├── frontend/
│ │ │ ├── DiagnosisConfidenceCard.tsx
│ │ │ ├── MedicalVisualizationPanel.tsx
│ │ │ ├── PathologyImageGallery.tsx
│ │ │ ├── SourceTag.tsx
│ │ │ ├── chatLeftSidebar.tsx
│ │ │ ├── conversationService.ts
│ │ │ ├── index.ts
│ │ │ └── markdownRenderer.tsx
│ │ └── medical_extension/
│ │ ├── __init__.py
│ │ ├── agent_templates.py
│ │ ├── api.py
│ │ ├── chain_of_diagnosis.py
│ │ ├── confidence_evaluator.py
│ │ ├── medical_prompts.py
│ │ └── test_medical.py
│ ├── custom-tools.md
│ └── frontend-improvements.md
├── sdk/
│ ├── nexent/
│ │ ├── __init__.py
│ │ ├── container/
│ │ │ ├── __init__.py
│ │ │ ├── container_client_base.py
│ │ │ ├── container_client_factory.py
│ │ │ ├── docker_client.py
│ │ │ └── docker_config.py
│ │ ├── core/
│ │ │ ├── __init__.py
│ │ │ ├── agents/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── agent_model.py
│ │ │ │ ├── core_agent.py
│ │ │ │ ├── nexent_agent.py
│ │ │ │ └── run_agent.py
│ │ │ ├── models/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── embedding_model.py
│ │ │ │ ├── message_utils.py
│ │ │ │ ├── openai_llm.py
│ │ │ │ ├── openai_long_context_model.py
│ │ │ │ ├── openai_vlm.py
│ │ │ │ ├── stt_model.py
│ │ │ │ └── tts_model.py
│ │ │ ├── nlp/
│ │ │ │ ├── __init__.py
│ │ │ │ ├── stopwords.py
│ │ │ │ └── tokenizer.py
│ │ │ ├── prompts/
│ │ │ │ ├── analyze_file_en.yaml
│ │ │ │ ├── analyze_file_zh.yaml
│ │ │ │ ├── analyze_image_en.yaml
│ │ │ │ └── analyze_image_zh.yaml
│ │ │ ├── tools/
│ │ │ │ ├── README.md
│ │ │ │ ├── README_EN.md
│ │ │ │ ├── __init__.py
│ │ │ │ ├── analyze_image_tool.py
│ │ │ │ ├── analyze_text_file_tool.py
│ │ │ │ ├── create_directory_tool.py
│ │ │ │ ├── create_file_tool.py
│ │ │ │ ├── datamate_search_tool.py
│ │ │ │ ├── delete_directory_tool.py
│ │ │ │ ├── delete_file_tool.py
│ │ │ │ ├── dify_search_tool.py
│ │ │ │ ├── exa_search_tool.py
│ │ │ │ ├── get_email_tool.py
│ │ │ │ ├── idata_search_tool.py
│ │ │ │ ├── knowledge_base_search_tool.py
│ │ │ │ ├── linkup_search_tool.py
│ │ │ │ ├── list_directory_tool.py
│ │ │ │ ├── move_item_tool.py
│ │ │ │ ├── read_file_tool.py
│ │ │ │ ├── send_email_tool.py
│ │ │ │ ├── tavily_search_tool.py
│ │ │ │ └── terminal_tool.py
│ │ │ └── utils/
│ │ │ ├── __init__.py
│ │ │ ├── constants.py
│ │ │ ├── favicon_extractor.py
│ │ │ ├── observer.py
│ │ │ ├── prompt_template_utils.py
│ │ │ └── tools_common_message.py
│ │ ├── data_process/
│ │ │ ├── __init__.py
│ │ │ ├── base.py
│ │ │ ├── core.py
│ │ │ ├── openpyxl_processor.py
│ │ │ └── unstructured_processor.py
│ │ ├── datamate/
│ │ │ ├── __init__.py
│ │ │ └── datamate_client.py
│ │ ├── memory/
│ │ │ ├── __init__.py
│ │ │ ├── embedder_adaptor.py
│ │ │ ├── memory_core.py
│ │ │ ├── memory_service.py
│ │ │ └── memory_utils.py
│ │ ├── monitor/
│ │ │ ├── __init__.py
│ │ │ └── monitoring.py
│ │ ├── multi_modal/
│ │ │ ├── __init__.py
│ │ │ ├── load_save_object.py
│ │ │ └── utils.py
│ │ ├── storage/
│ │ │ ├── __init__.py
│ │ │ ├── minio.py
│ │ │ ├── minio_config.py
│ │ │ ├── storage_client_base.py
│ │ │ └── storage_client_factory.py
│ │ ├── utils/
│ │ │ ├── __init__.py
│ │ │ └── http_client_manager.py
│ │ └── vector_database/
│ │ ├── __init__.py
│ │ ├── base.py
│ │ ├── datamate_core.py
│ │ ├── elasticsearch_core.py
│ │ └── utils.py
│ └── pyproject.toml
└── test/
├── .coveragerc
├── __init__.py
├── assets/
│ ├── test_data_process_doc.txt
│ ├── test_data_process_sheet.xlsx
│ ├── test_prompt.yaml
│ ├── test_sub_prompt.yaml
│ └── test_voice.html
├── backend/
│ ├── __init__.py
│ ├── agents/
│ │ ├── test_agent_run_manager.py
│ │ ├── test_create_agent_info.py
│ │ └── test_preprocess_manager.py
│ ├── app/
│ │ ├── test_agent_app.py
│ │ ├── test_app_factory.py
│ │ ├── test_config_app.py
│ │ ├── test_config_sync_app.py
│ │ ├── test_conversation_management_app.py
│ │ ├── test_data_process_app.py
│ │ ├── test_datamate_app.py
│ │ ├── test_dify_app.py
│ │ ├── test_file_management_app.py
│ │ ├── test_group_app.py
│ │ ├── test_idata_app.py
│ │ ├── test_image_app.py
│ │ ├── test_invitation_app.py
│ │ ├── test_knowledge_summary_app.py
│ │ ├── test_memory_config_app.py
│ │ ├── test_mock_user_management_app.py
│ │ ├── test_model_managment_app.py
│ │ ├── test_northbound_app.py
│ │ ├── test_northbound_base_app.py
│ │ ├── test_remote_mcp_app.py
│ │ ├── test_tenant_app.py
│ │ ├── test_tenant_config_app.py
│ │ ├── test_tool_config_app.py
│ │ ├── test_user_app.py
│ │ ├── test_user_management_app.py
│ │ ├── test_vectordatabase_app.py
│ │ └── test_voice_app.py
│ ├── consts/
│ │ ├── test_error_code.py
│ │ ├── test_error_message.py
│ │ └── test_exceptions.py
│ ├── data_process/
│ │ ├── __init__.py
│ │ ├── test_ray_actors.py
│ │ ├── test_ray_config.py
│ │ ├── test_tasks.py
│ │ └── test_worker.py
│ ├── database/
│ │ ├── test_agent_db.py
│ │ ├── test_agent_version_db.py
│ │ ├── test_attachment_db.py
│ │ ├── test_client.py
│ │ ├── test_conversation_db.py
│ │ ├── test_group_db.py
│ │ ├── test_invitation_db.py
│ │ ├── test_knowledge_db.py
│ │ ├── test_memory_config_db.py
│ │ ├── test_model_managment_db.py
│ │ ├── test_partner_db.py
│ │ ├── test_remote_mcp_db.py
│ │ ├── test_role_permission_db.py
│ │ ├── test_tenant_config_db.py
│ │ ├── test_token_db.py
│ │ ├── test_tool_db.py
│ │ └── test_user_tenant_db.py
│ ├── middleware/
│ │ └── test_exception_handler.py
│ ├── services/
│ │ ├── __init__.py
│ │ ├── providers/
│ │ │ ├── __init__.py
│ │ │ ├── test_base.py
│ │ │ ├── test_dashscope_provider.py
│ │ │ ├── test_modelengine_provider.py
│ │ │ ├── test_silicon_provider.py
│ │ │ └── test_tokenpony_provider.py
│ │ ├── test_agent_service.py
│ │ ├── test_agent_version_service.py
│ │ ├── test_config_sync_service.py
│ │ ├── test_conversation_management_service.py
│ │ ├── test_data_process_service.py
│ │ ├── test_datamate_service.py
│ │ ├── test_dify_service.py
│ │ ├── test_file_management_service.py
│ │ ├── test_group_service.py
│ │ ├── test_idata_service.py
│ │ ├── test_image_service.py
│ │ ├── test_invitation_service.py
│ │ ├── test_mcp_container_service.py
│ │ ├── test_memory_config_service.py
│ │ ├── test_model_health_service.py
│ │ ├── test_model_management_service.py
│ │ ├── test_model_provider_service.py
│ │ ├── test_northbound_service.py
│ │ ├── test_prompt_service.py
│ │ ├── test_redis_service.py
│ │ ├── test_remote_mcp_service.py
│ │ ├── test_tenant_service.py
│ │ ├── test_tool_configuration_service.py
│ │ ├── test_user_management_service.py
│ │ ├── test_user_service.py
│ │ ├── test_vectordatabase_service.py
│ │ └── test_voice_service.py
│ ├── test_cluster_summarization.py
│ ├── test_document_vector_integration.py
│ ├── test_document_vector_utils.py
│ ├── test_document_vector_utils_coverage.py
│ ├── test_llm_integration.py
│ ├── test_model_consts.py
│ ├── test_runtime_service.py
│ ├── test_summary_formatting.py
│ └── utils/
│ ├── __init__.py
│ ├── test_auth_utils.py
│ ├── test_config_utils.py
│ ├── test_file_management_utils.py
│ ├── test_langchain_utils.py
│ ├── test_llm_utils.py
│ ├── test_memory_utils.py
│ ├── test_model_name_utils.py
│ ├── test_monitoring.py
│ ├── test_prompt_template_utils.py
│ └── test_str_utils.py
├── common/
│ ├── __init__.py
│ └── test_mocks.py
├── conftest.py
├── pytest.ini
├── run_all_test.py
└── sdk/
├── __init__.py
├── container/
│ ├── __init__.py
│ ├── test_container_client_base.py
│ ├── test_container_client_factory.py
│ ├── test_docker_client.py
│ └── test_docker_config.py
├── core/
│ ├── agents/
│ │ ├── test_core_agent.py
│ │ ├── test_nexent_agent.py
│ │ └── test_run_agent.py
│ ├── models/
│ │ ├── test_embedding_model.py
│ │ ├── test_message_utils.py
│ │ ├── test_openai_llm.py
│ │ ├── test_openai_long_context_model.py
│ │ ├── test_openai_vlm.py
│ │ ├── test_stt_model.py
│ │ └── test_tts_model.py
│ ├── tools/
│ │ ├── test_analyze_image_tool.py
│ │ ├── test_analyze_text_file_tool.py
│ │ ├── test_create_directory_tool.py
│ │ ├── test_create_file_tool.py
│ │ ├── test_datamate_search_tool.py
│ │ ├── test_delete_directory_tool.py
│ │ ├── test_delete_file_tool.py
│ │ ├── test_dify_search_tool.py
│ │ ├── test_exa_search_tool.py
│ │ ├── test_get_email_tool.py
│ │ ├── test_idata_search_tool.py
│ │ ├── test_knowledge_base_search_tool.py
│ │ ├── test_send_email_tool.py
│ │ ├── test_tavily_search_tool.py
│ │ └── test_terminal_tool.py
│ └── utils/
│ ├── test_observer.py
│ └── test_prompt_template_utils.py
├── data_process/
│ ├── __init__.py
│ ├── test_core.py
│ ├── test_openpyxl_processor.py
│ └── test_unstructured_processor.py
├── datamate/
│ └── test_datamate_client.py
├── memory/
│ └── test_memory_service.py
├── monitor/
│ ├── __init__.py
│ ├── conftest.py
│ └── test_monitoring.py
├── multi_modal/
│ ├── test_load_save_object.py
│ └── test_utils.py
├── storage/
│ ├── __init__.py
│ ├── test_minio.py
│ ├── test_minio_config.py
│ └── test_storage_client_factory.py
├── utils/
│ └── test_http_client_manager.py
└── vector_database/
├── __init__.py
├── test_datamate_core.py
└── test_elasticsearch_core.py
Showing preview only (932K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (8525 symbols across 561 files)
FILE: .claude/skills/skill-creator/scripts/init_skill.py
function title_case_skill_name (line 189) | def title_case_skill_name(skill_name):
function init_skill (line 194) | def init_skill(skill_name, path):
function main (line 273) | def main():
FILE: .claude/skills/skill-creator/scripts/package_skill.py
function package_skill (line 19) | def package_skill(skill_path, output_dir=None):
function main (line 85) | def main():
FILE: .claude/skills/skill-creator/scripts/quick_validate.py
function validate_skill (line 12) | def validate_skill(skill_path):
FILE: backend/agents/agent_run_manager.py
class AgentRunManager (line 10) | class AgentRunManager:
method __new__ (line 14) | def __new__(cls):
method __init__ (line 22) | def __init__(self):
method _get_run_key (line 28) | def _get_run_key(self, conversation_id: int, user_id: str) -> str:
method register_agent_run (line 32) | def register_agent_run(self, conversation_id: int, agent_run_info, use...
method unregister_agent_run (line 40) | def unregister_agent_run(self, conversation_id: int, user_id: str):
method get_agent_run_info (line 52) | def get_agent_run_info(self, conversation_id: int, user_id: str):
method stop_agent_run (line 57) | def stop_agent_run(self, conversation_id: int, user_id: str) -> bool:
FILE: backend/agents/create_agent_info.py
function create_model_config_list (line 35) | async def create_model_config_list(tenant_id):
function create_agent_config (line 72) | async def create_agent_config(
function create_tool_config_list (line 211) | async def create_tool_config_list(agent_id, tenant_id, user_id, version_...
function discover_langchain_tools (line 263) | async def discover_langchain_tools():
function prepare_prompt_templates (line 299) | async def prepare_prompt_templates(is_manager: bool, system_prompt: str,...
function join_minio_file_description_to_query (line 316) | async def join_minio_file_description_to_query(minio_files, query):
function filter_mcp_servers_and_tools (line 330) | def filter_mcp_servers_and_tools(input_agent_config: AgentConfig, mcp_in...
function create_agent_run_info (line 355) | async def create_agent_run_info(
FILE: backend/agents/preprocess_manager.py
class PreprocessTask (line 10) | class PreprocessTask:
method __init__ (line 11) | def __init__(self, task_id: str, conversation_id: int):
class PreprocessManager (line 19) | class PreprocessManager:
method __new__ (line 23) | def __new__(cls):
method __init__ (line 31) | def __init__(self):
method register_preprocess_task (line 39) | def register_preprocess_task(self, task_id: str, conversation_id: int,...
method unregister_preprocess_task (line 53) | def unregister_preprocess_task(self, task_id: str):
method stop_preprocess_tasks (line 71) | def stop_preprocess_tasks(self, conversation_id: int) -> bool:
method is_preprocess_running (line 97) | def is_preprocess_running(self, conversation_id: int) -> bool:
method get_preprocess_status (line 111) | def get_preprocess_status(self, conversation_id: int) -> Dict:
FILE: backend/apps/agent_app.py
function agent_run_api (line 51) | async def agent_run_api(agent_request: AgentRequest, http_request: Reque...
function agent_stop_api (line 68) | async def agent_stop_api(conversation_id: int, authorization: Optional[s...
function search_agent_info_api (line 81) | async def search_agent_info_api(
function get_creating_sub_agent_info_api (line 104) | async def get_creating_sub_agent_info_api(authorization: Optional[str] =...
function update_agent_info_api (line 117) | async def update_agent_info_api(request: AgentInfoRequest, authorization...
function delete_agent_api (line 131) | async def delete_agent_api(
function export_agent_api (line 154) | async def export_agent_api(request: AgentIDRequest, authorization: Optio...
function import_agent_api (line 168) | async def import_agent_api(request: AgentImportRequest, authorization: O...
function clear_agent_new_mark_api (line 186) | async def clear_agent_new_mark_api(agent_id: int, authorization: Optiona...
function check_agent_name_batch_api (line 201) | async def check_agent_name_batch_api(request: AgentNameBatchCheckRequest...
function regenerate_agent_name_batch_api (line 216) | async def regenerate_agent_name_batch_api(request: AgentNameBatchRegener...
function list_all_agent_info_api (line 231) | async def list_all_agent_info_api(
function get_agent_call_relationship_api (line 252) | async def get_agent_call_relationship_api(agent_id: int, authorization: ...
function publish_version_api (line 270) | async def publish_version_api(
function compare_versions_api (line 296) | async def compare_versions_api(
function get_version_list_api (line 321) | async def get_version_list_api(
function get_version_api (line 348) | async def get_version_api(
function get_version_detail_api (line 371) | async def get_version_detail_api(
function rollback_version_api (line 395) | async def rollback_version_api(
function update_version_status_api (line 421) | async def update_version_status_api(
function update_version_api (line 448) | async def update_version_api(
function delete_version_api (line 476) | async def delete_version_api(
function get_current_version_api (line 501) | async def get_current_version_api(
function list_published_agents_api (line 523) | async def list_published_agents_api(
FILE: backend/apps/app_factory.py
function create_app (line 16) | def create_app(
function register_exception_handlers (line 70) | def register_exception_handlers(app: FastAPI) -> None:
FILE: backend/apps/config_sync_app.py
function save_config (line 17) | async def save_config(config: GlobalConfig, authorization: Optional[str]...
function load_config (line 35) | async def load_config(authorization: Optional[str] = Header(None), reque...
FILE: backend/apps/conversation_management_app.py
function create_new_conversation_endpoint (line 31) | async def create_new_conversation_endpoint(request: ConversationRequest,...
function list_conversations_endpoint (line 57) | async def list_conversations_endpoint(authorization: Optional[str] = Hea...
function rename_conversation_endpoint (line 79) | async def rename_conversation_endpoint(request: RenameRequest, authoriza...
function delete_conversation_endpoint (line 103) | async def delete_conversation_endpoint(conversation_id: int, authorizati...
function get_conversation_history_endpoint (line 124) | async def get_conversation_history_endpoint(conversation_id: int, author...
function get_sources_endpoint (line 146) | async def get_sources_endpoint(request: Dict[str, Any], authorization: O...
function generate_conversation_title_endpoint (line 172) | async def generate_conversation_title_endpoint(
function update_opinion_endpoint (line 205) | async def update_opinion_endpoint(request: OpinionRequest, authorization...
function get_message_id_endpoint (line 225) | async def get_message_id_endpoint(request: MessageIdRequest):
FILE: backend/apps/data_process_app.py
function lifespan (line 25) | async def lifespan(app: APIRouter):
function create_task (line 42) | async def create_task(request: TaskRequest, authorization: Optional[str]...
function process_sync_endpoint (line 67) | async def process_sync_endpoint(
function create_batch_tasks (line 127) | async def create_batch_tasks(request: BatchTaskRequest, authorization: O...
function load_image (line 146) | async def load_image(url: str):
function list_tasks (line 176) | async def list_tasks():
function get_index_tasks (line 201) | async def get_index_tasks(index_name: str):
function get_task_details (line 215) | async def get_task_details(task_id: str):
function filter_important_image (line 225) | async def filter_important_image(
function process_text_file (line 255) | async def process_text_file(
function convert_state (line 292) | async def convert_state(request: ConvertStateRequest):
function convert_office_to_pdf (line 318) | async def convert_office_to_pdf(
FILE: backend/apps/datamate_app.py
class SyncDatamateRequest (line 22) | class SyncDatamateRequest(BaseModel):
function sync_datamate_knowledges (line 28) | async def sync_datamate_knowledges(
function get_datamate_knowledge_base_files_endpoint (line 50) | async def get_datamate_knowledge_base_files_endpoint(
function test_datamate_connection_endpoint (line 66) | async def test_datamate_connection_endpoint(
FILE: backend/apps/dify_app.py
function fetch_dify_datasets_api (line 26) | async def fetch_dify_datasets_api(
FILE: backend/apps/file_management_app.py
function build_content_disposition_header (line 22) | def build_content_disposition_header(filename: Optional[str], inline: bo...
function options_route (line 78) | async def options_route(full_path: str):
function upload_files (line 86) | async def upload_files(
function process_files (line 117) | async def process_files(
function get_storage_file (line 158) | async def get_storage_file(
function storage_upload_files (line 247) | async def storage_upload_files(
function get_storage_files (line 272) | async def get_storage_files(
function _ensure_http_scheme (line 306) | def _ensure_http_scheme(raw_url: str) -> str:
function _normalize_datamate_download_url (line 332) | def _normalize_datamate_download_url(raw_url: str) -> str:
function _build_datamate_url_from_parts (line 374) | def _build_datamate_url_from_parts(base_url: str, dataset_id: str, file_...
function download_datamate_file (line 409) | async def download_datamate_file(
function remove_storage_file (line 508) | async def remove_storage_file(
function get_storage_file_batch_urls (line 532) | async def get_storage_file_batch_urls(
function preview_file (line 579) | async def preview_file(
FILE: backend/apps/group_app.py
function create_group_endpoint (line 31) | async def create_group_endpoint(
function get_group_endpoint (line 88) | async def get_group_endpoint(group_id: int) -> JSONResponse:
function get_groups_endpoint (line 129) | async def get_groups_endpoint(
function update_group_endpoint (line 190) | async def update_group_endpoint(
function delete_group_endpoint (line 266) | async def delete_group_endpoint(
function add_user_to_group_endpoint (line 329) | async def add_user_to_group_endpoint(
function remove_user_from_group_endpoint (line 397) | async def remove_user_from_group_endpoint(
function get_group_users_endpoint (line 463) | async def get_group_users_endpoint(group_id: int) -> JSONResponse:
function update_group_members_endpoint (line 501) | async def update_group_members_endpoint(
function add_user_to_groups_endpoint (line 565) | async def add_user_to_groups_endpoint(
function get_tenant_default_group_endpoint (line 625) | async def get_tenant_default_group_endpoint(tenant_id: str) -> JSONRespo...
function set_tenant_default_group_endpoint (line 660) | async def set_tenant_default_group_endpoint(
FILE: backend/apps/idata_app.py
function fetch_idata_knowledge_spaces_api (line 27) | async def fetch_idata_knowledge_spaces_api(
function fetch_idata_datasets_api (line 69) | async def fetch_idata_datasets_api(
FILE: backend/apps/image_app.py
function proxy_image (line 20) | async def proxy_image(url: str, format: str = "json"):
FILE: backend/apps/invitation_app.py
function list_invitations_endpoint (line 28) | async def list_invitations_endpoint(
function create_invitation_endpoint (line 81) | async def create_invitation_endpoint(
function update_invitation_endpoint (line 161) | async def update_invitation_endpoint(
function get_invitation_endpoint (line 249) | async def get_invitation_endpoint(invitation_code: str) -> JSONResponse:
function check_invitation_code_endpoint (line 289) | async def check_invitation_code_endpoint(invitation_code: str) -> JSONRe...
function delete_invitation_endpoint (line 323) | async def delete_invitation_endpoint(
function check_invitation_available_endpoint (line 393) | async def check_invitation_available_endpoint(invitation_code: str) -> J...
function use_invitation_endpoint (line 427) | async def use_invitation_endpoint(
function update_invitation_status_endpoint (line 484) | async def update_invitation_status_endpoint(invitation_code: str) -> JSO...
FILE: backend/apps/knowledge_summary_app.py
function auto_summary (line 17) | async def auto_summary(
function change_summary (line 53) | def change_summary(
function get_summary (line 71) | def get_summary(
FILE: backend/apps/memory_config_app.py
function load_configs (line 65) | def load_configs(authorization: Optional[str] = Header(None)):
function set_single_config (line 84) | def set_single_config(
function add_disable_agent (line 124) | def add_disable_agent(
function remove_disable_agent (line 143) | def remove_disable_agent(
function add_disable_useragent (line 162) | def add_disable_useragent(
function remove_disable_useragent (line 181) | def remove_disable_useragent(
function add_memory (line 203) | def add_memory(
function search_memory (line 240) | def search_memory(
function list_memory (line 274) | def list_memory(
function delete_memory (line 304) | def delete_memory(
function clear_memory (line 325) | def clear_memory(
FILE: backend/apps/mock_user_management_app.py
function service_health (line 18) | async def service_health():
function signup (line 31) | async def signup(request: UserSignUpRequest):
function signin (line 65) | async def signin(request: UserSignInRequest):
function user_refresh_token (line 98) | async def user_refresh_token(request: Request):
function logout (line 124) | async def logout(request: Request):
function get_session (line 140) | async def get_session(request: Request):
function get_user_id (line 164) | async def get_user_id(request: Request):
function get_user_information (line 180) | async def get_user_information(request: Request):
FILE: backend/apps/model_managment_app.py
function create_model (line 61) | async def create_model(request: ModelRequest, authorization: Optional[st...
function create_provider_model (line 94) | async def create_provider_model(request: ProviderModelRequest, authoriza...
function batch_create_models (line 120) | async def batch_create_models(request: BatchCreateModelsRequest, authori...
function get_provider_list (line 146) | async def get_provider_list(request: ProviderModelRequest, authorization...
function update_single_model (line 170) | async def update_single_model(
function batch_update_models (line 210) | async def batch_update_models(request: List[dict], authorization: Option...
function delete_model (line 230) | async def delete_model(display_name: str = Query(..., embed=True), autho...
function get_model_list (line 261) | async def get_model_list(authorization: Optional[str] = Header(None)):
function get_llm_model_list (line 283) | async def get_llm_model_list(authorization: Optional[str] = Header(None)):
function check_model_health (line 299) | async def check_model_health(
function check_temporary_model_health (line 331) | async def check_temporary_model_health(request: ModelRequest):
function manage_check_model_health (line 354) | async def manage_check_model_health(
function manage_create_model (line 392) | async def manage_create_model(
function manage_update_model (line 428) | async def manage_update_model(
function manage_delete_model (line 470) | async def manage_delete_model(
function manage_batch_create_models (line 511) | async def manage_batch_create_models(
function manage_list_models (line 550) | async def manage_list_models(
function manage_list_provider_models (line 588) | async def manage_list_provider_models(
function manage_create_provider_models (line 624) | async def manage_create_provider_models(
FILE: backend/apps/northbound_app.py
function _get_northbound_context (line 26) | async def _get_northbound_context(request: Request) -> NorthboundContext:
function health_check (line 104) | async def health_check():
function run_chat (line 109) | async def run_chat(
function stop_chat_stream (line 140) | async def stop_chat_stream(
function get_history (line 168) | async def get_history(
function list_agents (line 188) | async def list_agents(request: Request):
function list_convs (line 205) | async def list_convs(request: Request):
function update_convs_title (line 222) | async def update_convs_title(
FILE: backend/apps/prompt_app.py
function generate_and_save_system_prompt_api (line 16) | async def generate_and_save_system_prompt_api(
FILE: backend/apps/remote_mcp_app.py
function get_tools_from_remote_mcp (line 33) | async def get_tools_from_remote_mcp(
function add_remote_proxies (line 64) | async def add_remote_proxies(
function delete_remote_proxies (line 107) | async def delete_remote_proxies(
function update_remote_proxy (line 137) | async def update_remote_proxy(
function get_remote_proxies (line 175) | async def get_remote_proxies(
function get_mcp_record (line 205) | async def get_mcp_record(
function check_mcp_health (line 250) | async def check_mcp_health(
function add_mcp_from_config (line 281) | async def add_mcp_from_config(
function stop_mcp_container (line 429) | async def stop_mcp_container(
function list_mcp_containers (line 484) | async def list_mcp_containers(
function get_container_logs (line 532) | async def get_container_logs(
function upload_mcp_image (line 603) | async def upload_mcp_image(
FILE: backend/apps/tenant_app.py
function create_tenant_endpoint (line 31) | async def create_tenant_endpoint(
function get_tenant_endpoint (line 86) | async def get_tenant_endpoint(tenant_id: str) -> JSONResponse:
function get_all_tenants_endpoint (line 123) | async def get_all_tenants_endpoint(
function update_tenant_endpoint (line 160) | async def update_tenant_endpoint(
function delete_tenant_endpoint (line 224) | async def delete_tenant_endpoint(
FILE: backend/apps/tenant_config_app.py
function get_deployment_version (line 14) | def get_deployment_version():
FILE: backend/apps/tool_config_app.py
function list_tools_api (line 25) | async def list_tools_api(authorization: Optional[str] = Header(None)):
function search_tool_info_api (line 40) | async def search_tool_info_api(request: ToolInstanceSearchRequest, autho...
function update_tool_info_api (line 51) | async def update_tool_info_api(request: ToolInstanceInfoRequest, authori...
function scan_and_update_tool (line 65) | async def scan_and_update_tool(
function load_last_tool_config (line 87) | async def load_last_tool_config(tool_id: int, authorization: Optional[st...
function validate_tool (line 106) | async def validate_tool(
FILE: backend/apps/user_app.py
function get_users_endpoint (line 25) | async def get_users_endpoint(
function update_user_endpoint (line 73) | async def update_user_endpoint(
function delete_user_endpoint (line 122) | async def delete_user_endpoint(
FILE: backend/apps/user_management_app.py
function service_health (line 27) | async def service_health():
function signup (line 43) | async def signup(request: UserSignUpRequest):
function signin (line 80) | async def signin(request: UserSignInRequest):
function user_refresh_token (line 98) | async def user_refresh_token(request: Request):
function logout (line 123) | async def logout(request: Request):
function get_session (line 146) | async def get_session(request: Request):
function get_user_information (line 170) | async def get_user_information(request: Request):
function get_user_id (line 207) | async def get_user_id(request: Request):
function revoke_user_account (line 236) | async def revoke_user_account(request: Request):
function create_token_endpoint (line 280) | async def create_token_endpoint(
function list_tokens_endpoint (line 312) | async def list_tokens_endpoint(
function delete_token_endpoint (line 349) | async def delete_token_endpoint(
FILE: backend/apps/vectordatabase_app.py
function check_knowledge_base_exist (line 29) | async def check_knowledge_base_exist(
function create_new_index (line 52) | def create_new_index(
function delete_index (line 88) | async def delete_index(
function update_index (line 108) | async def update_index(
function get_list_indices (line 161) | def get_list_indices(
function create_index_documents (line 183) | def create_index_documents(
function get_index_files (line 217) | async def get_index_files(
function delete_documents (line 237) | def delete_documents(
function get_document_error_info (line 288) | async def get_document_error_info(
function health_check (line 349) | def health_check(vdb_core: VectorDatabaseCore = Depends(get_vector_db_co...
function get_index_chunks (line 359) | def get_index_chunks(
function create_chunk (line 399) | def create_chunk(
function update_chunk (line 434) | def update_chunk(
function delete_chunk (line 475) | def delete_chunk(
function hybrid_search (line 512) | async def hybrid_search(
FILE: backend/apps/voice_app.py
function stt_websocket (line 24) | async def stt_websocket(websocket: WebSocket):
function tts_websocket (line 44) | async def tts_websocket(websocket: WebSocket):
function check_voice_connectivity (line 78) | async def check_voice_connectivity(request: VoiceConnectivityRequest):
FILE: backend/consts/const.py
class VectorDatabaseType (line 15) | class VectorDatabaseType(str, Enum):
FILE: backend/consts/error_code.py
class ErrorCode (line 30) | class ErrorCode(Enum):
FILE: backend/consts/error_message.py
class ErrorMessage (line 11) | class ErrorMessage:
method get_message (line 143) | def get_message(cls, error_code: ErrorCode) -> str:
method get_message_with_code (line 148) | def get_message_with_code(cls, error_code: ErrorCode) -> tuple[int, str]:
method get_all_messages (line 153) | def get_all_messages(cls) -> dict:
FILE: backend/consts/exceptions.py
class AppException (line 29) | class AppException(Exception):
method __init__ (line 38) | def __init__(self, error_code: ErrorCode, message: str = None, details...
method to_dict (line 44) | def to_dict(self) -> dict:
method http_status (line 52) | def http_status(self) -> int:
function raise_error (line 56) | def raise_error(error_code: ErrorCode, message: str = None, details: dic...
class AgentRunException (line 73) | class AgentRunException(Exception):
class LimitExceededError (line 78) | class LimitExceededError(Exception):
class UnauthorizedError (line 83) | class UnauthorizedError(Exception):
class SignatureValidationError (line 88) | class SignatureValidationError(Exception):
class MemoryPreparationException (line 93) | class MemoryPreparationException(Exception):
class MCPConnectionError (line 98) | class MCPConnectionError(Exception):
class MCPNameIllegal (line 103) | class MCPNameIllegal(Exception):
class NoInviteCodeException (line 108) | class NoInviteCodeException(Exception):
class IncorrectInviteCodeException (line 113) | class IncorrectInviteCodeException(Exception):
class OfficeConversionException (line 118) | class OfficeConversionException(Exception):
class UnsupportedFileTypeException (line 123) | class UnsupportedFileTypeException(Exception):
class FileTooLargeException (line 128) | class FileTooLargeException(Exception):
class UserRegistrationException (line 133) | class UserRegistrationException(Exception):
class TimeoutException (line 138) | class TimeoutException(Exception):
class ValidationError (line 143) | class ValidationError(Exception):
class NotFoundException (line 148) | class NotFoundException(Exception):
class MEConnectionException (line 153) | class MEConnectionException(Exception):
class VoiceServiceException (line 158) | class VoiceServiceException(Exception):
class STTConnectionException (line 163) | class STTConnectionException(Exception):
class TTSConnectionException (line 168) | class TTSConnectionException(Exception):
class VoiceConfigException (line 173) | class VoiceConfigException(Exception):
class ToolExecutionException (line 178) | class ToolExecutionException(Exception):
class MCPContainerError (line 183) | class MCPContainerError(Exception):
class DuplicateError (line 188) | class DuplicateError(Exception):
class DataMateConnectionError (line 193) | class DataMateConnectionError(Exception):
FILE: backend/consts/model.py
class ModelConnectStatusEnum (line 8) | class ModelConnectStatusEnum(Enum):
method get_default (line 16) | def get_default(cls) -> str:
method get_value (line 21) | def get_value(cls, status: Optional[str]) -> str:
class UserSignUpRequest (line 29) | class UserSignUpRequest(BaseModel):
class UserSignInRequest (line 37) | class UserSignInRequest(BaseModel):
class UserUpdateRequest (line 43) | class UserUpdateRequest(BaseModel):
class UserDeleteRequest (line 50) | class UserDeleteRequest(BaseModel):
class ModelResponse (line 56) | class ModelResponse(BaseModel):
class ModelRequest (line 62) | class ModelRequest(BaseModel):
class ProviderModelRequest (line 77) | class ProviderModelRequest(BaseModel):
class BatchCreateModelsRequest (line 84) | class BatchCreateModelsRequest(BaseModel):
class ModelApiConfig (line 92) | class ModelApiConfig(BaseModel):
class SingleModelConfig (line 97) | class SingleModelConfig(BaseModel):
class ModelConfig (line 104) | class ModelConfig(BaseModel):
class AppConfig (line 114) | class AppConfig(BaseModel):
class GlobalConfig (line 125) | class GlobalConfig(BaseModel):
class AgentRequest (line 131) | class AgentRequest(BaseModel):
class MessageUnit (line 142) | class MessageUnit(BaseModel):
class MessageRequest (line 147) | class MessageRequest(BaseModel):
class ConversationRequest (line 156) | class ConversationRequest(BaseModel):
class ConversationResponse (line 160) | class ConversationResponse(BaseModel):
class RenameRequest (line 166) | class RenameRequest(BaseModel):
class TaskRequest (line 172) | class TaskRequest(BaseModel):
class BatchTaskRequest (line 183) | class BatchTaskRequest(BaseModel):
class IndexingResponse (line 188) | class IndexingResponse(BaseModel):
class ChunkCreateRequest (line 195) | class ChunkCreateRequest(BaseModel):
class ChunkUpdateRequest (line 208) | class ChunkUpdateRequest(BaseModel):
class HybridSearchRequest (line 220) | class HybridSearchRequest(BaseModel):
class ProcessParams (line 233) | class ProcessParams(BaseModel):
class OpinionRequest (line 240) | class OpinionRequest(BaseModel):
class GeneratePromptRequest (line 246) | class GeneratePromptRequest(BaseModel):
class GenerateTitleRequest (line 256) | class GenerateTitleRequest(BaseModel):
class AgentInfoRequest (line 262) | class AgentInfoRequest(BaseModel):
class AgentIDRequest (line 286) | class AgentIDRequest(BaseModel):
class ToolInstanceInfoRequest (line 290) | class ToolInstanceInfoRequest(BaseModel):
class ToolInstanceSearchRequest (line 298) | class ToolInstanceSearchRequest(BaseModel):
class ToolSourceEnum (line 303) | class ToolSourceEnum(Enum):
class ToolInfo (line 309) | class ToolInfo(BaseModel):
class ChangeSummaryRequest (line 323) | class ChangeSummaryRequest(BaseModel):
class MessageIdRequest (line 327) | class MessageIdRequest(BaseModel):
class ExportAndImportAgentInfo (line 332) | class ExportAndImportAgentInfo(BaseModel):
class Config (line 352) | class Config:
class MCPInfo (line 356) | class MCPInfo(BaseModel):
class ExportAndImportDataFormat (line 361) | class ExportAndImportDataFormat(BaseModel):
class AgentImportRequest (line 367) | class AgentImportRequest(BaseModel):
class AgentNameBatchRegenerateItem (line 372) | class AgentNameBatchRegenerateItem(BaseModel):
class AgentNameBatchRegenerateRequest (line 379) | class AgentNameBatchRegenerateRequest(BaseModel):
class AgentNameBatchCheckItem (line 383) | class AgentNameBatchCheckItem(BaseModel):
class AgentNameBatchCheckRequest (line 389) | class AgentNameBatchCheckRequest(BaseModel):
class ConvertStateRequest (line 393) | class ConvertStateRequest(BaseModel):
class MemoryAgentShareMode (line 402) | class MemoryAgentShareMode(str, Enum):
method default (line 415) | def default(cls) -> "MemoryAgentShareMode":
class VoiceConnectivityRequest (line 421) | class VoiceConnectivityRequest(BaseModel):
class VoiceConnectivityResponse (line 427) | class VoiceConnectivityResponse(BaseModel):
class TTSRequest (line 435) | class TTSRequest(BaseModel):
class TTSResponse (line 442) | class TTSResponse(BaseModel):
class ToolValidateRequest (line 448) | class ToolValidateRequest(BaseModel):
class MCPServerConfig (line 459) | class MCPServerConfig(BaseModel):
class MCPConfigRequest (line 474) | class MCPConfigRequest(BaseModel):
class UpdateKnowledgeListRequest (line 480) | class UpdateKnowledgeListRequest(BaseModel):
class MCPUpdateRequest (line 488) | class MCPUpdateRequest(BaseModel):
class TenantCreateRequest (line 501) | class TenantCreateRequest(BaseModel):
class TenantUpdateRequest (line 507) | class TenantUpdateRequest(BaseModel):
class PaginationRequest (line 514) | class PaginationRequest(BaseModel):
class GroupCreateRequest (line 522) | class GroupCreateRequest(BaseModel):
class GroupUpdateRequest (line 532) | class GroupUpdateRequest(BaseModel):
class GroupListRequest (line 539) | class GroupListRequest(BaseModel):
class UserListRequest (line 552) | class UserListRequest(BaseModel):
class GroupUserRequest (line 565) | class GroupUserRequest(BaseModel):
class GroupMembersUpdateRequest (line 573) | class GroupMembersUpdateRequest(BaseModel):
class SetDefaultGroupRequest (line 578) | class SetDefaultGroupRequest(BaseModel):
class InvitationCreateRequest (line 586) | class InvitationCreateRequest(BaseModel):
class InvitationUpdateRequest (line 602) | class InvitationUpdateRequest(BaseModel):
class InvitationResponse (line 609) | class InvitationResponse(BaseModel):
class InvitationListRequest (line 624) | class InvitationListRequest(BaseModel):
class InvitationUseResponse (line 637) | class InvitationUseResponse(BaseModel):
class ManageTenantModelListRequest (line 650) | class ManageTenantModelListRequest(BaseModel):
class ManageTenantModelListResponse (line 659) | class ManageTenantModelListResponse(BaseModel):
class ManageTenantModelCreateRequest (line 671) | class ManageTenantModelCreateRequest(BaseModel):
class ManageTenantModelUpdateRequest (line 686) | class ManageTenantModelUpdateRequest(BaseModel):
class ManageTenantModelDeleteRequest (line 702) | class ManageTenantModelDeleteRequest(BaseModel):
class ManageTenantModelHealthcheckRequest (line 708) | class ManageTenantModelHealthcheckRequest(BaseModel):
class ManageBatchCreateModelsRequest (line 714) | class ManageBatchCreateModelsRequest(BaseModel):
class ManageProviderModelListRequest (line 723) | class ManageProviderModelListRequest(BaseModel):
class ManageProviderModelCreateRequest (line 730) | class ManageProviderModelCreateRequest(BaseModel):
class VersionPublishRequest (line 741) | class VersionPublishRequest(BaseModel):
class VersionListItemResponse (line 747) | class VersionListItemResponse(BaseModel):
class VersionListResponse (line 760) | class VersionListResponse(BaseModel):
class VersionDetailResponse (line 766) | class VersionDetailResponse(BaseModel):
class VersionRollbackRequest (line 782) | class VersionRollbackRequest(BaseModel):
class VersionStatusRequest (line 788) | class VersionStatusRequest(BaseModel):
class VersionUpdateRequest (line 793) | class VersionUpdateRequest(BaseModel):
class VersionCompareRequest (line 799) | class VersionCompareRequest(BaseModel):
class CurrentVersionResponse (line 805) | class CurrentVersionResponse(BaseModel):
FILE: backend/consts/provider.py
class ProviderEnum (line 4) | class ProviderEnum(str, Enum):
FILE: backend/data_process/ray_actors.py
class DataProcessorRayActor (line 19) | class DataProcessorRayActor:
method __init__ (line 25) | def __init__(self):
method process_file (line 30) | def process_file(
method store_chunks_in_redis (line 122) | def store_chunks_in_redis(self, redis_key: str, chunks: List[Dict[str,...
FILE: backend/data_process/ray_config.py
class RayConfig (line 23) | class RayConfig:
method __init__ (line 26) | def __init__(self):
method get_init_params (line 31) | def get_init_params(
method init_ray (line 86) | def init_ray(self, **kwargs) -> bool:
method connect_to_cluster (line 151) | def connect_to_cluster(self, address: str = "auto") -> bool:
method start_local_cluster (line 186) | def start_local_cluster(
method log_configuration (line 212) | def log_configuration(self):
method init_ray_for_worker (line 220) | def init_ray_for_worker(cls, address: str = "auto") -> bool:
method init_ray_for_service (line 227) | def init_ray_for_service(
FILE: backend/data_process/tasks.py
function extract_error_code (line 40) | def extract_error_code(reason: str, parsed_error: Optional[Dict] = None)...
function save_error_to_redis (line 76) | def save_error_to_redis(task_id: str, error_reason: str, start_time: flo...
function init_ray_in_worker (line 106) | def init_ray_in_worker():
function run_async (line 135) | def run_async(coro):
function get_ray_actor (line 184) | def get_ray_actor() -> Any:
class LoggingTask (line 199) | class LoggingTask(Task):
method on_success (line 202) | def on_success(self, retval, task_id, args, kwargs):
method on_failure (line 207) | def on_failure(self, exc, task_id, args, kwargs, einfo):
method on_retry (line 218) | def on_retry(self, exc, task_id, args, kwargs, einfo):
function process (line 225) | def process(
function forward (line 515) | def forward(
function process_and_forward (line 970) | def process_and_forward(
function process_sync (line 1034) | def process_sync(
FILE: backend/data_process/utils.py
function get_all_task_ids_from_redis (line 18) | def get_all_task_ids_from_redis(redis_client: redis.Redis) -> List[str]:
function get_task_info (line 47) | async def get_task_info(task_id: str) -> Dict[str, Any]:
function get_task_details (line 249) | async def get_task_details(task_id: str) -> Optional[Dict[str, Any]]:
FILE: backend/data_process/worker.py
function setup_worker_environment (line 71) | def setup_worker_environment(**kwargs):
function setup_worker_process_resources (line 147) | def setup_worker_process_resources(**kwargs):
function worker_ready_handler (line 178) | def worker_ready_handler(**kwargs):
function worker_shutdown_handler (line 205) | def worker_shutdown_handler(**kwargs):
function task_prerun_handler (line 220) | def task_prerun_handler(sender=None, task_id=None, task=None, args=None,...
function task_postrun_handler (line 226) | def task_postrun_handler(sender=None, task_id=None, task=None, args=None...
function task_failure_handler (line 237) | def task_failure_handler(sender=None, task_id=None, exception=None, einf...
function validate_service_connections (line 247) | def validate_service_connections() -> bool:
function validate_redis_connection (line 264) | def validate_redis_connection() -> bool:
function start_worker (line 289) | def start_worker():
FILE: backend/data_process_service.py
class ServiceManager (line 41) | class ServiceManager:
method __init__ (line 44) | def __init__(self, config: dict[str, Any]):
method start_redis (line 62) | def start_redis(self):
method _check_redis_connection (line 68) | def _check_redis_connection(self, redis_url: str) -> bool:
method start_ray_cluster (line 84) | def start_ray_cluster(self):
method start_workers (line 178) | def start_workers(self):
method start_flower (line 376) | def start_flower(self):
method start_all_services (line 527) | def start_all_services(self):
method log_service_info (line 570) | def log_service_info(self):
method stop_all_services (line 599) | def stop_all_services(self):
function parse_arguments (line 718) | def parse_arguments():
function signal_handler (line 761) | def signal_handler(signum, frame):
function lifespan (line 786) | async def lifespan(app: FastAPI):
function create_app (line 801) | def create_app():
function main (line 810) | def main():
FILE: backend/database/agent_db.py
function search_agent_info_by_agent_id (line 12) | def search_agent_info_by_agent_id(agent_id: int, tenant_id: str, version...
function search_agent_id_by_agent_name (line 38) | def search_agent_id_by_agent_name(agent_name: str, tenant_id: str, versi...
function search_blank_sub_agent_by_main_agent_id (line 59) | def search_blank_sub_agent_by_main_agent_id(tenant_id: str, version_no: ...
function query_sub_agents_id_list (line 81) | def query_sub_agents_id_list(main_agent_id: int, tenant_id: str, version...
function clear_agent_new_mark (line 101) | def clear_agent_new_mark(agent_id: int, tenant_id: str, user_id: str, ve...
function mark_agents_as_new (line 127) | def mark_agents_as_new(agent_ids: list[int], tenant_id: str, user_id: st...
function create_agent (line 152) | def create_agent(agent_info, tenant_id: str, user_id: str):
function update_agent (line 206) | def update_agent(agent_id, agent_info, user_id, version_no: int = 0):
function delete_agent_by_id (line 239) | def delete_agent_by_id(agent_id, tenant_id: str, user_id: str):
function query_all_agent_info_by_tenant_id (line 270) | def query_all_agent_info_by_tenant_id(tenant_id: str, version_no: int = 0):
function insert_related_agent (line 288) | def insert_related_agent(parent_agent_id: int, child_agent_id: int, tena...
function delete_related_agent (line 320) | def delete_related_agent(parent_agent_id: int, child_agent_id: int, tena...
function update_related_agents (line 347) | def update_related_agents(parent_agent_id: int, related_agent_ids: List[...
function delete_agent_relationship (line 407) | def delete_agent_relationship(agent_id: int, tenant_id: str, user_id: st...
FILE: backend/database/agent_version_db.py
function search_version_by_version_no (line 20) | def search_version_by_version_no(
function search_version_by_id (line 38) | def search_version_by_id(
function query_version_list (line 53) | def query_version_list(
function query_current_version_no (line 70) | def query_current_version_no(
function query_agent_snapshot (line 87) | def query_agent_snapshot(
function query_agent_draft (line 127) | def query_agent_draft(
function insert_version (line 137) | def insert_version(
function update_version_status (line 151) | def update_version_status(
function update_version (line 176) | def update_version(
function update_agent_current_version (line 216) | def update_agent_current_version(
function insert_agent_snapshot (line 239) | def insert_agent_snapshot(
function insert_tool_snapshot (line 249) | def insert_tool_snapshot(
function insert_relation_snapshot (line 259) | def insert_relation_snapshot(
function update_agent_snapshot (line 269) | def update_agent_snapshot(
function delete_agent_snapshot (line 293) | def delete_agent_snapshot(
function delete_tool_snapshot (line 317) | def delete_tool_snapshot(
function delete_relation_snapshot (line 345) | def delete_relation_snapshot(
function get_next_version_no (line 373) | def get_next_version_no(
function delete_version (line 389) | def delete_version(
FILE: backend/database/attachment_db.py
function generate_object_name (line 10) | def generate_object_name(file_name: str, prefix: str = "attachments") ->...
function upload_file (line 31) | def upload_file(file_path: str, object_name: Optional[str] = None, bucke...
function upload_fileobj (line 64) | def upload_fileobj(
function download_file (line 111) | def download_file(object_name: str, file_path: str, bucket: Optional[str...
function get_file_url (line 137) | def get_file_url(object_name: str, bucket: Optional[str] = None, expires...
function get_file_size_from_minio (line 164) | def get_file_size_from_minio(object_name: str, bucket: Optional[str] = N...
function file_exists (line 172) | def file_exists(object_name: str, bucket: Optional[str] = None) -> bool:
function copy_file (line 189) | def copy_file(source_object: str, dest_object: str, bucket: Optional[str...
function list_files (line 208) | def list_files(prefix: str = "", bucket: Optional[str] = None) -> List[D...
function delete_file (line 234) | def delete_file(object_name: str, bucket: Optional[str] = None) -> Dict[...
function get_file_stream (line 257) | def get_file_stream(object_name: str, bucket: Optional[str] = None) -> O...
function get_content_type (line 281) | def get_content_type(file_path: str) -> str:
FILE: backend/database/client.py
class PostgresClient (line 28) | class PostgresClient:
method __new__ (line 32) | def __new__(cls):
method __init__ (line 37) | def __init__(self):
method clean_string_values (line 61) | def clean_string_values(data: Dict[str, Any]) -> Dict[str, Any]:
class MinioClient (line 73) | class MinioClient:
method __new__ (line 82) | def __new__(cls):
method __init__ (line 87) | def __init__(self):
method upload_file (line 103) | def upload_file(
method upload_fileobj (line 122) | def upload_fileobj(self, file_obj: BinaryIO, object_name: str, bucket:...
method download_file (line 136) | def download_file(self, object_name: str, file_path: str, bucket: Opti...
method get_file_url (line 150) | def get_file_url(self, object_name: str, bucket: Optional[str] = None,...
method get_file_size (line 164) | def get_file_size(self, object_name: str, bucket: Optional[str] = None...
method list_files (line 177) | def list_files(self, prefix: str = "", bucket: Optional[str] = None) -...
method delete_file (line 190) | def delete_file(self, object_name: str, bucket: Optional[str] = None) ...
method get_file_stream (line 203) | def get_file_stream(self, object_name: str, bucket: Optional[str] = No...
method file_exists (line 216) | def file_exists(self, object_name: str, bucket: Optional[str] = None) ...
method copy_file (line 229) | def copy_file(self, source_object: str, dest_object: str, bucket: Opti...
function get_db_session (line 250) | def get_db_session(db_session=None):
function as_dict (line 270) | def as_dict(obj):
function filter_property (line 280) | def filter_property(data, model_class):
FILE: backend/database/conversation_db.py
class MessageRecord (line 18) | class MessageRecord(TypedDict):
class SearchRecord (line 27) | class SearchRecord(TypedDict):
class ImageRecord (line 42) | class ImageRecord(TypedDict):
class ConversationHistory (line 47) | class ConversationHistory(TypedDict):
function create_conversation (line 55) | def create_conversation(conversation_title: str, user_id: Optional[str] ...
function create_conversation_message (line 93) | def create_conversation_message(message_data: Dict[str, Any], user_id: O...
function create_message_units (line 136) | def create_message_units(message_units: List[Dict[str, Any]], message_id...
function get_conversation (line 187) | def get_conversation(conversation_id: int, user_id: Optional[str] = None...
function get_conversation_messages (line 218) | def get_conversation_messages(conversation_id: int) -> List[Dict[str, An...
function get_message_units (line 245) | def get_message_units(message_id: int) -> List[Dict[str, Any]]:
function get_conversation_list (line 272) | def get_conversation_list(user_id: Optional[str] = None) -> List[Dict[st...
function rename_conversation (line 315) | def rename_conversation(conversation_id: int, new_title: str, user_id: O...
function delete_conversation (line 353) | def delete_conversation(conversation_id: int, user_id: Optional[str] = N...
function soft_delete_all_conversations_by_user (line 415) | def soft_delete_all_conversations_by_user(user_id: str) -> int:
function update_message_opinion (line 476) | def update_message_opinion(message_id: int, opinion: str, user_id: Optio...
function get_conversation_history (line 514) | def get_conversation_history(conversation_id: int, user_id: Optional[str...
function create_source_image (line 626) | def create_source_image(image_data: Dict[str, Any], user_id: Optional[st...
function delete_source_image (line 667) | def delete_source_image(image_id: int, user_id: Optional[str] = None) ->...
function get_source_images_by_message (line 705) | def get_source_images_by_message(message_id: int, user_id: Optional[str]...
function get_source_images_by_conversation (line 742) | def get_source_images_by_conversation(conversation_id: int, user_id: Opt...
function create_source_search (line 777) | def create_source_search(search_data: Dict[str, Any], user_id: Optional[...
function delete_source_search (line 849) | def delete_source_search(search_id: int, user_id: Optional[str] = None) ...
function get_source_searches_by_message (line 886) | def get_source_searches_by_message(message_id: int, user_id: Optional[st...
function get_source_searches_by_conversation (line 923) | def get_source_searches_by_conversation(conversation_id: int, user_id: O...
function get_message (line 959) | def get_message(message_id: int, user_id: Optional[str] = None) -> Dict[...
function get_message_id_by_index (line 992) | def get_message_id_by_index(conversation_id: int, message_index: int) ->...
FILE: backend/database/db_models.py
class SimpleTableBase (line 9) | class SimpleTableBase(DeclarativeBase):
class TableBase (line 13) | class TableBase(DeclarativeBase):
class ConversationRecord (line 25) | class ConversationRecord(TableBase):
class ConversationMessage (line 37) | class ConversationMessage(TableBase):
class ConversationMessageUnit (line 59) | class ConversationMessageUnit(TableBase):
class ConversationSourceImage (line 79) | class ConversationSourceImage(TableBase):
class ConversationSourceSearch (line 101) | class ConversationSourceSearch(TableBase):
class ModelRecord (line 137) | class ModelRecord(TableBase):
class ToolInfo (line 174) | class ToolInfo(TableBase):
class AgentInfo (line 198) | class AgentInfo(TableBase):
class ToolInstance (line 233) | class ToolInstance(TableBase):
class KnowledgeRecord (line 256) | class KnowledgeRecord(TableBase):
class TenantConfig (line 276) | class TenantConfig(TableBase):
class MemoryUserConfig (line 293) | class MemoryUserConfig(TableBase):
class McpRecord (line 310) | class McpRecord(TableBase):
class UserTenant (line 339) | class UserTenant(TableBase):
class AgentRelation (line 354) | class AgentRelation(TableBase):
class PartnerMappingId (line 368) | class PartnerMappingId(TableBase):
class TenantInvitationCode (line 387) | class TenantInvitationCode(TableBase):
class TenantInvitationRecord (line 411) | class TenantInvitationRecord(TableBase):
class TenantGroupInfo (line 425) | class TenantGroupInfo(TableBase):
class TenantGroupUser (line 440) | class TenantGroupUser(TableBase):
class RolePermission (line 453) | class RolePermission(SimpleTableBase):
class AgentVersion (line 470) | class AgentVersion(TableBase):
class UserTokenInfo (line 489) | class UserTokenInfo(TableBase):
class UserTokenUsageLog (line 502) | class UserTokenUsageLog(TableBase):
FILE: backend/database/group_db.py
function query_groups (line 11) | def query_groups(group_id: Union[int, str, List[int]]) -> Union[Optional...
function query_groups_by_tenant (line 52) | def query_groups_by_tenant(tenant_id: str, page: Optional[int] = 1, page...
function add_group (line 101) | def add_group(tenant_id: str, group_name: str, group_description: Option...
function modify_group (line 128) | def modify_group(group_id: int, updates: Dict[str, Any], updated_by: Opt...
function remove_group (line 153) | def remove_group(group_id: int, updated_by: Optional[str] = None) -> bool:
function add_user_to_group (line 184) | def add_user_to_group(group_id: int, user_id: str, created_by: Optional[...
function remove_user_from_group (line 208) | def remove_user_from_group(group_id: int, user_id: str, updated_by: Opti...
function query_group_users (line 234) | def query_group_users(group_id: int) -> List[Dict[str, Any]]:
function query_group_ids_by_user (line 253) | def query_group_ids_by_user(user_id: str) -> List[int]:
function query_groups_by_user (line 272) | def query_groups_by_user(user_id: str) -> List[Dict[str, Any]]:
function check_user_in_group (line 295) | def check_user_in_group(user_id: str, group_id: int) -> bool:
function count_group_users (line 316) | def count_group_users(group_id: int) -> int:
function remove_group_users (line 335) | def remove_group_users(group_id: int, removed_by: Optional[str] = None) ...
function remove_user_from_all_groups (line 359) | def remove_user_from_all_groups(user_id: str, removed_by: str) -> int:
function check_group_name_exists (line 383) | def check_group_name_exists(tenant_id: str, group_name: str, exclude_gro...
FILE: backend/database/invitation_db.py
function query_invitation_by_code (line 11) | def query_invitation_by_code(invitation_code: str) -> Optional[Dict[str,...
function query_invitation_by_id (line 32) | def query_invitation_by_id(invitation_id: int) -> Optional[Dict[str, Any]]:
function query_invitations_by_tenant (line 53) | def query_invitations_by_tenant(tenant_id: str) -> List[Dict[str, Any]]:
function add_invitation (line 72) | def add_invitation(tenant_id: str, invitation_code: str, code_type: str,...
function modify_invitation (line 108) | def modify_invitation(invitation_id: int, updates: Dict[str, Any], updat...
function remove_invitation (line 137) | def remove_invitation(invitation_id: int, updated_by: Optional[str] = No...
function query_invitation_records (line 161) | def query_invitation_records(invitation_id: int) -> List[Dict[str, Any]]:
function add_invitation_record (line 180) | def add_invitation_record(invitation_id: int, user_id: str, created_by: ...
function query_invitation_records_by_user (line 204) | def query_invitation_records_by_user(user_id: str) -> List[Dict[str, Any]]:
function count_invitation_usage (line 223) | def count_invitation_usage(invitation_id: int) -> int:
function query_invitation_status (line 242) | def query_invitation_status(invitation_code: str) -> Optional[str]:
function query_invitations_with_pagination (line 261) | def query_invitations_with_pagination(
FILE: backend/database/knowledge_db.py
function _generate_index_name (line 12) | def _generate_index_name(knowledge_id: int) -> str:
function create_knowledge_record (line 21) | def create_knowledge_record(query: Dict[str, Any]) -> Dict[str, Any]:
function upsert_knowledge_record (line 85) | def upsert_knowledge_record(query: Dict[str, Any]) -> Dict[str, Any]:
function update_knowledge_record (line 137) | def update_knowledge_record(query: Dict[str, Any]) -> bool:
function delete_knowledge_record (line 192) | def delete_knowledge_record(query: Dict[str, Any]) -> bool:
function get_knowledge_record (line 228) | def get_knowledge_record(query: Optional[Dict[str, Any]] = None) -> Dict...
function get_knowledge_info_by_knowledge_ids (line 266) | def get_knowledge_info_by_knowledge_ids(knowledge_ids: List[str]) -> Lis...
function get_knowledge_ids_by_index_names (line 287) | def get_knowledge_ids_by_index_names(index_names: List[str]) -> List[str]:
function get_knowledge_info_by_tenant_id (line 299) | def get_knowledge_info_by_tenant_id(tenant_id: str) -> List[Dict[str, An...
function get_knowledge_info_by_tenant_and_source (line 311) | def get_knowledge_info_by_tenant_and_source(tenant_id: str, knowledge_so...
function update_model_name_by_index_name (line 334) | def update_model_name_by_index_name(index_name: str, embedding_model_nam...
function get_index_name_by_knowledge_name (line 348) | def get_index_name_by_knowledge_name(knowledge_name: str, tenant_id: str...
FILE: backend/database/memory_config_db.py
function get_all_configs_by_user_id (line 7) | def get_all_configs_by_user_id(user_id: str) -> List[Dict[str, Any]]:
function get_memory_config_info (line 27) | def get_memory_config_info(user_id: str, select_key: str) -> List[Dict[s...
function insert_config (line 46) | def insert_config(insert_data: Dict[str, Any]) -> bool:
function delete_config_by_config_id (line 59) | def delete_config_by_config_id(config_id: int, updated_by: str) -> bool:
function update_config_by_id (line 77) | def update_config_by_id(config_id: int, update_data: Dict[str, Any]) -> ...
function soft_delete_all_configs_by_user_id (line 93) | def soft_delete_all_configs_by_user_id(user_id: str, actor: str) -> bool:
FILE: backend/database/model_management_db.py
function create_model_record (line 11) | def create_model_record(model_data: Dict[str, Any], user_id: str, tenant...
function update_model_record (line 45) | def update_model_record(
function delete_model_record (line 87) | def delete_model_record(model_id: int, user_id: str, tenant_id: str) -> ...
function get_model_records (line 122) | def get_model_records(filters: Optional[Dict[str, Any]], tenant_id: str)...
function get_model_by_display_name (line 173) | def get_model_by_display_name(display_name: str, tenant_id: str) -> Opti...
function get_models_by_display_name (line 191) | def get_models_by_display_name(display_name: str, tenant_id: str) -> Lis...
function get_model_id_by_display_name (line 206) | def get_model_id_by_display_name(display_name: str, tenant_id: str) -> O...
function get_model_by_model_id (line 221) | def get_model_by_model_id(model_id: int, tenant_id: Optional[str] = None...
function get_models_by_tenant_factory_type (line 264) | def get_models_by_tenant_factory_type(tenant_id: str, model_factory: str...
function get_model_by_name_factory (line 275) | def get_model_by_name_factory(model_name: str, model_factory: str, tenan...
FILE: backend/database/partner_db.py
function add_mapping_id (line 8) | def add_mapping_id(
function get_internal_id_by_external (line 34) | def get_internal_id_by_external(
function get_external_id_by_internal (line 62) | def get_external_id_by_internal(
FILE: backend/database/remote_mcp_db.py
function create_mcp_record (line 10) | def create_mcp_record(mcp_data: Dict[str, Any], tenant_id: str, user_id:...
function delete_mcp_record_by_name_and_url (line 31) | def delete_mcp_record_by_name_and_url(mcp_name: str, mcp_server: str, te...
function delete_mcp_record_by_container_id (line 49) | def delete_mcp_record_by_container_id(container_id: str, tenant_id: str,...
function update_mcp_status_by_name_and_url (line 65) | def update_mcp_status_by_name_and_url(mcp_name: str, mcp_server: str, te...
function get_mcp_records_by_tenant (line 83) | def get_mcp_records_by_tenant(tenant_id: str) -> List[Dict[str, Any]]:
function get_mcp_server_by_name_and_tenant (line 99) | def get_mcp_server_by_name_and_tenant(mcp_name: str, tenant_id: str) -> ...
function get_mcp_authorization_token_by_name_and_url (line 117) | def get_mcp_authorization_token_by_name_and_url(mcp_name: str, mcp_serve...
function update_mcp_record_by_name_and_url (line 137) | def update_mcp_record_by_name_and_url(
function check_mcp_name_exists (line 173) | def check_mcp_name_exists(mcp_name: str, tenant_id: str) -> bool:
function get_mcp_record_by_id_and_tenant (line 190) | def get_mcp_record_by_id_and_tenant(mcp_id: int, tenant_id: str) -> Dict...
FILE: backend/database/role_permission_db.py
function get_all_role_permissions (line 12) | def get_all_role_permissions() -> List[Dict[str, Any]]:
function check_role_permission (line 25) | def check_role_permission(user_role: str, permission_category: Optional[...
function get_permissions_by_category (line 55) | def get_permissions_by_category(permission_category: str) -> List[Dict[s...
FILE: backend/database/tenant_config_db.py
function get_all_configs_by_tenant_id (line 13) | def get_all_configs_by_tenant_id(tenant_id: str):
function get_tenant_config_info (line 32) | def get_tenant_config_info(tenant_id: str, user_id: str, select_key: str):
function get_single_config_info (line 49) | def get_single_config_info(tenant_id: str, select_key: str):
function insert_config (line 68) | def insert_config(insert_data: Dict[str, Any]):
function delete_config_by_tenant_config_id (line 80) | def delete_config_by_tenant_config_id(tenant_config_id: int):
function delete_config (line 95) | def delete_config(tenant_id: str, user_id: str, select_key: str, config_...
function update_config_by_tenant_config_id (line 113) | def update_config_by_tenant_config_id(tenant_config_id: int, update_valu...
function update_config_by_tenant_config_id_and_data (line 128) | def update_config_by_tenant_config_id_and_data(tenant_config_id: int, in...
function get_all_tenant_ids (line 143) | def get_all_tenant_ids():
FILE: backend/database/token_db.py
function generate_access_key (line 11) | def generate_access_key() -> str:
function create_token (line 17) | def create_token(access_key: str, user_id: str) -> Dict[str, Any]:
function list_tokens_by_user (line 45) | def list_tokens_by_user(user_id: str) -> List[Dict[str, Any]]:
function get_token_by_id (line 71) | def get_token_by_id(token_id: int) -> UserTokenInfo:
function get_token_by_access_key (line 87) | def get_token_by_access_key(access_key: str) -> Optional[Dict[str, Any]]:
function delete_token (line 112) | def delete_token(token_id: int, user_id: str) -> bool:
function log_token_usage (line 137) | def log_token_usage(
function get_latest_usage_metadata (line 169) | def get_latest_usage_metadata(token_id: int, related_id: int, call_funct...
FILE: backend/database/tool_db.py
function create_tool (line 10) | def create_tool(tool_info, version_no: int = 0):
function create_or_update_tool_by_tool_info (line 32) | def create_or_update_tool_by_tool_info(tool_info, tenant_id: str, user_i...
function query_all_tools (line 76) | def query_all_tools(tenant_id: str):
function query_tool_instances_by_id (line 91) | def query_tool_instances_by_id(agent_id: int, tool_id: int, tenant_id: s...
function query_tools_by_ids (line 119) | def query_tools_by_ids(tool_id_list: List[int]):
function query_all_enabled_tool_instances (line 131) | def query_all_enabled_tool_instances(agent_id: int, tenant_id: str, vers...
function query_tool_instances_by_agent_id (line 155) | def query_tool_instances_by_agent_id(agent_id: int, tenant_id: str, vers...
function check_tool_list_initialized (line 178) | def check_tool_list_initialized(tenant_id: str) -> bool:
function update_tool_table_from_scan_tool_list (line 197) | def update_tool_table_from_scan_tool_list(tenant_id: str, user_id: str, ...
function add_tool_field (line 250) | def add_tool_field(tool_info):
function search_tools_for_sub_agent (line 271) | def search_tools_for_sub_agent(agent_id, tenant_id, version_no: int = 0):
function check_tool_is_available (line 304) | def check_tool_is_available(tool_id_list: List[int]):
function delete_tools_by_agent_id (line 314) | def delete_tools_by_agent_id(agent_id, tenant_id, user_id, version_no: i...
function search_last_tool_instance_by_tool_id (line 335) | def search_last_tool_instance_by_tool_id(tool_id: int, tenant_id: str, u...
FILE: backend/database/user_tenant_db.py
function get_user_tenant_by_user_id (line 14) | def get_user_tenant_by_user_id(user_id: str) -> Optional[Dict[str, Any]]:
function get_all_tenant_ids (line 35) | def get_all_tenant_ids() -> list[str]:
function insert_user_tenant (line 56) | def insert_user_tenant(user_id: str, tenant_id: str, user_role: str = "U...
function get_users_by_tenant_id (line 78) | def get_users_by_tenant_id(tenant_id: str, page: Optional[int] = 1, page...
function update_user_tenant_role (line 127) | def update_user_tenant_role(user_id: str, role: str, updated_by: str) ->...
function soft_delete_user_tenant_by_user_id (line 152) | def soft_delete_user_tenant_by_user_id(user_id: str, deleted_by: str) ->...
function soft_delete_users_by_tenant_id (line 176) | def soft_delete_users_by_tenant_id(tenant_id: str, deleted_by: str) -> b...
FILE: backend/database/utils.py
function add_creation_tracking (line 5) | def add_creation_tracking(data: Dict[str, Any], user_id: str) -> Dict[st...
function add_update_tracking (line 22) | def add_update_tracking(data: Dict[str, Any], user_id: str) -> Dict[str,...
FILE: backend/middleware/exception_handler.py
function _http_status_to_error_code (line 23) | def _http_status_to_error_code(status_code: int) -> ErrorCode:
class ExceptionHandlerMiddleware (line 38) | class ExceptionHandlerMiddleware(BaseHTTPMiddleware):
method dispatch (line 47) | async def dispatch(self, request: Request, call_next: Callable) -> Res...
function create_error_response (line 117) | def create_error_response(
function create_success_response (line 152) | def create_success_response(
FILE: backend/services/agent_service.py
function _resolve_user_tenant_language (line 83) | def _resolve_user_tenant_language(
function _get_user_group_ids (line 99) | def _get_user_group_ids(user_id: str, tenant_id: str) -> str:
function _resolve_model_with_fallback (line 119) | def _resolve_model_with_fallback(
function _normalize_language_key (line 170) | def _normalize_language_key(language: str) -> str:
function _render_prompt_template (line 177) | def _render_prompt_template(template_str: str, **context) -> str:
function _format_existing_values (line 187) | def _format_existing_values(values: set[str], language: str) -> str:
function _check_agent_value_duplicate (line 193) | def _check_agent_value_duplicate(
function _check_agent_name_duplicate (line 212) | def _check_agent_name_duplicate(
function _check_agent_display_name_duplicate (line 227) | def _check_agent_display_name_duplicate(
function _generate_unique_value_with_suffix (line 242) | def _generate_unique_value_with_suffix(
function _generate_unique_agent_name_with_suffix (line 265) | def _generate_unique_agent_name_with_suffix(
function _generate_unique_display_name_with_suffix (line 280) | def _generate_unique_display_name_with_suffix(
function _regenerate_agent_value_with_llm (line 295) | def _regenerate_agent_value_with_llm(
function _regenerate_agent_name_with_llm (line 361) | def _regenerate_agent_name_with_llm(
function _regenerate_agent_display_name_with_llm (line 402) | def _regenerate_agent_display_name_with_llm(
function check_agent_name_conflict_batch_impl (line 442) | async def check_agent_name_conflict_batch_impl(
function regenerate_agent_name_batch_impl (line 489) | async def regenerate_agent_name_batch_impl(
function _stream_agent_chunks (line 586) | async def _stream_agent_chunks(
function get_enable_tool_id_by_agent_id (line 689) | def get_enable_tool_id_by_agent_id(agent_id: int, tenant_id: str):
function get_creating_sub_agent_id_service (line 699) | async def get_creating_sub_agent_id_service(tenant_id: str, user_id: str...
function get_agent_info_impl (line 711) | async def get_agent_info_impl(agent_id: int, tenant_id: str, version_no:...
function get_creating_sub_agent_info_impl (line 762) | async def get_creating_sub_agent_info_impl(authorization: str = Header(N...
function update_agent_info_impl (line 801) | async def update_agent_info_impl(request: AgentInfoRequest, authorizatio...
function delete_agent_impl (line 920) | async def delete_agent_impl(agent_id: int, tenant_id: str, user_id: str):
function clear_agent_memory (line 941) | async def clear_agent_memory(agent_id: int, tenant_id: str, user_id: str):
function export_agent_impl (line 990) | async def export_agent_impl(agent_id: int, authorization: str = Header(N...
function export_agent_by_agent_id (line 1045) | async def export_agent_by_agent_id(agent_id: int, tenant_id: str, user_i...
function import_agent_impl (line 1098) | async def import_agent_impl(
function import_agent_by_agent_id (line 1154) | async def import_agent_by_agent_id(
function load_default_agents_json_file (line 1256) | def load_default_agents_json_file(default_agent_path):
function clear_agent_new_mark_impl (line 1271) | async def clear_agent_new_mark_impl(agent_id: int, tenant_id: str, user_...
function list_all_agent_info_impl (line 1287) | async def list_all_agent_info_impl(tenant_id: str, user_id: str) -> list...
function _apply_duplicate_name_availability_rules (line 1398) | def _apply_duplicate_name_availability_rules(enriched_agents: list[dict]...
function _collect_model_availability_reasons (line 1438) | def _collect_model_availability_reasons(agent: dict, tenant_id: str, mod...
function _check_single_model_availability (line 1453) | def _check_single_model_availability(
function check_agent_availability (line 1477) | def check_agent_availability(
function insert_related_agent_impl (line 1527) | def insert_related_agent_impl(parent_agent_id, child_agent_id, tenant_id):
function prepare_agent_run (line 1562) | async def prepare_agent_run(
function save_messages (line 1592) | def save_messages(agent_request, target: str, user_id: str, tenant_id: s...
function generate_stream_with_memory (line 1606) | async def generate_stream_with_memory(
function generate_stream_no_memory (line 1710) | async def generate_stream_no_memory(
function run_agent_stream (line 1744) | async def run_agent_stream(
function stop_agent_tasks (line 1914) | def stop_agent_tasks(conversation_id: int, user_id: str):
function get_agent_id_by_name (line 1942) | async def get_agent_id_by_name(agent_name: str, tenant_id: str) -> int:
function delete_related_agent_impl (line 1956) | def delete_related_agent_impl(parent_agent_id: int, child_agent_id: int,...
function get_agent_call_relationship_impl (line 1975) | def get_agent_call_relationship_impl(agent_id: int, tenant_id: str) -> d...
FILE: backend/services/agent_version_service.py
function _remove_audit_fields_for_insert (line 37) | def _remove_audit_fields_for_insert(data: dict) -> None:
function publish_version_impl (line 48) | def publish_version_impl(
function get_version_list_impl (line 121) | def get_version_list_impl(
function get_version_impl (line 139) | def get_version_impl(
function get_version_detail_impl (line 150) | def get_version_detail_impl(
function _check_version_snapshot_availability (line 239) | def _check_version_snapshot_availability(
function rollback_version_impl (line 272) | def rollback_version_impl(
function update_version_status_impl (line 312) | def update_version_status_impl(
function update_version_impl (line 340) | def update_version_impl(
function delete_version_impl (line 374) | def delete_version_impl(
function get_current_version_impl (line 439) | def get_current_version_impl(
function compare_versions_impl (line 466) | def compare_versions_impl(
function _get_version_detail_or_draft (line 559) | def _get_version_detail_or_draft(
function list_published_agents_impl (line 623) | async def list_published_agents_impl(
FILE: backend/services/config_sync_service.py
function handle_model_config (line 34) | def handle_model_config(tenant_id: str, user_id: str, config_key: str, m...
function save_config_impl (line 71) | async def save_config_impl(config, tenant_id, user_id):
function load_config_impl (line 118) | async def load_config_impl(language: str, tenant_id: str):
function build_app_config (line 130) | def build_app_config(language: str, tenant_id: str) -> dict:
function build_models_config (line 152) | def build_models_config(tenant_id: str) -> dict:
function build_model_config (line 167) | def build_model_config(model_config: dict) -> dict:
FILE: backend/services/conversation_management_service.py
function save_message (line 38) | def save_message(request: MessageRequest, user_id: str, tenant_id: str):
function save_conversation_user (line 201) | def save_conversation_user(request: AgentRequest, user_id: str, tenant_i...
function save_conversation_assistant (line 210) | def save_conversation_assistant(request: AgentRequest, messages: List[st...
function call_llm_for_title (line 229) | def call_llm_for_title(question: str, tenant_id: str, language: str = LA...
function update_conversation_title (line 277) | def update_conversation_title(conversation_id: int, title: str, user_id:...
function create_new_conversation (line 294) | def create_new_conversation(title: str, user_id: str) -> Dict[str, Any]:
function get_conversation_list_service (line 313) | def get_conversation_list_service(user_id: str) -> List[Dict[str, Any]]:
function rename_conversation_service (line 328) | def rename_conversation_service(conversation_id: int, name: str, user_id...
function delete_conversation_service (line 350) | def delete_conversation_service(conversation_id: int, user_id: str) -> b...
function get_conversation_history_service (line 371) | def get_conversation_history_service(conversation_id: int, user_id: str)...
function get_sources_service (line 534) | def get_sources_service(conversation_id: Optional[int], message_id: Opti...
function generate_conversation_title_service (line 633) | async def generate_conversation_title_service(conversation_id: int, ques...
function update_message_opinion_service (line 664) | def update_message_opinion_service(message_id: int, opinion: Optional[st...
function get_message_id_by_index_impl (line 685) | async def get_message_id_by_index_impl(conversation_id: int, message_ind...
FILE: backend/services/data_process_service.py
class DataProcessService (line 38) | class DataProcessService:
method __init__ (line 39) | def __init__(self):
method _init_redis_client (line 61) | def _init_redis_client(self):
method _init_clip_model (line 82) | def _init_clip_model(self):
method start (line 99) | async def start(self):
method stop (line 103) | async def stop(self):
method _get_celery_inspector (line 107) | def _get_celery_inspector(self):
method get_task (line 129) | async def get_task(self, task_id: str) -> Optional[Dict[str, Any]]:
method get_all_tasks (line 133) | async def get_all_tasks(self, filter: bool = True) -> List[Dict[str, A...
method get_index_tasks (line 212) | async def get_index_tasks(self, index_name: str, filter: bool = True) ...
method check_image_size (line 225) | def check_image_size(self, width: int, height: int, min_width: int = 2...
method load_image (line 241) | async def load_image(self, image_url: str) -> Optional[Image.Image]:
method _load_image (line 255) | async def _load_image(self, session: aiohttp.ClientSession, path: str)...
method filter_important_image (line 342) | async def filter_important_image(self, image_url: str, positive_prompt...
method create_batch_tasks_impl (line 456) | async def create_batch_tasks_impl(self, authorization: Optional[str], ...
method convert_to_base64 (line 503) | async def convert_to_base64(self, image):
method process_uploaded_text_file (line 514) | async def process_uploaded_text_file(self, file_content: bytes, filena...
method convert_office_to_pdf_impl (line 561) | async def convert_office_to_pdf_impl(self, object_name: str, pdf_objec...
method convert_celery_states_to_custom (line 636) | def convert_celery_states_to_custom(self, process_celery_state: Option...
function get_data_process_service (line 674) | def get_data_process_service():
FILE: backend/services/datamate_service.py
function _create_datamate_knowledge_records (line 21) | async def _create_datamate_knowledge_records(knowledge_base_ids: List[str],
function _get_datamate_core (line 78) | def _get_datamate_core(tenant_id: str, datamate_url: Optional[str] = Non...
function fetch_datamate_knowledge_base_file_list (line 100) | async def fetch_datamate_knowledge_base_file_list(knowledge_base_id: str...
function sync_datamate_knowledge_bases_and_create_records (line 133) | async def sync_datamate_knowledge_bases_and_create_records(
function check_datamate_connection (line 264) | async def check_datamate_connection(
FILE: backend/services/dify_service.py
function fetch_dify_datasets_impl (line 22) | def fetch_dify_datasets_impl(
FILE: backend/services/file_management_service.py
function upload_files_impl (line 51) | async def upload_files_impl(destination: str, file: List[UploadFile], fo...
function upload_to_minio (line 138) | async def upload_to_minio(files: List[UploadFile], folder: str) -> List[...
function get_file_url_impl (line 172) | async def get_file_url_impl(object_name: str, expires: int):
function get_file_stream_impl (line 180) | async def get_file_stream_impl(object_name: str):
function delete_file_impl (line 188) | async def delete_file_impl(object_name: str):
function list_files_impl (line 196) | async def list_files_impl(prefix: str, limit: Optional[int] = None):
function get_llm_model (line 203) | def get_llm_model(tenant_id: str):
function preview_file_impl (line 218) | async def preview_file_impl(object_name: str) -> Tuple[BytesIO, str]:
function _get_cached_pdf_stream (line 264) | def _get_cached_pdf_stream(pdf_object_name: str) -> Optional[BytesIO]:
function _convert_office_to_cached_pdf (line 281) | async def _convert_office_to_cached_pdf(
FILE: backend/services/group_service.py
function get_group_info (line 31) | def get_group_info(group_id: Union[int, str, List[int]]) -> Union[Option...
function get_groups_by_tenant (line 72) | def get_groups_by_tenant(tenant_id: str, page: Optional[int] = 1, page_s...
function get_tenant_default_group_id (line 108) | def get_tenant_default_group_id(tenant_id: str) -> Optional[int]:
function set_tenant_default_group_id (line 127) | def set_tenant_default_group_id(tenant_id: str, group_id: int, updated_b...
function create_group (line 194) | def create_group(tenant_id: str, group_name: str, group_description: Opt...
function update_group (line 244) | def update_group(group_id: int, updates: Dict[str, Any], user_id: str) -...
function delete_group (line 295) | def delete_group(group_id: int, user_id: str) -> bool:
function add_user_to_single_group (line 336) | def add_user_to_single_group(group_id: int, user_id: str, current_user_i...
function remove_user_from_single_group (line 387) | def remove_user_from_single_group(group_id: int, user_id: str, current_u...
function get_group_users (line 430) | def get_group_users(group_id: int) -> List[Dict[str, Any]]:
function get_group_user_count (line 467) | def get_group_user_count(group_id: int) -> int:
function add_user_to_groups (line 488) | def add_user_to_groups(user_id: str, group_ids: List[int], current_user_...
function update_group_members (line 520) | def update_group_members(group_id: int, user_ids: List[str], current_use...
FILE: backend/services/idata_service.py
function _validate_idata_base_params (line 22) | def _validate_idata_base_params(
function _normalize_api_base (line 63) | def _normalize_api_base(idata_api_base: str) -> str:
function _make_idata_request (line 76) | def _make_idata_request(
function _parse_idata_response (line 155) | def _parse_idata_response(result: Dict[str, Any]) -> List[Dict[str, Any]]:
function fetch_idata_knowledge_spaces_impl (line 191) | def fetch_idata_knowledge_spaces_impl(
function fetch_idata_datasets_impl (line 258) | def fetch_idata_datasets_impl(
FILE: backend/services/image_service.py
function proxy_image_impl (line 16) | async def proxy_image_impl(decoded_url: str):
function get_vlm_model (line 33) | def get_vlm_model(tenant_id: str):
FILE: backend/services/invitation_service.py
function create_invitation_code (line 29) | def create_invitation_code(
function update_invitation_code (line 132) | def update_invitation_code(
function delete_invitation_code (line 175) | def delete_invitation_code(invitation_id: int, user_id: str) -> bool:
function _normalize_invitation_data (line 216) | def _normalize_invitation_data(invitation_data: Dict[str, Any]) -> Dict[...
function get_invitation_by_code (line 253) | def get_invitation_by_code(invitation_code: str) -> Optional[Dict[str, A...
function _calculate_current_status (line 270) | def _calculate_current_status(invitation_data: Dict[str, Any]) -> Dict[s...
function check_invitation_available (line 320) | def check_invitation_available(invitation_code: str) -> bool:
function use_invitation_code (line 343) | def use_invitation_code(
function update_invitation_code_status (line 391) | def update_invitation_code_status(invitation_id: int) -> bool:
function _generate_unique_invitation_code (line 448) | def _generate_unique_invitation_code(length: int = 6) -> str:
function get_invitations_list (line 474) | def get_invitations_list(
FILE: backend/services/mcp_container_service.py
class MCPContainerManager (line 24) | class MCPContainerManager:
method __init__ (line 32) | def __init__(self, docker_socket_path: Optional[str] = None):
method load_image_from_tar_file (line 53) | async def load_image_from_tar_file(self, tar_file_path: str) -> str:
method start_mcp_container (line 85) | async def start_mcp_container(
method start_mcp_container_from_tar (line 136) | async def start_mcp_container_from_tar(
method stop_mcp_container (line 184) | async def stop_mcp_container(self, container_id: str) -> bool:
method list_mcp_containers (line 210) | def list_mcp_containers(self, tenant_id: Optional[str] = None) -> List...
method get_container_logs (line 241) | def get_container_logs(self, container_id: str, tail: int = 100) -> str:
method stream_container_logs (line 258) | async def stream_container_logs(
FILE: backend/services/memory_config_service.py
function _aggregate_records (line 33) | def _aggregate_records(records: List[Dict[str, Union[str, int]]]) -> Dic...
function get_user_configs (line 49) | def get_user_configs(user_id: str) -> Dict[str, Union[str, List[str]]]:
function _update_single_config (line 66) | def _update_single_config(user_id: str, config_key: str, config_value: s...
function _add_multi_value (line 100) | def _add_multi_value(user_id: str, config_key: str, value: str) -> bool:
function _remove_multi_value (line 122) | def _remove_multi_value(user_id: str, config_key: str, value: str) -> bool:
function get_memory_switch (line 141) | def get_memory_switch(user_id: str) -> bool:
function set_memory_switch (line 146) | def set_memory_switch(user_id: str, enabled: bool) -> bool:
function get_agent_share (line 151) | def get_agent_share(user_id: str) -> MemoryAgentShareMode:
function set_agent_share (line 161) | def set_agent_share(user_id: str, mode: MemoryAgentShareMode) -> bool:
function get_disabled_agent_ids (line 166) | def get_disabled_agent_ids(user_id: str) -> List[str]:
function add_disabled_agent_id (line 171) | def add_disabled_agent_id(user_id: str, agent_id: str) -> bool:
function remove_disabled_agent_id (line 175) | def remove_disabled_agent_id(user_id: str, agent_id: str) -> bool:
function get_disabled_useragent_ids (line 181) | def get_disabled_useragent_ids(user_id: str) -> List[str]:
function add_disabled_useragent_id (line 186) | def add_disabled_useragent_id(user_id: str, ua_id: str) -> bool:
function remove_disabled_useragent_id (line 190) | def remove_disabled_useragent_id(user_id: str, ua_id: str) -> bool:
function build_memory_context (line 194) | def build_memory_context(user_id: str, tenant_id: str, agent_id: str | i...
FILE: backend/services/model_health_service.py
function _embedding_dimension_check (line 16) | async def _embedding_dimension_check(
function _perform_connectivity_check (line 54) | async def _perform_connectivity_check(
function check_model_connectivity (line 124) | async def check_model_connectivity(display_name: str, tenant_id: str) ->...
function verify_model_config_connectivity (line 178) | async def verify_model_config_connectivity(model_config: dict):
function embedding_dimension_check (line 232) | async def embedding_dimension_check(model_config: dict):
FILE: backend/services/model_management_service.py
function create_model_for_tenant (line 35) | async def create_model_for_tenant(user_id: str, tenant_id: str, model_da...
function create_provider_models_for_tenant (line 108) | async def create_provider_models_for_tenant(tenant_id: str, provider_req...
function batch_create_models_for_tenant (line 132) | async def batch_create_models_for_tenant(user_id: str, tenant_id: str, b...
function list_provider_models_for_tenant (line 196) | async def list_provider_models_for_tenant(tenant_id: str, provider: str,...
function update_single_model_for_tenant (line 211) | async def update_single_model_for_tenant(
function batch_update_models_for_tenant (line 274) | async def batch_update_models_for_tenant(user_id: str, tenant_id: str, m...
function delete_model_for_tenant (line 286) | async def delete_model_for_tenant(user_id: str, tenant_id: str, display_...
function list_models_for_tenant (line 347) | async def list_models_for_tenant(tenant_id: str):
function list_llm_models_for_tenant (line 379) | async def list_llm_models_for_tenant(tenant_id: str):
function list_models_for_admin (line 405) | async def list_models_for_admin(
FILE: backend/services/model_provider_service.py
function get_provider_models (line 27) | async def get_provider_models(model_data: dict) -> List[dict]:
function prepare_model_dict (line 60) | async def prepare_model_dict(provider: str, model: dict, model_url: str,...
function merge_existing_model_tokens (line 153) | def merge_existing_model_tokens(model_list: List[dict], tenant_id: str, ...
FILE: backend/services/northbound_service.py
class NorthboundContext (line 34) | class NorthboundContext:
function _now_seconds (line 54) | def _now_seconds() -> float:
function _minute_bucket (line 58) | def _minute_bucket(ts: Optional[float] = None) -> str:
function idempotency_start (line 63) | async def idempotency_start(key: str, ttl_seconds: Optional[int] = None)...
function idempotency_end (line 75) | async def idempotency_end(key: str) -> None:
function _release_idempotency_after_delay (line 80) | async def _release_idempotency_after_delay(key: str, seconds: int = 3) -...
function check_and_consume_rate_limit (line 85) | async def check_and_consume_rate_limit(tenant_id: str) -> None:
function _build_idempotency_key (line 99) | def _build_idempotency_key(*parts: Any) -> str:
function get_agent_info_by_name (line 117) | async def get_agent_info_by_name(agent_name: str, tenant_id: str) -> int:
function start_streaming_chat (line 124) | async def start_streaming_chat(
function stop_chat (line 206) | async def stop_chat(ctx: NorthboundContext, conversation_id: int, meta_d...
function list_conversations (line 228) | async def list_conversations(ctx: NorthboundContext) -> Dict[str, Any]:
function get_conversation_history_internal (line 260) | async def get_conversation_history_internal(ctx: NorthboundContext, conv...
function get_conversation_history (line 278) | async def get_conversation_history(ctx: NorthboundContext, conversation_...
function get_agent_info_list (line 285) | async def get_agent_info_list(ctx: NorthboundContext) -> Dict[str, Any]:
function update_conversation_title (line 297) | async def update_conversation_title(ctx: NorthboundContext, conversation...
FILE: backend/services/prompt_service.py
function gen_system_prompt_streamable (line 32) | def gen_system_prompt_streamable(agent_id: int, model_id: int, task_desc...
function generate_and_save_system_prompt_impl (line 59) | def generate_and_save_system_prompt_impl(agent_id: int,
function generate_system_prompt (line 226) | def generate_system_prompt(sub_agent_info_list, task_description, tool_i...
function _start_generation_threads (line 254) | def _start_generation_threads(content, prompt_for_generate, produce_queu...
function _stream_results (line 298) | def _stream_results(produce_queue, latest, stop_flags, threads, error_ho...
function join_info_for_generate_system_prompt (line 355) | def join_info_for_generate_system_prompt(prompt_for_generate, sub_agent_...
function get_enabled_tool_description_for_generate_prompt (line 373) | def get_enabled_tool_description_for_generate_prompt(agent_id: int, tena...
function get_enabled_sub_agent_description_for_generate_prompt (line 382) | def get_enabled_sub_agent_description_for_generate_prompt(agent_id: int,...
FILE: backend/services/providers/base.py
function _create_error_response (line 15) | def _create_error_response(error_code: str, message: str, http_code: int...
function _classify_provider_error (line 33) | def _classify_provider_error(
class AbstractModelProvider (line 144) | class AbstractModelProvider(ABC):
method get_models (line 148) | async def get_models(self, provider_config: Dict) -> List[Dict]:
FILE: backend/services/providers/dashscope_provider.py
class DashScopeModelProvider (line 9) | class DashScopeModelProvider(AbstractModelProvider):
method get_models (line 12) | async def get_models(self, provider_config: Dict) -> List[Dict]:
FILE: backend/services/providers/modelengine_provider.py
function get_model_engine_raw_url (line 14) | def get_model_engine_raw_url(model_engine_url: str) -> str:
class ModelEngineProvider (line 33) | class ModelEngineProvider(AbstractModelProvider):
method get_models (line 36) | async def get_models(self, provider_config: Dict) -> List[Dict]:
FILE: backend/services/providers/silicon_provider.py
class SiliconModelProvider (line 9) | class SiliconModelProvider(AbstractModelProvider):
method get_models (line 12) | async def get_models(self, provider_config: Dict) -> List[Dict]:
FILE: backend/services/providers/tokenpony_provider.py
class TokenPonyModelProvider (line 12) | class TokenPonyModelProvider(AbstractModelProvider):
method get_models (line 15) | async def get_models(self, provider_config: Dict) -> List[Dict]:
FILE: backend/services/redis_service.py
class RedisService (line 12) | class RedisService:
method __init__ (line 15) | def __init__(self):
method client (line 20) | def client(self) -> redis.Redis:
method backend_client (line 34) | def backend_client(self) -> redis.Redis:
method mark_task_cancelled (line 47) | def mark_task_cancelled(self, task_id: str, ttl_hours: int = 24) -> bool:
method is_task_cancelled (line 66) | def is_task_cancelled(self, task_id: str) -> bool:
method _cleanup_single_task_related_keys (line 84) | def _cleanup_single_task_related_keys(self, task_id: str) -> int:
method delete_knowledgebase_records (line 128) | def delete_knowledgebase_records(self, index_name: str) -> Dict[str, A...
method delete_document_records (line 175) | def delete_document_records(self, index_name: str, path_or_url: str) -...
method _recursively_delete_task_and_parents (line 218) | def _recursively_delete_task_and_parents(self, task_id: str) -> tuple[...
method _cleanup_celery_tasks (line 270) | def _cleanup_celery_tasks(self, index_name: str) -> int:
method _cleanup_cache_keys (line 404) | def _cleanup_cache_keys(self, index_name: str) -> int:
method _cleanup_document_celery_tasks (line 444) | def _cleanup_document_celery_tasks(self, index_name: str, path_or_url:...
method _cleanup_document_cache_keys (line 542) | def _cleanup_document_cache_keys(self, index_name: str, path_or_url: s...
method get_knowledgebase_task_count (line 593) | def get_knowledgebase_task_count(self, index_name: str) -> int:
method ping (line 640) | def ping(self) -> bool:
method save_error_info (line 650) | def save_error_info(self, task_id: str, error_reason: str, ttl_days: i...
method save_progress_info (line 693) | def save_progress_info(self, task_id: str, processed_chunks: int, tota...
method get_progress_info (line 731) | def get_progress_info(self, task_id: str) -> Optional[Dict[str, int]]:
method get_error_info (line 753) | def get_error_info(self, task_id: str) -> Optional[str]:
function get_redis_service (line 777) | def get_redis_service() -> RedisService:
FILE: backend/services/remote_mcp_service.py
function mcp_server_health (line 27) | async def mcp_server_health(remote_mcp_server: str, authorization_token:...
function add_remote_mcp_server_list (line 61) | async def add_remote_mcp_server_list(
function delete_remote_mcp_server_list (line 92) | async def delete_remote_mcp_server_list(tenant_id: str,
function update_remote_mcp_server_list (line 103) | async def update_remote_mcp_server_list(
function get_remote_mcp_server_list (line 159) | async def get_remote_mcp_server_list(tenant_id: str, user_id: str | None...
function attach_mcp_container_permissions (line 189) | def attach_mcp_container_permissions(
function check_mcp_health_and_update_db (line 240) | async def check_mcp_health_and_update_db(mcp_url, service_name, tenant_i...
function delete_mcp_by_container_id (line 267) | async def delete_mcp_by_container_id(tenant_id: str, user_id: str, conta...
function get_mcp_record_by_id (line 281) | async def get_mcp_record_by_id(mcp_id: int, tenant_id: str) -> dict | None:
function upload_and_start_mcp_image (line 303) | async def upload_and_start_mcp_image(
FILE: backend/services/tenant_service.py
function get_tenant_info (line 32) | def get_tenant_info(tenant_id: str) -> Dict[str, Any]:
function _ensure_tenant_name_config (line 67) | def _ensure_tenant_name_config(tenant_id: str) -> bool:
function check_tenant_name_exists (line 99) | def check_tenant_name_exists(tenant_name: str, exclude_tenant_id: Option...
function get_tenants_paginated (line 125) | def get_tenants_paginated(page: int = 1, page_size: int = 20) -> Dict[st...
function create_tenant (line 171) | def create_tenant(tenant_name: str, created_by: Optional[str] = None) ->...
function update_tenant_info (line 250) | def update_tenant_info(tenant_id: str, tenant_name: str, updated_by: Opt...
function delete_tenant (line 305) | async def delete_tenant(tenant_id: str, deleted_by: Optional[str] = None...
function _create_default_group_for_tenant (line 453) | def _create_default_group_for_tenant(tenant_id: str, created_by: Optiona...
FILE: backend/services/tool_configuration_service.py
function _create_mcp_transport (line 38) | def _create_mcp_transport(url: str, authorization_token: Optional[str] =...
function python_type_to_json_schema (line 61) | def python_type_to_json_schema(annotation: Any) -> str:
function get_local_tools (line 97) | def get_local_tools() -> List[ToolInfo]:
function get_local_tools_classes (line 144) | def get_local_tools_classes() -> List[type]:
function _build_tool_info_from_langchain (line 164) | def _build_tool_info_from_langchain(obj) -> ToolInfo:
function get_langchain_tools (line 202) | def get_langchain_tools() -> List[ToolInfo]:
function get_all_mcp_tools (line 227) | async def get_all_mcp_tools(tenant_id: str) -> List[ToolInfo]:
function search_tool_info_impl (line 257) | def search_tool_info_impl(agent_id: int, tool_id: int, tenant_id: str):
function update_tool_info_impl (line 287) | def update_tool_info_impl(tool_info: ToolInstanceInfoRequest, tenant_id:...
function get_tool_from_remote_mcp_server (line 311) | async def get_tool_from_remote_mcp_server(
function init_tool_list_for_tenant (line 377) | async def init_tool_list_for_tenant(tenant_id: str, user_id: str):
function update_tool_list (line 399) | async def update_tool_list(tenant_id: str, user_id: str):
function list_all_tools (line 425) | async def list_all_tools(tenant_id: str):
function load_last_tool_config_impl (line 451) | def load_last_tool_config_impl(tool_id: int, tenant_id: str, user_id: str):
function _call_mcp_tool (line 463) | async def _call_mcp_tool(
function _validate_mcp_tool_nexent (line 500) | async def _validate_mcp_tool_nexent(
function _validate_mcp_tool_remote (line 521) | async def _validate_mcp_tool_remote(
function _get_tool_class_by_name (line 560) | def _get_tool_class_by_name(tool_name: str) -> Optional[type]:
function _validate_local_tool (line 582) | def _validate_local_tool(
function _validate_langchain_tool (line 677) | def _validate_langchain_tool(
function validate_tool_impl (line 721) | async def validate_tool_impl(
FILE: backend/services/user_management_service.py
function set_auth_token_to_client (line 38) | def set_auth_token_to_client(client: Client, token: str) -> None:
function get_authorized_client (line 50) | def get_authorized_client(authorization: Optional[str] = Header(None)) -...
function get_current_user_from_client (line 60) | def get_current_user_from_client(client: Client, token: Optional[str] = ...
function validate_token (line 79) | def validate_token(token: str) -> Tuple[bool, Optional[Any]]:
function extend_session (line 93) | def extend_session(client: Client, refresh_token: str) -> Optional[dict]:
function check_auth_service_health (line 110) | async def check_auth_service_health():
function signup_user_with_invitation (line 130) | async def signup_user_with_invitation(email: EmailStr,
function parse_supabase_response (line 248) | async def parse_supabase_response(is_admin, response, user_role, auto_lo...
function generate_tts_stt_4_admin (line 272) | async def generate_tts_stt_4_admin(tenant_id, user_id):
function verify_invite_code (line 303) | async def verify_invite_code(invite_code):
function signin_user (line 323) | async def signin_user(email: EmailStr,
function refresh_user_token (line 363) | async def refresh_user_token(authorization, refresh_token: str):
function get_session_by_authorization (line 375) | async def get_session_by_authorization(authorization):
function get_user_info (line 397) | async def get_user_info(user_id: str) -> Optional[Dict[str, Any]]:
function format_role_permissions (line 450) | def format_role_permissions(permissions: List[Dict[str, Any]]) -> Dict[s...
function create_token (line 489) | def create_token(user_id: str) -> Dict[str, Any]:
function list_tokens_by_user (line 502) | def list_tokens_by_user(user_id: str) -> List[Dict[str, Any]]:
function delete_token (line 514) | def delete_token(token_id: int, user_id: str) -> bool:
FILE: backend/services/user_service.py
function get_users (line 22) | def get_users(tenant_id: str, page: Optional[int] = 1, page_size: Option...
function update_user (line 68) | async def update_user(user_id: str, update_data: Dict[str, Any], updated...
function delete_user_and_cleanup (line 116) | async def delete_user_and_cleanup(user_id: str, tenant_id: str) -> None:
FILE: backend/services/vectordatabase_service.py
function _update_progress (line 50) | def _update_progress(task_id: str, processed: int, total: int):
function get_vector_db_core (line 94) | def get_vector_db_core(
function _rethrow_or_plain (line 132) | def _rethrow_or_plain(exc: Exception) -> None:
function check_knowledge_base_exist_impl (line 149) | def check_knowledge_base_exist_impl(knowledge_name: str, vdb_core: Vecto...
function get_embedding_model (line 178) | def get_embedding_model(tenant_id: str, model_name: Optional[str] = None):
class ElasticSearchService (line 244) | class ElasticSearchService:
method full_delete_knowledge_base (line 246) | async def full_delete_knowledge_base(index_name: str, vdb_core: Vector...
method create_index (line 361) | def create_index(
method create_knowledge_base (line 390) | def create_knowledge_base(
method update_knowledge_base (line 451) | def update_knowledge_base(
method delete_index (line 508) | async def delete_index(
method list_indices (line 555) | def list_indices(
method index_documents (line 742) | def index_documents(
method list_files (line 911) | async def list_files(
method delete_documents (line 1154) | def delete_documents(
method health_check (line 1168) | def health_check(vdb_core: VectorDatabaseCore = Depends(get_vector_db_...
method summary_index_name (line 1189) | async def summary_index_name(self,
method get_random_documents (line 1301) | def get_random_documents(
method change_summary (line 1361) | def change_summary(
method get_summary (line 1393) | def get_summary(index_name: str = Path(..., description="Name of the i...
method get_index_chunks (line 1416) | def get_index_chunks(
method create_chunk (line 1475) | def create_chunk(
method update_chunk (line 1548) | def update_chunk(
method delete_chunk (line 1589) | def delete_chunk(
method search_hybrid (line 1613) | def search_hybrid(
method _generate_chunk_id (line 1676) | def _generate_chunk_id() -> str:
method _build_chunk_payload (line 1681) | def _build_chunk_payload(
FILE: backend/services/voice_service.py
class VoiceService (line 19) | class VoiceService:
method __init__ (line 22) | def __init__(self):
method start_stt_streaming_session (line 48) | async def start_stt_streaming_session(self, websocket) -> None:
method generate_tts_speech (line 65) | async def generate_tts_speech(self, text: str, stream: bool = True) ->...
method stream_tts_to_websocket (line 90) | async def stream_tts_to_websocket(self, websocket, text: str) -> None:
method check_stt_connectivity (line 142) | async def check_stt_connectivity(self) -> bool:
method check_tts_connectivity (line 165) | async def check_tts_connectivity(self) -> bool:
method check_voice_connectivity (line 188) | async def check_voice_connectivity(self, model_type: str) -> bool:
function get_voice_service (line 222) | def get_voice_service() -> VoiceService:
FILE: backend/tool_collection/mcp/local_mcp_service.py
function demo_tool (line 8) | async def demo_tool(para_1: str, para_2: int) -> str:
FILE: backend/utils/auth_utils.py
function calculate_hmac_signature (line 45) | def calculate_hmac_signature(secret_key: str, access_key: str, timestamp...
function validate_timestamp (line 55) | def validate_timestamp(timestamp: str) -> bool:
function extract_aksk_headers (line 66) | def extract_aksk_headers(headers: Dict[str, str]) -> Tuple[str, str, str]:
function get_aksk_config (line 78) | def get_aksk_config(tenant_id: str) -> Tuple[str, str]:
function verify_aksk_signature (line 87) | def verify_aksk_signature(access_key: str, timestamp: str, signature: st...
function validate_aksk_authentication (line 102) | def validate_aksk_authentication(headers: Dict[str, str], body: str, ten...
function validate_bearer_token (line 137) | def validate_bearer_token(authorization: Optional[str]) -> Tuple[bool, O...
function get_user_and_tenant_by_access_key (line 174) | def get_user_and_tenant_by_access_key(access_key: str) -> Dict[str, str]:
function get_supabase_client (line 214) | def get_supabase_client():
function get_supabase_admin_client (line 223) | def get_supabase_admin_client():
function get_jwt_expiry_seconds (line 232) | def get_jwt_expiry_seconds(token: str) -> int:
function calculate_expires_at (line 271) | def calculate_expires_at(token: Optional[str] = None) -> int:
function _extract_user_id_from_jwt_token (line 289) | def _extract_user_id_from_jwt_token(authorization: str) -> Optional[str]:
function get_current_user_id (line 340) | def get_current_user_id(authorization: Optional[str] = None) -> tuple[st...
function get_user_language (line 381) | def get_user_language(request: Request = None) -> str:
function generate_test_jwt (line 410) | def generate_test_jwt(user_id: str, expires_in: int = 3600) -> str:
function get_current_user_info (line 426) | def get_current_user_info(authorization: Optional[str] = None, request: ...
FILE: backend/utils/config_utils.py
function safe_value (line 19) | def safe_value(value):
function safe_list (line 26) | def safe_list(value):
function get_env_key (line 33) | def get_env_key(key: str) -> str:
function get_model_name_from_config (line 41) | def get_model_name_from_config(model_config: Dict[str, Any]) -> str:
class TenantConfigManager (line 52) | class TenantConfigManager:
method load_config (line 55) | def load_config(self, tenant_id: str, force_reload: bool = False):
method get_model_config (line 83) | def get_model_config(self, key: str, default=None, tenant_id: str | No...
method get_app_config (line 105) | def get_app_config(self, key: str, default="", tenant_id: str | None =...
method set_single_config (line 115) | def set_single_config(self, user_id: str | None = None, tenant_id: str...
method delete_single_config (line 137) | def delete_single_config(self, tenant_id: str | None = None, key: str ...
method update_single_config (line 150) | def update_single_config(self, tenant_id: str | None = None, key: str ...
FILE: backend/utils/document_vector_utils.py
function get_documents_from_es (line 35) | def get_documents_from_es(index_name: str, vdb_core: VectorDatabaseCore,...
function calculate_document_embedding (line 123) | def calculate_document_embedding(doc_chunks: List[Dict], use_weighted: b...
function auto_determine_k (line 172) | def auto_determine_k(embeddings: np.ndarray, min_k: int = 3, max_k: int ...
function merge_duplicate_documents_in_clusters (line 236) | def merge_duplicate_documents_in_clusters(clusters: Dict[int, List[str]]...
function kmeans_cluster_documents (line 392) | def kmeans_cluster_documents(doc_embeddings: Dict[str, np.ndarray], k: O...
function process_documents_for_clustering (line 455) | def process_documents_for_clustering(index_name: str, vdb_core, sample_d...
function summarize_document (line 494) | def summarize_document(document_content: str, filename: str, language: s...
function summarize_cluster (line 552) | def summarize_cluster(document_summaries: List[str], language: str = LAN...
function extract_representative_chunks_smart (line 612) | def extract_representative_chunks_smart(chunks: List[Dict], max_chunks: ...
function merge_cluster_summaries (line 672) | def merge_cluster_summaries(cluster_summaries: Dict[int, str]) -> str:
function analyze_cluster_coherence (line 702) | def analyze_cluster_coherence(cluster_doc_ids: List[str], document_sampl...
function summarize_clusters_map_reduce (line 730) | def summarize_clusters_map_reduce(document_samples: Dict[str, Dict], clu...
FILE: backend/utils/file_management_utils.py
function save_upload_file (line 23) | async def save_upload_file(file: UploadFile, upload_path: Path) -> bool:
function trigger_data_process (line 34) | async def trigger_data_process(files: List[dict], process_params: Proces...
function get_all_files_status (line 127) | async def get_all_files_status(index_name: str):
function _convert_to_custom_state (line 260) | async def _convert_to_custom_state(process_celery_state: str, forward_ce...
function get_file_size (line 319) | def get_file_size(source_type: str, path_or_url: str) -> int:
function convert_office_to_pdf (line 343) | async def convert_office_to_pdf(input_path: str, output_dir: str, timeou...
FILE: backend/utils/langchain_utils.py
function _is_langchain_tool (line 16) | def _is_langchain_tool(obj) -> bool:
function discover_langchain_modules (line 21) | def discover_langchain_modules(
FILE: backend/utils/llm_utils.py
function _process_thinking_tokens (line 14) | def _process_thinking_tokens(
function call_llm_for_system_prompt (line 57) | def call_llm_for_system_prompt(
FILE: backend/utils/logging_utils.py
class ColorFormatter (line 3) | class ColorFormatter(logging.Formatter):
method format (line 11) | def format(self, record):
function configure_logging (line 18) | def configure_logging(level=logging.INFO):
function configure_elasticsearch_logging (line 31) | def configure_elasticsearch_logging():
FILE: backend/utils/memory_utils.py
function build_memory_config (line 12) | def build_memory_config(tenant_id: str) -> Dict[str, Any]:
FILE: backend/utils/model_name_utils.py
function split_repo_name (line 4) | def split_repo_name(full_name: str):
function add_repo_to_name (line 14) | def add_repo_to_name(model_repo: str, model_name: str) -> str:
function split_display_name (line 32) | def split_display_name(full_name: str):
function sort_models_by_id (line 50) | def sort_models_by_id(model_list: List[dict]) -> List[dict]:
FILE: backend/utils/monitoring.py
function _initialize_monitoring (line 58) | def _initialize_monitoring():
FILE: backend/utils/prompt_template_utils.py
function get_prompt_template (line 12) | def get_prompt_template(template_type: str, language: str = LANGUAGE["ZH...
function get_prompt_generate_prompt_template (line 85) | def get_prompt_generate_prompt_template(language: str = LANGUAGE["ZH"]) ...
function get_agent_prompt_template (line 98) | def get_agent_prompt_template(is_manager: bool, language: str = LANGUAGE...
function get_generate_title_prompt_template (line 112) | def get_generate_title_prompt_template(language: str = 'zh') -> Dict[str...
function get_document_summary_prompt_template (line 125) | def get_document_summary_prompt_template(language: str = LANGUAGE["ZH"])...
function get_cluster_summary_reduce_prompt_template (line 138) | def get_cluster_summary_reduce_prompt_template(language: str = LANGUAGE[...
FILE: backend/utils/str_utils.py
function remove_think_blocks (line 5) | def remove_think_blocks(text: str) -> str:
function convert_list_to_string (line 12) | def convert_list_to_string(items: Optional[List[int]]) -> str:
function convert_string_to_list (line 27) | def convert_string_to_list(items_str: Optional[str]) -> List[int]:
FILE: backend/utils/task_status_utils.py
function format_status_for_api (line 6) | def format_status_for_api(status_value) -> str:
function has_result (line 24) | def has_result(task: Dict[str, Any]) -> bool:
function get_status_display (line 46) | def get_status_display(task: Dict[str, Any]) -> Dict[str, Any]:
FILE: backend/utils/thread_utils.py
class GlobalThreadPool (line 5) | class GlobalThreadPool:
method __new__ (line 8) | def __new__(cls, max_workers=10):
method submit (line 15) | def submit(self, fn, *args, **kwargs):
function submit (line 23) | def submit(fn, *args, **kwargs):
FILE: doc/docs/.vitepress/theme/index.ts
method enhanceApp (line 14) | enhanceApp({ app, router, siteData }) {
FILE: docker/init.sql
type "conversation_message_t" (line 7) | CREATE TABLE IF NOT EXISTS "conversation_message_t" (
type "conversation_message_unit_t" (line 36) | CREATE TABLE IF NOT EXISTS "conversation_message_unit_t" (
type "conversation_record_t" (line 63) | CREATE TABLE IF NOT EXISTS "conversation_record_t" (
type "conversation_source_image_t" (line 82) | CREATE TABLE IF NOT EXISTS "conversation_source_image_t" (
type "conversation_source_search_t" (line 111) | CREATE TABLE IF NOT EXISTS "conversation_source_search_t" (
type "model_record_t" (line 156) | CREATE TABLE IF NOT EXISTS "model_record_t" (
type "knowledge_record_t" (line 206) | CREATE TABLE IF NOT EXISTS "knowledge_record_t" (
type nexent (line 241) | CREATE TABLE IF NOT EXISTS nexent.ag_tool_info_t (
function update_ag_tool_info_update_time (line 263) | CREATE OR REPLACE FUNCTION update_ag_tool_info_update_time()
type nexent (line 298) | CREATE TABLE IF NOT EXISTS nexent.ag_tenant_agent_t (
function update_ag_tenant_agent_update_time (line 331) | CREATE OR REPLACE FUNCTION update_ag_tenant_agent_update_time()
type idx_ag_tenant_agent_t_is_new (line 378) | CREATE INDEX IF NOT EXISTS idx_ag_tenant_agent_t_is_new
type nexent (line 384) | CREATE TABLE IF NOT EXISTS nexent.ag_tool_instance_t (
function update_ag_tool_instance_update_time (line 417) | CREATE OR REPLACE FUNCTION update_ag_tool_instance_update_time()
type nexent (line 438) | CREATE TABLE IF NOT EXISTS nexent.tenant_config_t (
function update_tenant_config_update_time (line 469) | CREATE OR REPLACE FUNCTION update_tenant_config_update_time()
type nexent (line 484) | CREATE TABLE IF NOT EXISTS nexent.mcp_record_t (
function update_mcp_record_update_time (line 519) | CREATE OR REPLACE FUNCTION update_mcp_record_update_time()
type nexent (line 540) | CREATE TABLE IF NOT EXISTS nexent.user_tenant_t (
type nexent (line 568) | CREATE TABLE IF NOT EXISTS nexent.ag_agent_relation_t (
function update_ag_agent_relation_update_time (line 583) | CREATE OR REPLACE FUNCTION update_ag_agent_relation_update_time()
type "memory_user_config_t" (line 613) | CREATE TABLE IF NOT EXISTS "memory_user_config_t" (
function "update_memory_user_config_update_time" (line 641) | CREATE OR REPLACE FUNCTION "update_memory_user_config_update_time"()
type "nexent" (line 655) | CREATE TABLE IF NOT EXISTS "nexent"."partner_mapping_id_t" (
function "update_partner_mapping_update_time" (line 683) | CREATE OR REPLACE FUNCTION "update_partner_mapping_update_time"()
type nexent (line 697) | CREATE TABLE IF NOT EXISTS nexent.tenant_invitation_code_t (
type nexent (line 730) | CREATE TABLE IF NOT EXISTS nexent.tenant_invitation_record_t (
type nexent (line 753) | CREATE TABLE IF NOT EXISTS nexent.tenant_group_info_t (
type nexent (line 778) | CREATE TABLE IF NOT EXISTS nexent.tenant_group_user_t (
type nexent (line 801) | CREATE TABLE IF NOT EXISTS nexent.role_permission_t (
type nexent (line 1011) | CREATE TABLE IF NOT EXISTS nexent.ag_tenant_agent_version_t (
FILE: docker/scripts/sync_user_supabase2pg.py
function check_docker_containers (line 35) | def check_docker_containers():
function test_connection_with_psql (line 70) | def test_connection_with_psql(conn_params):
function load_environment_from_container (line 112) | def load_environment_from_container():
function get_postgres_connection_params (line 135) | def get_postgres_connection_params():
function get_supabase_params (line 159) | def get_supabase_params():
function get_db_connection (line 177) | def get_db_connection(conn_params):
function fetch_all_user_tenant_records (line 199) | def fetch_all_user_tenant_records(conn):
function get_user_email_from_supabase (line 230) | def get_user_email_from_supabase(user_id, supabase_url, service_role_key):
function determine_user_role (line 300) | def determine_user_role(user_id, tenant_id, user_email):
function update_user_record (line 328) | def update_user_record(conn, user_id, user_email, user_role):
function process_user_records (line 352) | def process_user_records(conn, supabase_params, records, dry_run=False):
function print_results (line 437) | def print_results(results):
function test_supabase_connection (line 459) | def test_supabase_connection(supabase_params):
function main (line 497) | def main():
FILE: docker/sql/v1.1.0_0619_add_tenant_config_t.sql
type nexent (line 10) | CREATE TABLE IF NOT EXISTS nexent.tenant_config_t (
function update_tenant_config_update_time (line 41) | CREATE OR REPLACE FUNCTION update_tenant_config_update_time()
FILE: docker/sql/v1.3.0_0630_add_mcp_record_t.sql
type nexent (line 9) | CREATE TABLE IF NOT EXISTS nexent.mcp_record_t (
function update_mcp_record_update_time (line 40) | CREATE OR REPLACE FUNCTION update_mcp_record_update_time()
FILE: docker/sql/v1.4.0_0708_add_user_tenant_t.sql
type nexent (line 2) | CREATE TABLE IF NOT EXISTS nexent.user_tenant_t (
FILE: docker/sql/v1.6.0_0723_add_agent_relation_t.sql
type nexent (line 5) | CREATE TABLE IF NOT EXISTS nexent.ag_agent_relation_t (
function update_ag_agent_relation_update_time (line 18) | CREATE OR REPLACE FUNCTION update_ag_agent_relation_update_time()
FILE: docker/sql/v1.7.1_0806_add_memory_user_config.sql
type "nexent" (line 11) | CREATE TABLE IF NOT EXISTS "nexent"."memory_user_config_t" (
function "update_memory_user_config_update_time" (line 42) | CREATE OR REPLACE FUNCTION "update_memory_user_config_update_time"()
FILE: docker/sql/v1.7.2.2_0820_add_partner_mapping_id_t.sql
type "nexent" (line 8) | CREATE TABLE IF NOT EXISTS "nexent"."partner_mapping_id_t" (
function "update_partner_mapping_update_time" (line 36) | CREATE OR REPLACE FUNCTION "update_partner_mapping_update_time"()
FILE: docker/sql/v1.7.9.2_1226_add_invitation_and_group_system.sql
type nexent (line 5) | CREATE TABLE IF NOT EXISTS nexent.tenant_invitation_code_t (
type nexent (line 38) | CREATE TABLE IF NOT EXISTS nexent.tenant_invitation_record_t (
type nexent (line 61) | CREATE TABLE IF NOT EXISTS nexent.tenant_group_info_t (
type nexent (line 86) | CREATE TABLE IF NOT EXISTS nexent.tenant_group_user_t (
type nexent (line 116) | CREATE TABLE IF NOT EXISTS nexent.role_permission_t (
FILE: docker/sql/v1.7.9.3_0122_add_is_new_to_ag_tenant_agent_t.sql
type idx_ag_tenant_agent_t_is_new (line 12) | CREATE INDEX IF NOT EXISTS idx_ag_tenant_agent_t_is_new
FILE: docker/sql/v1.8.0_0206_add_ag_tenant_agent_version_t .sql
type nexent (line 41) | CREATE TABLE IF NOT EXISTS nexent.ag_tenant_agent_version_t (
FILE: docker/sql/v1.8.1_0306_add_user_token_info.sql
type nexent (line 9) | CREATE TABLE IF NOT EXISTS nexent.user_token_info_t (
type idx_user_token_info_access_key (line 36) | CREATE UNIQUE INDEX IF NOT EXISTS idx_user_token_info_access_key ON nexe...
type idx_user_token_info_user_id (line 39) | CREATE INDEX IF NOT EXISTS idx_user_token_info_user_id ON nexent.user_to...
function update_user_token_info_update_time (line 42) | CREATE OR REPLACE FUNCTION update_user_token_info_update_time()
type nexent (line 65) | CREATE TABLE IF NOT EXISTS nexent.user_token_usage_log_t (
type idx_user_token_usage_log_token_id (line 96) | CREATE INDEX IF NOT EXISTS idx_user_token_usage_log_token_id ON nexent.u...
type idx_user_token_usage_log_function_name (line 99) | CREATE INDEX IF NOT EXISTS idx_user_token_usage_log_function_name ON nex...
FILE: docker/volumes/db/webhooks.sql
type supabase_functions (line 11) | CREATE TABLE supabase_functions.migrations (
type supabase_functions (line 18) | CREATE TABLE supabase_functions.hooks (
type supabase_functions_hooks_request_id_idx (line 25) | CREATE INDEX supabase_functions_hooks_request_id_idx ON supabase_functio...
type supabase_functions_hooks_h_table_id_h_name_idx (line 26) | CREATE INDEX supabase_functions_hooks_h_table_id_h_name_idx ON supabase_...
function supabase_functions (line 28) | CREATE FUNCTION supabase_functions.http_request()
function extensions (line 164) | CREATE OR REPLACE FUNCTION extensions.grant_pg_net_access()
FILE: docker/volumes/functions/main/index.ts
constant JWT_SECRET (line 6) | const JWT_SECRET = Deno.env.get('JWT_SECRET')
constant VERIFY_JWT (line 7) | const VERIFY_JWT = Deno.env.get('VERIFY_JWT') === 'true'
function getAuthToken (line 9) | function getAuthToken(req: Request) {
function verifyJWT (line 21) | async function verifyJWT(jwt: string): Promise<boolean> {
FILE: experimental/tune/base/case.py
class Case (line 14) | class Case(BaseModel):
method check_message_list_content (line 21) | def check_message_list_content(cls, value: List[Dict], info: FieldVali...
class CaseInfo (line 35) | class CaseInfo(BaseModel):
class CaseManager (line 45) | class CaseManager:
method validate_with_convert (line 55) | def validate_with_convert(data: List[Dict[str, Any]],
method default_convertor (line 104) | def default_convertor(cases: List, idx: int, is_last: bool, info: Case...
method _get_case_value_with_check (line 132) | def _get_case_value_with_check(data: Dict[str, Any], key: str, index: ...
FILE: experimental/tune/base/constant.py
class TuneConstant (line 5) | class TuneConstant:
class TaskStatus (line 63) | class TaskStatus:
FILE: experimental/tune/base/context_manager.py
class OptimizeProgress (line 16) | class OptimizeProgress:
method __init__ (line 17) | def __init__(self, ctx_id):
method status (line 21) | def status(self) -> str:
method error_msg (line 25) | def error_msg(self) -> str:
method best_prompt (line 29) | def best_prompt(self) -> str:
method base_accuracy (line 38) | def base_accuracy(self) -> Optional[float]:
method best_accuracy (line 45) | def best_accuracy(self) -> Optional[float]:
method current_iteration (line 49) | def current_iteration(self) -> int:
method stop (line 53) | def stop(self) -> bool:
method delete (line 63) | def delete(self):
method get_history (line 67) | def get_history(self):
method _context (line 74) | def _context(self):
class ContextManager (line 77) | class ContextManager(metaclass=Singleton):
method __init__ (line 79) | def __init__(self):
method __len__ (line 86) | def __len__(self):
method get_task_progress (line 91) | def get_task_progress(self, ctx_id: str):
method get_context_attr (line 94) | def get_context_attr(self, ctx_id: str, attr_name: str):
method set_context_attr (line 99) | def set_context_attr(self, ctx_id: str, attr_name: str, value: Any):
method set (line 107) | def set(self, ctx_id: str, context: Context):
method get (line 112) | def get(self, ctx_id: str) -> Optional[Context]:
method is_executable (line 117) | def is_executable(self):
method set_checkpoint (line 125) | def set_checkpoint(self, ctx_id: str, context: Context):
method get_checkpoint (line 134) | def get_checkpoint(self, ctx_id: str) -> Optional[Context]:
method delete (line 142) | def delete(self, ctx_id: str):
method clear (line 150) | def clear(self):
method items (line 156) | def items(self):
FILE: experimental/tune/base/exception.py
class CaseValidationException (line 4) | class CaseValidationException(JiuWenBaseException):
method __init__ (line 6) | def __init__(self, message: str, error_index: int = TuneConstant.ROOT_...
method error_index (line 15) | def error_index(self):
class OnStopException (line 20) | class OnStopException(JiuWenBaseException):
method __init__ (line 22) | def __init__(self, message: str):
FILE: experimental/tune/base/utils.py
class TaskInfo (line 19) | class TaskInfo(BaseModel):
class OptimizeInfo (line 27) | class OptimizeInfo(BaseModel):
class JointParameters (line 46) | class JointParameters(BaseModel):
class History (line 63) | class History(BaseModel):
class BaseModelInfo (line 74) | class BaseModelInfo(BaseModel):
method handle_model_name (line 85) | def handle_model_name(cls, v, values):
class Config (line 90) | class Config:
class Response (line 94) | class Response(BaseModel):
class BaseChatModel (line 98) | class BaseChatModel:
method invoke (line 99) | def invoke(self, messages: List[Any]):
class ModelFactory (line 103) | class ModelFactory(metaclass=Singleton):
method get_model (line 104) | def get_model(self, model_provider: str, model_info: BaseModelInfo) ->...
class LLMModelInfo (line 108) | class LLMModelInfo(BaseModel):
class LLMModelProcess (line 118) | class LLMModelProcess:
method __init__ (line 120) | def __init__(self, llm_model_info: LLMModelInfo):
method chat (line 144) | def chat(self, messages: List[Any]) -> Dict:
function load_yaml_to_dict (line 150) | def load_yaml_to_dict(file_path: str) -> Dict:
function calculate_runtime (line 163) | def calculate_runtime(start_time: str) -> int:
function placeholder_to_dict (line 186) | def placeholder_to_dict(placeholder_list: List, select_all: bool = False...
function examples_to_string_list (line 198) | def examples_to_string_list(example_list: List) -> List[str]:
function get_example_question (line 212) | def get_example_question(example):
FILE: experimental/tune/common/exception.py
class JiuWenException (line 3) | class JiuWenException(Exception):
method __init__ (line 4) | def __init__(self,
class JiuWenBaseException (line 9) | class JiuWenBaseException(Exception):
method __init__ (line 10) | def __init__(self,
method __str__ (line 17) | def __str__(self):
method error_code (line 21) | def error_code(self):
method message (line 25) | def message(self):
class ParamCheckFailedException (line 29) | class ParamCheckFailedException(JiuWenBaseException):
method __init__ (line 30) | def __init__(self, message: str):
class StatusCode (line 35) | class StatusCode(Enum):
method code (line 55) | def code(self) -> int:
method errmsg (line 59) | def errmsg(self) -> str:
FILE: experimental/tune/common/singleton.py
class Singleton (line 7) | class Singleton(abc.ABCMeta, type):
method __call__ (line 10) | def __call__(cls, *args, **kwargs):
FILE: experimental/tune/joint_evaluator.py
class JointEvaluatorWithRef (line 23) | class JointEvaluatorWithRef:
method __init__ (line 25) | def __init__(self, opt_model_info: LLMModelInfo, infer_model_info: LLM...
method parse_json (line 35) | def parse_json(json_like_string: str) -> Dict[str, Any]:
method compare_text (line 53) | def compare_text(label: str, predict: str):
method compare_llm (line 60) | def compare_llm(self, question, label, predict):
method evaluate_result (line 86) | def evaluate_result(self, question, label, predict):
method chat_completion (line 92) | def chat_completion(self, user_prompt, system_prompt, is_assistant: bo...
method handle_inference_with_retry (line 102) | def handle_inference_with_retry(self, user_prompt, system_prompt=None,...
method infer_and_compare_example (line 113) | def infer_and_compare_example(self, prompt, example, stop_event: threa...
method evaluate (line 147) | def evaluate(self, prompt, dataset, stop_event: threading.Event):
FILE: experimental/tune/joint_optimizer.py
class SpecificMatch (line 27) | class SpecificMatch:
class JointOptimizer (line 32) | class JointOptimizer:
method __init__ (line 33) | def __init__(self):
method get_optimize_placeholder (line 48) | def get_optimize_placeholder(placeholder):
method extract_optimized_prompt_from_response (line 59) | def extract_optimized_prompt_from_response(content) -> Optional[str]:
method extract_optimized_placeholder_from_response (line 69) | def extract_optimized_placeholder_from_response(content) -> Optional[L...
method fill_prompt (line 83) | def fill_prompt(instruction: str, placeholder: List) -> str:
method extract_examples_from_response (line 94) | def extract_examples_from_response(content):
method prepare_optimization_template (line 113) | def prepare_optimization_template(template, instruction, placeholders,...
method validate_placeholder (line 123) | def validate_placeholder(prompt, placeholders):
method _check_stop_event (line 168) | def _check_stop_event(context: Context) -> bool:
method get_variable_from_dataset (line 176) | def get_variable_from_dataset(dataset, prompt):
method chat_completion (line 187) | def chat_completion(self, user_prompt, system_prompt=None, is_assistan...
method resample_examples (line 213) | def resample_examples(self, sampled_incorrect_data):
method evaluate (line 238) | def evaluate(self, prompt, context: Context):
method get_task_description (line 250) | def get_task_description(self):
method get_answer_format (line 257) | def get_answer_format(self):
method init_parameters (line 264) | def init_parameters(self, optimize_info: OptimizeInfo, raw_prompt, con...
method prompt_combine (line 282) | def prompt_combine(self, instruction: str, example_string=None, cot_ex...
method update_placeholder (line 296) | def update_placeholder(self, new_placeholders: List, placeholders_to_u...
method optimize_instruction_by_gradient (line 310) | def optimize_instruction_by_gradient(self, tools: Optional[List]) -> T...
method optimize_instruction_without_placeholder (line 344) | def optimize_instruction_without_placeholder(self, instruction, error_...
method optimize_instruction_with_placeholder (line 354) | def optimize_instruction_with_placeholder(self, instruction, error_exa...
method select_best_examples (line 399) | def select_best_examples(self, context: Context) -> List:
method generate_best_reasoning_examples (line 429) | def generate_best_reasoning_examples(self, context: Context) -> List:
method get_example_reasoning (line 463) | def get_example_reasoning(self, question, answer):
method evaluate_baseline (line 478) | def evaluate_baseline(self, context: Context) -> History:
method sample_example (line 494) | def sample_example(self, num_examples: int):
method prepare_fewshot_examples (line 521) | def prepare_fewshot_examples(self):
method do_optimize (line 535) | def do_optimize(self,
method continue_optimize (line 587) | def continue_optimize(self, task_id: str):
method load_state (line 640) | def load_state(self, context: Context):
method save_state (line 651) | def save_state(self, context: Context, history: Optional[History] = No...
method optimize_prompt_iteratively (line 675) | def optimize_prompt_iteratively(self, context: Context, begin_iteratio...
method _optimize_instruction (line 697) | def _optimize_instruction(self, context: Context) -> Optional[History]:
method _optimize_examples (line 739) | def _optimize_examples(self, context: Context) -> Optional[History]:
method _get_example_string (line 778) | def _get_example_string(self, examples: List):
method _get_examples_string_list (line 784) | def _get_examples_string_list(self, examples: List) -> List[str]:
method _get_full_prompt (line 798) | def _get_full_prompt(self, instruction, placeholders):
FILE: frontend/app/[locale]/agents/AgentVersionCard.tsx
function formatUtcToLocal (line 67) | function formatUtcToLocal(dateTimeStr?: string | null) {
function getStatusConfig (line 92) | function getStatusConfig(isCurrentVersion: boolean) {
function VersionCardItem (line 119) | function VersionCardItem({
FILE: frontend/app/[locale]/agents/AgentVersionManage.tsx
function AgentVersionManage (line 14) | function AgentVersionManage() {
FILE: frontend/app/[locale]/agents/components/AgentConfigComp.tsx
type AgentConfigCompProps (line 16) | interface AgentConfigCompProps {}
function AgentConfigComp (line 18) | function AgentConfigComp({}: AgentConfigCompProps) {
FILE: frontend/app/[locale]/agents/components/AgentInfoComp.tsx
type AgentInfoCompProps (line 19) | interface AgentInfoCompProps {
function AgentInfoComp (line 25) | function AgentInfoComp({
FILE: frontend/app/[locale]/agents/components/AgentManageComp.tsx
function AgentManageComp (line 20) | function AgentManageComp() {
FILE: frontend/app/[locale]/agents/components/agentConfig/CollaborativeAgent.tsx
type CollaborativeAgentProps (line 10) | interface CollaborativeAgentProps {}
function CollaborativeAgent (line 12) | function CollaborativeAgent({}: CollaborativeAgentProps) {
FILE: frontend/app/[locale]/agents/components/agentConfig/McpConfigModal.tsx
function McpConfigModal (line 43) | function McpConfigModal({
FILE: frontend/app/[locale]/agents/components/agentConfig/ToolManagement.tsx
type ToolManagementProps (line 18) | interface ToolManagementProps {
constant TOOLS_REQUIRING_KB_SELECTION (line 25) | const TOOLS_REQUIRING_KB_SELECTION = [
constant TOOLS_REQUIRING_EMBEDDING (line 33) | const TOOLS_REQUIRING_EMBEDDING = [
constant TOOLS_REQUIRING_VLM (line 38) | const TOOLS_REQUIRING_VLM = [
function getToolKbType (line 42) | function getToolKbType(
function isToolDisabledDueToVlm (line 55) | function isToolDisabledDueToVlm(toolName: string, vlmAvailable: boolean)...
function isToolDisabledDueToEmbedding (line 63) | function isToolDisabledDueToEmbedding(toolName: string, embeddingAvailab...
function ToolManagement (line 72) | function ToolManagement({
FILE: frontend/app/[locale]/agents/components/agentConfig/tool/ToolConfigModal.tsx
type ToolConfigModalProps (line 33) | interface ToolConfigModalProps {
constant TOOLS_REQUIRING_KB_SELECTION (line 45) | const TOOLS_REQUIRING_KB_SELECTION = [
function ToolConfigModal (line 52) | function ToolConfigModal({
FILE: frontend/app/[locale]/agents/components/agentConfig/tool/ToolTestPanel.tsx
type ToolTestPanelProps (line 19) | interface ToolTestPanelProps {
function ToolTestPanel (line 30) | function ToolTestPanel({
FILE: frontend/app/[locale]/agents/components/agentInfo/AgentGenerateDetail.tsx
type AgentGenerateDetailProps (line 42) | interface AgentGenerateDetailProps {
function AgentGenerateDetail (line 49) | function AgentGenerateDetail({
FILE: frontend/app/[locale]/agents/components/agentInfo/DebugConfig.tsx
type AgentDebuggingProps (line 23) | interface AgentDebuggingProps {
type DebugConfigProps (line 32) | interface DebugConfigProps {
function AgentDebugging (line 39) | function AgentDebugging({
function DebugConfig (line 173) | function DebugConfig({ agentId }: DebugConfigProps) {
FILE: frontend/app/[locale]/agents/components/agentInfo/ExpandEditModal.tsx
type ExpandEditModalProps (line 5) | interface ExpandEditModalProps {
function ExpandEditModal (line 14) | function ExpandEditModal({
FILE: frontend/app/[locale]/agents/components/agentManage/AgentCallRelationshipModal.tsx
constant NODE_W (line 24) | const NODE_W = 140;
constant NODE_H (line 25) | const NODE_H = 60;
constant AGENT_W (line 28) | const AGENT_W = 160;
constant AGENT_H (line 29) | const AGENT_H = 56;
constant TOOL_SIZE (line 30) | const TOOL_SIZE = 100;
constant TOOL_TEETH (line 31) | const TOOL_TEETH = 10;
constant TOOL_TEETH_DEPTH_RATIO (line 32) | const TOOL_TEETH_DEPTH_RATIO = 0.085;
constant MAX_TOOL_NAME_CHARS (line 34) | const MAX_TOOL_NAME_CHARS = 24;
constant TREE_DEPTH_FACTOR (line 36) | const TREE_DEPTH_FACTOR = 120;
constant TREE_SEP_SIB (line 37) | const TREE_SEP_SIB = 1.5;
constant TREE_SEP_NON (line 38) | const TREE_SEP_NON = 1.8;
function truncateByCodePoints (line 41) | function truncateByCodePoints(s: string, max: number) {
function AgentCallRelationshipModal (line 233) | function AgentCallRelationshipModal({
FILE: frontend/app/[locale]/agents/components/agentManage/AgentList.tsx
type AgentListProps (line 26) | interface AgentListProps {
function AgentList (line 30) | function AgentList({
FILE: frontend/app/[locale]/agents/page.tsx
function AgentSetupOrchestrator (line 16) | function AgentSetupOrchestrator() {
FILE: frontend/app/[locale]/agents/versions/AgentVersionCompareModal.tsx
type AgentVersionCompareModalProps (line 20) | interface AgentVersionCompareModalProps {
function AgentVersionCompareModal (line 44) | function AgentVersionCompareModal({
FILE: frontend/app/[locale]/agents/versions/AgentVersionPubulishModal.tsx
type AgentVersionPubulishModalProps (line 14) | interface AgentVersionPubulishModalProps {
function AgentVersionPubulishModal (line 28) | function AgentVersionPubulishModal({
FILE: frontend/app/[locale]/chat/components/chatAgentSelector.tsx
function ChatAgentSelector (line 15) | function ChatAgentSelector({
FILE: frontend/app/[locale]/chat/components/chatHeader.tsx
type ChatHeaderProps (line 15) | interface ChatHeaderProps {
function ChatHeader (line 20) | function ChatHeader({ title, onRename }: ChatHeaderProps) {
FILE: frontend/app/[locale]/chat/components/chatInput.tsx
function ImageViewer (line 31) | function ImageViewer({
function FileViewer (line 71) | function FileViewer({ file, onClose }: { file: File; onClose: () => void...
constant MAX_FILE_COUNT (line 287) | const MAX_FILE_COUNT = chatConfig.maxFileCount;
constant MAX_FILE_SIZE (line 288) | const MAX_FILE_SIZE = chatConfig.maxFileSize;
type ChatInputProps (line 290) | interface ChatInputProps {
function ChatInput (line 310) | function ChatInput({
FILE: frontend/app/[locale]/chat/components/chatLeftSidebar.tsx
type ChatSidebarProps (line 87) | interface ChatSidebarProps {
constant CONVERSATION_TITLE_MAX_LENGTH (line 95) | const CONVERSATION_TITLE_MAX_LENGTH = 100;
function ChatSidebar (line 97) | function ChatSidebar({
FILE: frontend/app/[locale]/chat/components/chatRightPanel.tsx
function ChatRightPanel (line 13) | function ChatRightPanel({
FILE: frontend/app/[locale]/chat/internal/ChatTopNavContent.tsx
function ChatTopNavContent (line 11) | function ChatTopNavContent() {
FILE: frontend/app/[locale]/chat/internal/chatAttachment.tsx
function ChatAttachment (line 314) | function ChatAttachment({
FILE: frontend/app/[locale]/chat/internal/chatInterface.tsx
function ChatInterface (line 55) | function ChatInterface() {
FILE: frontend/app/[locale]/chat/internal/extractMsgFromHistoryResponse.tsx
function extractAssistantMsgFromResponse (line 30) | function extractAssistantMsgFromResponse(
function extractUserMsgFromResponse (line 259) | function extractUserMsgFromResponse(
FILE: frontend/app/[locale]/chat/page.tsx
function ChatContent (line 13) | function ChatContent() {
FILE: frontend/app/[locale]/chat/streaming/chatStreamFinalMessage.tsx
type FinalMessageProps (line 25) | interface FinalMessageProps {
type TTSStatus (line 40) | type TTSStatus = typeof chatConfig.ttsStatus[keyof typeof chatConfig.tts...
function ChatStreamFinalMessageInner (line 42) | function ChatStreamFinalMessageInner({
function areEqualFinalMessage (line 415) | function areEqualFinalMessage(prev: FinalMessageProps, next: FinalMessag...
FILE: frontend/app/[locale]/chat/streaming/chatStreamHandler.tsx
type JsonData (line 29) | interface JsonData {
FILE: frontend/app/[locale]/chat/streaming/chatStreamMain.tsx
function ChatStreamMain (line 16) | function ChatStreamMain({
FILE: frontend/app/[locale]/chat/streaming/messageTransformer.ts
function transformMessagesToTaskMessages (line 11) | function transformMessagesToTaskMessages(
FILE: frontend/app/[locale]/chat/streaming/taskWindow.tsx
type KnowledgeSiteInfo (line 168) | type KnowledgeSiteInfo = {
type TaskWindowProps (line 1105) | interface TaskWindowProps {
function TaskWindowInner (line 1111) | function TaskWindowInner({ messages, isStreaming = false, defaultExpande...
function areEqualTaskWindow (line 1595) | function areEqualTaskWindow(prev: TaskWindowProps, next: TaskWindowProps...
FILE: frontend/app/[locale]/knowledges/KnowledgeBaseConfiguration.tsx
type EmptyStateProps (line 48) | interface EmptyStateProps {
type AppProviderProps (line 85) | interface AppProviderProps {
type DataConfigWrapperProps (line 105) | interface DataConfigWrapperProps {
function DataConfigWrapper (line 109) | function DataConfigWrapper({
type DataConfigProps (line 119) | interface DataConfigProps {
function DataConfig (line 123) | function DataConfig({ isActive }: DataConfigProps) {
FILE: frontend/app/[locale]/knowledges/components/document/DocumentChunk.tsx
type Chunk (line 38) | interface Chunk {
type ChunkFormValues (line 49) | interface ChunkFormValues {
type DocumentChunkProps (line 55) | interface DocumentChunkProps {
constant PAGE_SIZE (line 66) | const PAGE_SIZE = 10;
constant TABS_ROOT_CLASS (line 68) | const TABS_ROOT_CLASS = "document-chunk-tabs";
FILE: frontend/app/[locale]/knowledges/components/document/DocumentList.tsx
constant CONTAINER_HEIGHT_CLASS_MAP (line 40) | const CONTAINER_HEIGHT_CLASS_MAP: Record<string, string> = {
constant TITLE_BAR_HEIGHT_CLASS_MAP (line 47) | const TITLE_BAR_HEIGHT_CLASS_MAP: Record<string, string> = {
type DocumentListProps (line 51) | interface DocumentListProps {
type DocumentListRef (line 88) | interface DocumentListRef {
FILE: frontend/app/[locale]/knowledges/components/document/DocumentStatus.tsx
type DocumentStatusProps (line 9) | interface DocumentStatusProps {
FILE: frontend/app/[locale]/knowledges/components/knowledge/KnowledgeBaseEditModal.tsx
type KnowledgeBaseEditModalProps (line 14) | interface KnowledgeBaseEditModalProps {
function KnowledgeBaseEditModal (line 22) | function KnowledgeBaseEditModal({
FILE: frontend/app/[locale]/knowledges/components/knowledge/KnowledgeBaseList.tsx
type KnowledgeBaseListProps (line 31) | interface KnowledgeBaseListProps {
FILE: frontend/app/[locale]/knowledges/components/upload/UploadArea.tsx
type UploadAreaProps (line 17) | interface UploadAreaProps {
type UploadAreaRef (line 34) | interface UploadAreaRef {
FILE: frontend/app/[locale]/knowledges/components/upload/UploadAreaUI.tsx
type UploadAreaUIProps (line 12) | interface UploadAreaUIProps {
FILE: frontend/app/[locale]/knowledges/contexts/DocumentContext.tsx
type DocumentProviderProps (line 137) | interface DocumentProviderProps {
FILE: frontend/app/[locale]/knowledges/contexts/KnowledgeBaseContext.tsx
type KnowledgeBaseProviderProps (line 147) | interface KnowledgeBaseProviderProps {
FILE: frontend/app/[locale]/knowledges/contexts/UIStateContext.tsx
type UIProviderProps (line 78) | interface UIProviderProps {
FILE: frontend/app/[locale]/knowledges/page.tsx
function KnowledgesContent (line 17) | function KnowledgesContent() {
FILE: frontend/app/[locale]/layout.client.tsx
function ClientLayout (line 23) | function ClientLayout({ children }: { children: ReactNode }) {
FILE: frontend/app/[locale]/layout.tsx
function generateMetadata (line 17) | async function generateMetadata({
function RootLayout (line 35) | async function RootLayout({
FILE: frontend/app/[locale]/market/components/AgentMarketCard.tsx
type AgentMarketCardProps (line 11) | interface AgentMarketCardProps {
function AgentMarketCard (line 22) | function AgentMarketCard({
FILE: frontend/app/[locale]/market/components/MarketAgentDetailModal.tsx
type MarketAgentDetailModalProps (line 18) | interface MarketAgentDetailModalProps {
function MarketAgentDetailModal (line 29) | function MarketAgentDetailModal({
FILE: frontend/app/[locale]/market/components/MarketErrorState.tsx
type MarketErrorStateProps (line 13) | interface MarketErrorStateProps {
function MarketErrorState (line 22) | function MarketErrorState({ type }: MarketErrorStateProps) {
FILE: frontend/app/[locale]/market/page.tsx
function MarketContent (line 30) | function MarketContent() {
FILE: frontend/app/[locale]/mcp-tools/page.tsx
function McpToolsContent (line 14) | function McpToolsContent({}) {
FILE: frontend/app/[locale]/memory/MemoryMenuList.tsx
type MemoryMenuListProps (line 13) | interface MemoryMenuListProps {
function MemoryMenuList (line 22) | function MemoryMenuList({
FILE: frontend/app/[locale]/memory/page.tsx
function MemoryContent (line 40) | function MemoryContent() {
FILE: frontend/app/[locale]/models/ModelConfiguration.tsx
type AppModelConfigProps (line 23) | interface AppModelConfigProps {
function AppModelConfig (line 29) | function AppModelConfig({
FILE: frontend/app/[locale]/models/components/model/ModelAddDialog.tsx
type AddedModel (line 31) | interface AddedModel {
type ModelAddDialogProps (line 36) | interface ModelAddDialogProps {
constant DEFAULT_FORM_STATE (line 46) | const DEFAULT_FORM_STATE = {
FILE: frontend/app/[locale]/models/components/model/ModelChunkSizeSilder.tsx
constant DEFAULT_EXPECTED_CHUNK_SIZE (line 5) | const DEFAULT_EXPECTED_CHUNK_SIZE = 1024;
constant DEFAULT_MAXIMUM_CHUNK_SIZE (line 6) | const DEFAULT_MAXIMUM_CHUNK_SIZE = 1536;
type ModelChunkSizeSliderProps (line 8) | interface ModelChunkSizeSliderProps {
FILE: frontend/app/[locale]/models/components/model/ModelDeleteDialog.tsx
type ModelDeleteDialogProps (line 21) | interface ModelDeleteDialogProps {
FILE: frontend/app/[locale]/models/components/model/ModelEditDialog.tsx
type ModelEditDialogProps (line 17) | interface ModelEditDialogProps {
type ProviderConfigEditDialogProps (line 427) | interface ProviderConfigEditDialogProps {
FILE: frontend/app/[locale]/models/components/model/ModelListCard.tsx
constant CONNECT_STATUS_COLORS (line 21) | const CONNECT_STATUS_COLORS: Record<ModelConnectStatus | "default", stri...
constant PULSE_ANIMATION (line 30) | const PULSE_ANIMATION = `
type ModelListCardProps (line 115) | interface ModelListCardProps {
FILE: frontend/app/[locale]/models/components/modelConfig.tsx
type ModelConnectStatus (line 32) | type ModelConnectStatus = (typeof MODEL_STATUS)[keyof typeof MODEL_STATUS];
type ModelConfigSectionRef (line 71) | interface ModelConfigSectionRef {
type ModelConfigSectionProps (line 86) | interface ModelConfigSectionProps {
FILE: frontend/app/[locale]/models/page.tsx
function ModelsContent (line 15) | function ModelsContent() {
FILE: frontend/app/[locale]/monitoring/page.tsx
function MonitoringContent (line 14) | function MonitoringContent({}) {
FILE: frontend/app/[locale]/page.tsx
function Homepage (line 24) | function Homepage() {
type FeatureCardProps (line 200) | interface FeatureCardProps {
function FeatureCard (line 206) | function FeatureCard({ icon, title, description }: FeatureCardProps) {
FILE: frontend/app/[locale]/setup/page.tsx
type SetupStep (line 13) | type SetupStep = "models" | "knowledges" | "agents";
function SetupPage (line 15) | function SetupPage() {
FILE: frontend/app/[locale]/space/components/AgentCard.tsx
type AgentCardProps (line 36) | interface AgentCardProps {
function AgentCard (line 41) | function AgentCard({ agent, onRefresh }: AgentCardProps) {
FILE: frontend/app/[locale]/space/components/AgentDetailModal.tsx
type AgentDetailModalProps (line 20) | interface AgentDetailModalProps {
function AgentDetailModal (line 27) | function AgentDetailModal({
FILE: frontend/app/[locale]/space/page.tsx
function SpacePage (line 22) | function SpacePage() {
FILE: frontend/app/[locale]/tenant-resources/components/UserManageComp.tsx
constant DEFAULT_PAGE_SIZE (line 48) | const DEFAULT_PAGE_SIZE = 20;
function TenantList (line 52) | function TenantList({
function UserManageComp (line 550) | function UserManageComp() {
FILE: frontend/app/[locale]/tenant-resources/components/resources/AgentList.tsx
type AgentDetail (line 40) | interface AgentDetail extends Agent {
type AgentListRow (line 47) | type AgentListRow = Pick<
function AgentList (line 59) | function AgentList({ tenantId }: { tenantId: string | null }) {
FILE: frontend/app/[locale]/tenant-resources/components/resources/GroupList.tsx
function GroupList (line 35) | function GroupList({ tenantId }: { tenantId: string | null }) {
FILE: frontend/app/[locale]/tenant-resources/components/resources/InvitationList.tsx
function InvitationList (line 42) | function InvitationList({ tenantId, refreshKey }: { tenantId: string | n...
FILE: frontend/app/[locale]/tenant-resources/components/resources/KnowledgeList.tsx
function KnowledgeList (line 16) | function KnowledgeList({
FILE: frontend/app/[locale]/tenant-resources/components/resources/McpList.tsx
function McpList (line 46) | function McpList({ tenantId }: { tenantId: string | null }) {
FILE: frontend/app/[locale]/tenant-resources/components/resources/ModelList.tsx
function ModelList (line 18) | function ModelList({ tenantId }: { tenantId: string | null }) {
FILE: frontend/app/[locale]/tenant-resources/components/resources/UserList.tsx
function UserList (line 33) | function UserList({ tenantId, refreshKey }: { tenantId: string | null; r...
FILE: frontend/app/[locale]/tenant-resources/page.tsx
function TenantResourcesPage (line 16) | function TenantResourcesPage() {
FILE: frontend/app/[locale]/users/components/UserProfileComp.tsx
function UserProfileComp (line 55) | function UserProfileComp() {
FILE: frontend/app/[locale]/users/page.tsx
function UsersPage (line 15) | function UsersPage() {
FILE: frontend/components/agent/AgentImportWizard.tsx
type AgentImportWizardProps (line 16) | interface AgentImportWizardProps {
type ConfigField (line 26) | interface ConfigField {
type McpServerToInstall (line 36) | interface McpServerToInstall {
function AgentImportWizard (line 95) | function AgentImportWizard({
FILE: frontend/components/auth/AuthDialogs.tsx
function AuthDialogs (line 17) | function AuthDialogs() {
FILE: frontend/components/auth/DeleteAccountModal.tsx
type DeleteAccountModalProps (line 10) | interface DeleteAccountModalProps {
function DeleteAccountModal (line 26) | function DeleteAccountModal({
FILE: frontend/components/auth/avatarDropdown.tsx
function AvatarDropdown (line 17) | function AvatarDropdown() {
FILE: frontend/components/auth/loginModal.tsx
function LoginModal (line 21) | function LoginModal() {
FILE: frontend/components/auth/registerModal.tsx
function RegisterModal (line 35) | function RegisterModal() {
FILE: frontend/components/mcp/McpContainerLogsModal.tsx
type McpContainerLogsModalProps (line 7) | interface McpContainerLogsModalProps {
function McpContainerLogsModal (line 15) | function McpContainerLogsModal({
FILE: frontend/components/mcp/McpEditServerModal.tsx
type McpEditServerModalProps (line 7) | interface McpEditServerModalProps {
function McpEditServerModal (line 17) | function McpEditServerModal({
FILE: frontend/components/mcp/McpToolListModal.tsx
type McpToolListModalProps (line 7) | interface McpToolListModalProps {
function McpToolListModal (line 15) | function McpToolListModal({
FILE: frontend/components/navigation/ChatTopNavContent.tsx
function ChatTopNavContent (line 11) | function ChatTopNavContent() {
FILE: frontend/components/navigation/FooterLayout.tsx
function FooterLayout (line 12) | function FooterLayout() {
FILE: frontend/components/navigation/SideNavigation.tsx
type SideNavigationProps (line 31) | interface SideNavigationProps {
type RouteConfig (line 38) | interface RouteConfig {
constant ROUTE_CONFIG (line 49) | const ROUTE_CONFIG: RouteConfig[] = [
constant ROUTE_PATHS (line 68) | const ROUTE_PATHS = ROUTE_CONFIG.map((route) => route.path);
function SideNavigation (line 74) | function SideNavigation({
FILE: frontend/components/navigation/TopNavbar.tsx
function TopNavbar (line 19) | function TopNavbar({ isChatPage }: { isChatPage: boolean }) {
FILE: frontend/components/permission/Can.tsx
type CanProps (line 6) | interface CanProps {
function Can (line 26) | function Can({ permission, children, fallback = null }: CanProps) {
FILE: frontend/components/permission/Cannot.tsx
type CannotProps (line 6) | interface CannotProps {
function Cannot (line 22) | function Cannot({ permission, children, fallback = null }: CannotProps) {
FILE: frontend/components/providers/AuthenticationProvider.tsx
function AuthenticationProvider (line 18) | function AuthenticationProvider({ children }: { children?: ReactNode }) {
function useAuthenticationContext (line 31) | function useAuthenticationContext(): AuthenticationContextType {
FILE: frontend/components/providers/AuthorizationProvider.tsx
function AuthorizationProvider (line 18) | function AuthorizationProvider({ children }: { children?: ReactNode }) {
function useAuthorizationContext (line 31) | function useAuthorizationContext(): AuthorizationContextType {
FILE: frontend/components/providers/I18nProviderWrapper.tsx
type I18nProviderWrapperProps (line 9) | interface I18nProviderWrapperProps {
function I18nProviderWrapper (line 14) | function I18nProviderWrapper({
FILE: frontend/components/providers/deploymentProvider.tsx
type DeploymentContextType (line 14) | interface DeploymentContextType {
type DeploymentVersionResponse (line 28) | interface DeploymentVersionResponse {
function DeploymentProvider (line 34) | function DeploymentProvider({ children }: { children: ReactNode }) {
FILE: frontend/components/providers/rootProvider.tsx
function AppReadyWrapper (line 22) | function AppReadyWrapper({ children }: { children?: ReactNode }) {
function RootProvider (line 51) | function RootProvider({ children }: { children: ReactNode }) {
FILE: frontend/components/tool-config/KnowledgeBaseSelectorModal.tsx
type KnowledgeBaseSelectorProps (line 23) | interface KnowledgeBaseSelectorProps {
function getKnowledgeBaseSourcesForTool (line 43) | function getKnowledgeBaseSourcesForTool(
type KnowledgeBaseSelectorModalProps (line 60) | interface KnowledgeBaseSelectorModalProps extends KnowledgeBaseSelectorP...
function KnowledgeBaseSelectorModal (line 83) | function KnowledgeBaseSelectorModal({
FILE: frontend/components/tool-config/index.ts
type KnowledgeBaseSelectorProps (line 6) | interface KnowledgeBaseSelectorProps {
function getKnowledgeBaseSourcesForTool (line 27) | function getKnowledgeBaseSourcesForTool(
FILE: frontend/components/ui/AgentCallRelationshipModal.tsx
constant NODE_W (line 24) | const NODE_W = 140;
constant NODE_H (line 25) | const NODE_H = 60;
constant AGENT_W (line 28) | const AGENT_W = 160;
constant AGENT_H (line 29) | const AGENT_H = 56;
constant TOOL_SIZE (line 30) | const TOOL_SIZE = 100;
constant TOOL_TEETH (line 31) | const TOOL_TEETH = 10;
constant TOOL_TEETH_DEPTH_RATIO (line 32) | const TOOL_TEETH_DEPTH_RATIO = 0.085;
constant MAX_TOOL_NAME_CHARS (line 34) | const MAX_TOOL_NAME_CHARS = 24;
constant TREE_DEPTH_FACTOR (line 36) | const TREE_DEPTH_FACTOR = 120;
constant TREE_SEP_SIB (line 37) | const TREE_SEP_SIB = 1.5;
constant TREE_SEP_NON (line 38) | const TREE_SEP_NON = 1.8;
function truncateByCodePoints (line 41) | function truncateByCodePoints(s: string, max: number) {
function AgentCallRelationshipModal (line 233) | function AgentCallRelationshipModal({
FILE: frontend/components/ui/Diagram.tsx
type DownloadFormat (line 16) | type DownloadFormat = "svg" | "png";
type DiagramState (line 19) | interface DiagramState {
class DiagramStateManager (line 28) | class DiagramStateManager {
method getInstance (line 33) | static getInstance(): DiagramStateManager {
method getState (line 40) | getState(diagramId: string): DiagramState {
method setShowCode (line 52) | setShowCode(diagramId: string, showCode: boolean): void {
method setZoomLevel (line 58) | setZoomLevel(diagramId: string, zoomLevel: number): void {
method setPan (line 67) | setPan(diagramId: string, panX: number, panY: number): void {
method setDownloadFormat (line 73) | setDownloadFormat(diagramId: string, downloadFormat: DownloadFormat): ...
method subscribe (line 79) | subscribe(diagramId: string, callback: () => void): () => void {
method notifyListeners (line 90) | private notifyListeners(diagramId: string): void {
type DiagramProps (line 95) | interface DiagramProps {
type MermaidApi (line 103) | type MermaidApi = {
function computeHash (line 115) | function computeHash(input: string): string {
function DiagramComponent (line 123) | function DiagramComponent({
FILE: frontend/components/ui/copyButton.tsx
type CopyButtonProps (line 11) | interface CopyButtonProps {
FILE: frontend/components/ui/loading.tsx
type LoadingProps (line 3) | interface LoadingProps {
function Loading (line 9) | function Loading({
function FullScreenLoading (line 36) | function FullScreenLoading({
FILE: frontend/components/ui/markdownRenderer.tsx
type MarkdownRendererProps (line 21) | interface MarkdownRendererProps {
constant S3_MEDIA_SESSION_PREFIX (line 40) | const S3_MEDIA_SESSION_PREFIX = "s3-media-cache:";
constant VIDEO_EXTENSIONS (line 289) | const VIDEO_EXTENSIONS = [".mp4", ".webm", ".ogg", ".mov", ".m4v"];
type VideoWithErrorHandlingProps (line 682) | interface VideoWithErrorHandlingProps {
type ImageWithErrorHandlingProps (line 737) | interface ImageWithErrorHandlingProps {
class MarkdownErrorBoundary (line 1017) | class MarkdownErrorBoundary extends React.Component<
method constructor (line 1021) | constructor(props: { children: React.ReactNode; rawContent: string }) {
method getDerivedStateFromError (line 1025) | static getDerivedStateFromError() {
method componentDidCatch (line 1028) | componentDidCatch(error: unknown) {}
method render (line 1029) | render() {
method code (line 1168) | code({ node, inline, className, children, ...props }: any) {
FILE: frontend/components/ui/statusBadge.tsx
type StatusBadgeProps (line 3) | interface StatusBadgeProps {
FILE: frontend/const/agentConfig.ts
constant AGENT_CALL_RELATIONSHIP_THEME_CONFIG (line 6) | const AGENT_CALL_RELATIONSHIP_THEME_CONFIG = {
constant AGENT_CALL_RELATIONSHIP_NODE_TYPES (line 26) | const AGENT_CALL_RELATIONSHIP_NODE_TYPES = {
constant AGENT_CALL_RELATIONSHIP_ORIENTATION (line 32) | const AGENT_CALL_RELATIONSHIP_ORIENTATION = {
type AgentCallRelationshipOrientation (line 37) | type AgentCallRelationshipOrientation =
constant ROLE_ASSISTANT (line 40) | const ROLE_ASSISTANT = "assistant" as const;
constant TOOL_SOURCE_TYPES (line 42) | const TOOL_SOURCE_TYPES = {
constant GENERATE_PROMPT_STREAM_TYPES (line 49) | const GENERATE_PROMPT_STREAM_TYPES = {
constant TOOL_PARAM_TYPES (line 58) | const TOOL_PARAM_TYPES = {
constant NAME_CHECK_STATUS (line 66) | const NAME_CHECK_STATUS = {
type NameCheckStatus (line 73) | type NameCheckStatus =
type ToolSourceType (line 76) | type ToolSourceType =
type GeneratePromptStreamType (line 79) | type GeneratePromptStreamType =
constant AGENT_CALL_RELATIONSHIP_NODE_SIZE (line 83) | const AGENT_CALL_RELATIONSHIP_NODE_SIZE = {
constant AGENT_SETUP_LAYOUT_DEFAULT (line 89) | const AGENT_SETUP_LAYOUT_DEFAULT: LayoutConfig = {
constant TOOL_PARAM_OPTIONS (line 96) | const TOOL_PARAM_OPTIONS = {
function getToolParamOptions (line 117) | function getToolParamOptions(
FILE: frontend/const/auth.ts
type USER_ROLES (line 2) | enum USER_ROLES {
constant STATUS_CODES (line 10) | const STATUS_CODES = {
constant STORAGE_KEYS (line 26) | const STORAGE_KEYS = {
constant COOKIE_NAMES (line 32) | const COOKIE_NAMES = {
constant AUTH_EVENTS (line 39) | const AUTH_EVENTS = {
constant AUTHZ_EVENTS (line 50) | const AUTHZ_EVENTS = {
FILE: frontend/const/chatConfig.ts
type Opinion (line 141) | type Opinion = typeof chatConfig.opinion[keyof typeof chatConfig.opinion...
type MessageType (line 142) | type MessageType = typeof chatConfig.messageTypes[keyof typeof chatConfi...
type ContentType (line 143) | type ContentType = typeof chatConfig.contentTypes[keyof typeof chatConfi...
constant MESSAGE_ROLES (line 145) | const MESSAGE_ROLES = {
FILE: frontend/const/constants.ts
constant TOKEN_REFRESH_CD (line 7) | const TOKEN_REFRESH_CD = 1 * 60 * 1000;
constant TOKEN_REFRESH_BEFORE_EXPIRY_MS (line 10) | const TOKEN_REFRESH_BEFORE_EXPIRY_MS = 5 * 60 * 1000;
constant MIN_ACTIVITY_CHECK_INTERVAL_MS (line 12) | const MIN_ACTIVITY_CHECK_INTERVAL_MS = 30 * 1000;
constant APP_VERSION (line 16) | const APP_VERSION = "v1.0.0";
constant DEFAULT_TYPE (line 19) | const DEFAULT_TYPE = "string";
FILE: frontend/const/errorCode.ts
type ErrorCodeType (line 192) | type ErrorCodeType = typeof ErrorCode[keyof typeof ErrorCode];
FILE: frontend/const/errorMessage.ts
constant DEFAULT_ERROR_MESSAGES (line 15) | const DEFAULT_ERROR_MESSAGES: Record<string, string> = {
type ApiResponse (line 209) | interface ApiResponse<T = any> {
FILE: frontend/const/errorMessageI18n.ts
type ShowErrorOptions (line 85) | interface ShowErrorOptions {
FILE: frontend/const/knowledgeBase.ts
constant DOCUMENT_STATUS (line 4) | const DOCUMENT_STATUS = {
constant NON_TERMINAL_STATUSES (line 15) | const NON_TERMINAL_STATUSES: string[] = [
constant DOCUMENT_ACTION_TYPES (line 23) | const DOCUMENT_ACTION_TYPES = {
constant KNOWLEDGE_BASE_ACTION_TYPES (line 38) | const KNOWLEDGE_BASE_ACTION_TYPES = {
constant UI_CONFIG (line 52) | const UI_CONFIG = {
constant COLUMN_WIDTHS (line 58) | const COLUMN_WIDTHS = {
constant DOCUMENT_NAME_CONFIG (line 67) | const DOCUMENT_NAME_CONFIG = {
constant LAYOUT (line 75) | const LAYOUT = {
constant UI_ACTION_TYPES (line 98) | const UI_ACTION_TYPES = {
constant NOTIFICATION_TYPES (line 107) | const NOTIFICATION_TYPES = {
constant FILE_EXTENSIONS (line 115) | const FILE_EXTENSIONS = {
constant FILE_TYPES (line 128) | const FILE_TYPES = {
constant EXTENSION_TO_TYPE_MAP (line 139) | const EXTENSION_TO_TYPE_MAP = {
FILE: frontend/const/knowledgeBaseLayout.ts
constant KB_LAYOUT (line 9) | const KB_LAYOUT = {
constant KB_TAG_VARIANTS (line 50) | const KB_TAG_VARIANTS = {
FILE: frontend/const/layoutConstants.ts
constant HEADER_CONFIG (line 7) | const HEADER_CONFIG = {
constant SIDER_CONFIG (line 22) | const SIDER_CONFIG = {
constant FOOTER_CONFIG (line 31) | const FOOTER_CONFIG = {
constant SETUP_PAGE_CONTAINER (line 46) | const SETUP_PAGE_CONTAINER = {
constant TWO_COLUMN_LAYOUT (line 58) | const TWO_COLUMN_LAYOUT = {
constant STANDARD_CARD (line 81) | const STANDARD_CARD = {
constant CARD_HEADER (line 96) | const CARD_HEADER = {
FILE: frontend/const/marketConfig.ts
constant MARKET_CATEGORY_ICONS (line 7) | const MARKET_CATEGORY_ICONS: Record<string, string> = {
function getCategoryIcon (line 26) | function getCategoryIcon(
FILE: frontend/const/memoryConfig.ts
constant MEMORY_SHARE_STRATEGY (line 2) | const MEMORY_SHARE_STRATEGY = {
type MemoryShareStrategy (line 9) | type MemoryShareStrategy = (typeof MEMORY_SHARE_STRATEGY)[keyof typeof M...
FILE: frontend/const/modelConfig.ts
constant MODEL_TYPES (line 2) | const MODEL_TYPES = {
constant MODEL_SOURCES (line 13) | const MODEL_SOURCES = {
constant MODEL_STATUS (line 24) | const MODEL_STATUS = {
constant ICON_TYPES (line 32) | const ICON_TYPES = {
constant MODEL_PROVIDER_KEYS (line 38) | const MODEL_PROVIDER_KEYS = [
type ModelProviderKey (line 49) | type ModelProviderKey = (typeof MODEL_PROVIDER_KEYS)[number];
constant PROVIDER_HINTS (line 52) | const PROVIDER_HINTS: Record<ModelProviderKey, string> = {
constant PROVIDER_ICON_MAP (line 64) | const PROVIDER_ICON_MAP: Record<ModelProviderKey, string> = {
constant OFFICIAL_PROVIDER_ICON (line 75) | const OFFICIAL_PROVIDER_ICON = "/modelengine-logo.png";
constant DEFAULT_PROVIDER_ICON (line 76) | const DEFAULT_PROVIDER_ICON = "/default-icon.png";
constant PROVIDER_LINKS (line 79) | const PROVIDER_LINKS: Record<string, string> = {
constant USER_ROLES (line 91) | const USER_ROLES = {
constant MEMORY_TAB_KEYS (line 100) | const MEMORY_TAB_KEYS = {
type MemoryTabKey (line 109) | type MemoryTabKey =
constant LAYOUT_CONFIG (line 113) | const LAYOUT_CONFIG = {
constant CARD_THEMES (line 125) | const CARD_THEMES = {
FILE: frontend/hooks/agent/useAgentInfo.ts
function useAgentInfo (line 5) | function useAgentInfo(agentId: number | null) {
FILE: frontend/hooks/agent/useAgentList.ts
function useAgentList (line 6) | function useAgentList(tenantId: string | null) {
FILE: frontend/hooks/agent/useAgentVersion.ts
function useAgentVersion (line 10) | function useAgentVersion(agentId: number | null, versionNo: number) {
FILE: frontend/hooks/agent/useAgentVersionDetail.ts
function useAgentVersionDetail (line 10) | function useAgentVersionDetail(agentId: number | null, versionNo: number...
FILE: frontend/hooks/agent/useAgentVersionList.ts
function useAgentVersionList (line 13) | function useAgentVersionList(agentId: number | null, tenantId?: string) {
FILE: frontend/hooks/agent/usePublishedAgentList.ts
function usePublishedAgentList (line 6) | function usePublishedAgentList() {
FILE: frontend/hooks/agent/useSaveGuard.ts
function batchUpdateToolConfigs (line 24) | async function batchUpdateToolConfigs(
FILE: frontend/hooks/agent/useToolList.ts
function useToolList (line 7) | function useToolList(options?: { enabled?: boolean; staleTime?: number }) {
FILE: frontend/hooks/auth/useAuthentication.ts
function useAuthentication (line 11) | function useAuthentication(): AuthenticationContextType {
FILE: frontend/hooks/auth/useAuthenticationState.ts
function useAuthenticationState (line 20) | function useAuthenticationState(): AuthenticationStateReturn {
FILE: frontend/hooks/auth/useAuthenticationUI.ts
function useAuthenticationUI (line 19) | function useAuthenticationUI({
FILE: frontend/hooks/auth/useAuthorization.ts
function useAuthorization (line 19) | function useAuthorization(): AuthorizationContextType {
FILE: frontend/hooks/auth/useSessionManager.ts
function useSessionManager (line 57) | function useSessionManager() {
FILE: frontend/hooks/chat/useConversationManagement.ts
constant CONVERSATION_LIST_QUERY_KEY (line 10) | const CONVERSATION_LIST_QUERY_KEY = ["conversations"] as const;
type ConversationManagement (line 16) | interface ConversationManagement {
FILE: frontend/hooks/group/useGroupList.ts
function useGroupList (line 4) | function useGroupList(tenantId: string | null, page?: number, pageSize?:...
FILE: frontend/hooks/invitation/useInvitationList.ts
function useInvitationList (line 5) | function useInvitationList(request: InvitationListRequest) {
FILE: frontend/hooks/knowledge/useKnowledgeList.ts
function useKnowledgeList (line 4) | function useKnowledgeList(tenantId: string | null) {
FILE: frontend/hooks/mcp/useMcpContainerList.ts
constant MCP_CONTAINERS_QUERY_KEY (line 6) | const MCP_CONTAINERS_QUERY_KEY = ["mcp", "containers"] as const;
function useMcpContainerList (line 8) | function useMcpContainerList(options?: { enabled?: boolean; staleTime?: ...
FILE: frontend/hooks/mcp/useMcpServerList.ts
constant MCP_SERVERS_QUERY_KEY (line 6) | const MCP_SERVERS_QUERY_KEY = ["mcp", "servers"] as const;
function useMcpServerList (line 8) | function useMcpServerList(options?: { enabled?: boolean; staleTime?: num...
FILE: frontend/hooks/model/useDashscopeModelList.ts
type UseDashscopeModelListProps (line 9) | interface UseDashscopeModelListProps {
FILE: frontend/hooks/model/useManageTenantModels.ts
type ManageTenantModelResult (line 5) | interface ManageTenantModelResult {
function useManageTenantModels (line 18) | function useManageTenantModels(options: {
FILE: frontend/hooks/model/useModelList.ts
function useModelList (line 5) | function useModelList(options?: { enabled?: boolean; staleTime?: number ...
FILE: frontend/hooks/model/useSiliconModelList.ts
type UseSiliconModelListProps (line 9) | interface UseSiliconModelListProps {
FILE: frontend/hooks/model/useTokenponyModelList.ts
type UseTokenPonyModelListProps (line 9) | interface UseTokenPonyModelListProps {
FILE: frontend/hooks/permission/usePermission.ts
function usePermission (line 6) | function usePermission() {
FILE: frontend/hooks/tenant/useTenantList.ts
type TenantListResult (line 5) | interface TenantListResult {
function useTenantList (line 13) | function useTenantList(params?: { page?: number; page_size?: number }) {
FILE: frontend/hooks/tool/useToolInfo.ts
function useToolInfo (line 4) | function useToolInfo(toolId: number | null, agentId: number | null) {
FILE: frontend/hooks/useAgentImport.ts
type ImportAgentData (line 9) | interface ImportAgentData {
type UseAgentImportOptions (line 20) | interface UseAgentImportOptions {
type UseAgentImportResult (line 39) | interface UseAgentImportResult {
function useAgentImport (line 54) | function useAgentImport(
FILE: frontend/hooks/useChatTaskMessage.ts
function useChatTaskMessage (line 6) | function useChatTaskMessage(messages: ChatMessageType[]): ChatTaskMessag...
FILE: frontend/hooks/useConfig.ts
constant APP_CONFIG_KEY (line 16) | const APP_CONFIG_KEY = "app";
constant MODEL_CONFIG_KEY (line 17) | const MODEL_CONFIG_KEY = "model";
constant CONFIG_QUERY_KEY (line 22) | const CONFIG_QUERY_KEY = ["config"];
function transformModelEntry (line 97) | function transformModelEntry(
function transformBackendToFrontend (line 115) | function transformBackendToFrontend(backendConfig: any): GlobalConfig {
function loadConfigFromStorage (line 154) | function loadConfigFromStorage(): GlobalConfig | null {
function saveConfigToStorage (line 193) | function saveConfigToStorage(config: GlobalConfig): void {
function deepMerge (line 213) | function deepMerge<T>(target: T, source: Partial<T>): T {
function useConfig (line 245) | function useConfig() {
FILE: frontend/hooks/useConfirmModal.ts
type ConfirmProps (line 7) | interface ConfirmProps {
FILE: frontend/hooks/useErrorHandler.ts
type ErrorHandlerOptions (line 23) | interface ErrorHandlerOptions {
constant DEFAULT_OPTIONS (line 37) | const DEFAULT_OPTIONS: ErrorHandlerOptions = {
FILE: frontend/hooks/useKnowledgeBaseConfigChangeHandler.ts
type ToolKbType (line 8) | type ToolKbType =
type DifyConfig (line 17) | interface DifyConfig {
type DatamateConfig (line 25) | interface DatamateConfig {
type IdataConfig (line 32) | interface IdataConfig {
type UseKnowledgeBaseConfigChangeHandlerOptions (line 41) | interface UseKnowledgeBaseConfigChangeHandlerOptions {
function useKnowledgeBaseConfigChangeHandler (line 52) | function useKnowledgeBaseConfigChangeHandler({
FILE: frontend/hooks/useKnowledgeBaseSelector.ts
function useKnowledgeBasesForToolConfig (line 28) | function useKnowledgeBasesForToolConfig(
function usePrefetchKnowledgeBases (line 172) | function usePrefetchKnowledgeBases() {
function useSyncKnowledgeBases (line 296) | function useSyncKnowledgeBases() {
function useKnowledgeBaseSelection (line 372) | function useKnowledgeBaseSelection(initialSelectedIds: string[] = []) {
FILE: frontend/hooks/useMcpConfig.ts
type UseMcpConfigOptions (line 23) | interface UseMcpConfigOptions {
type McpMessageKeys (line 35) | interface McpMessageKeys {
function useMcpConfig (line 57) | function useMcpConfig(options: UseMcpConfigOptions = {}) {
FILE: frontend/hooks/useMemory.ts
function useMemory (line 24) | function useMemory({ visible, currentUserId, currentTenantId, message }:...
FILE: frontend/hooks/useSetupFlow.ts
type UseSetupFlowOptions (line 4) | interface UseSetupFlowOptions {
type UseSetupFlowReturn (line 8) | interface UseSetupFlowReturn {
function useSetupFlow (line 40) | function useSetupFlow(options: UseSetupFlowOptions = {}): UseSetupFlowRe...
FILE: frontend/hooks/user/useUserList.ts
function useUserList (line 4) | function useUserList(
FILE: frontend/lib/agentDebugErrorCache.ts
constant DEBUG_ERROR_CACHE_KEY (line 7) | const DEBUG_ERROR_CACHE_KEY = "nexent_agent_debug_errors";
type DebugErrorInfo (line 9) | interface DebugErrorInfo {
function getCachedDebugError (line 20) | function getCachedDebugError(agentId: number): string | null {
function cacheDebugError (line 46) | function cacheDebugError(agentId: number, errorMessage: string): void {
function clearCachedDebugError (line 80) | function clearCachedDebugError(agentId: number): void {
function clearAllCachedDebugErrors (line 107) | function clearAllCachedDebugErrors(): void {
FILE: frontend/lib/agentLabelMapper.ts
function getToolSourceLabel (line 15) | function getToolSourceLabel(source: string, t: TFunction): string {
function getAgentTypeLabel (line 36) | function getAgentTypeLabel(type: string, t: TFunction): string {
function getGenericLabel (line 56) | function getGenericLabel(label: string, t: TFunction): string {
function getCategoryLabel (line 79) | function getCategoryLabel(category: string, t: TFunction): string {
FILE: frontend/lib/auth.ts
constant ROLE_COLORS (line 22) | const ROLE_COLORS: Record<string, string> = {
function getRoleColor (line 35) | function getRoleColor(role: string): string {
function generateAvatarUrl (line 40) | function generateAvatarUrl(email: string): string {
function getEffectiveRoutePath (line 86) | function getEffectiveRoutePath(pathname: string): string {
FILE: frontend/lib/authEvents.ts
class AuthEventEmitter (line 10) | class AuthEventEmitter {
FILE: frontend/lib/avatar.tsx
class SeededRandom (line 9) | class SeededRandom {
method constructor (line 12) | constructor(seed: string) {
method random (line 20) | random(): number {
method randomInt (line 26) | randomInt(min: number, max: number): number {
function rgbToHsl (line 141) | function rgbToHsl(r: number, g: number, b: number): [number, number, num...
function hslToRgb (line 167) | function hslToRgb(h: number, s: number, l: number): [number, number, num...
FILE: frontend/lib/clipboard.ts
function copyToClipboard (line 1) | async function copyToClipboard(text: string): Promise<void> {
FILE: frontend/lib/date.ts
function formatDate (line 6) | function formatDate(date: string | Date | null | undefined): string | un...
FILE: frontend/lib/providerError.ts
type ProviderErrorType (line 13) | type ProviderErrorType =
type ProviderError (line 27) | interface ProviderError {
constant PROVIDER_DISPLAY_NAMES (line 37) | const PROVIDER_DISPLAY_NAMES: Record<string, string> = {
function detectProviderError (line 47) | function detectProviderError(errorResponse: unknown): ProviderErrorType {
function translateProviderError (line 146) | function translateProviderError(
function processProviderResponse (line 204) | function processProviderResponse<T extends Record<string, unknown>>(
FILE: frontend/lib/session.ts
function getCookieValue (line 23) | function getCookieValue(name: string): string | null {
function clearCookie (line 34) | function clearCookie(name: string): void {
FILE: frontend/lib/utils.ts
function cn (line 8) | function cn(...inputs: ClassValue[]) {
function getStatusPriority (line 13) | function getStatusPriority(status: string): number {
function sortByStatusAndDate (line 35) | function sortByStatusAndDate<T extends { status: string; create_time: st...
function formatFileSize (line 53) | function formatFileSize(bytes: number): string {
function formatDate (line 62) | function formatDate(dateString: string): string {
type SearchResultUrl (line 80) | interface SearchResultUrl {
function formatUrl (line 86) | function formatUrl(result: SearchResultUrl): string {
function getUrlParam (line 110) | function getUrlParam<T>(
type ConnectivityStatusType (line 162) | type ConnectivityStatusType = "checking" | "available" | "unavailable" |...
type ConnectivityMeta (line 192) | type ConnectivityMeta = {
function formatScoreAsPercentage (line 227) | function formatScoreAsPercentage(score: number): string {
function getScoreColor (line 240) | function getScoreColor(score: number): string {
FILE: frontend/lib/viewPersistence.ts
constant VIEW_STORAGE_KEY (line 6) | const VIEW_STORAGE_KEY = 'nexent_current_view';
type ViewType (line 8) | type ViewType =
constant VALID_VIEWS (line 22) | const VALID_VIEWS: ViewType[] = [
function getSavedView (line 41) | function getSavedView(): ViewType {
function saveView (line 63) | function saveView(view: ViewType): void {
function clearSavedView (line 79) | function clearSavedView(): void {
FILE: frontend/middleware.ts
constant PUBLIC_FILE (line 3) | const PUBLIC_FILE = /\.(.*)$/;
function middleware (line 7) | function middleware(req: NextRequest) {
FILE: frontend/next.config.mjs
function mergeConfig (line 31) | function mergeConfig(nextConfig, userConfig) {
FILE: frontend/server.js
constant HTTP_BACKEND (line 25) | const HTTP_BACKEND = process.env.HTTP_BACKEND || "http://localhost:5010";
constant WS_BACKEND (line 26) | const WS_BACKEND = process.env.WS_BACKEND || "ws://localhost:5014";
constant RUNTIME_HTTP_BACKEND (line 27) | const RUNTIME_HTTP_BACKEND =
constant MINIO_BACKEND (line 29) | const MINIO_BACKEND = process.env.MINIO_ENDPOINT || "http://localhost:90...
constant MARKET_BACKEND (line 30) | const MARKET_BACKEND =
constant PORT (line 32) | const PORT = 3000;
constant COOKIE_NAMES (line 39) | const COOKIE_NAMES = {
function buildCookieOptions (line 47) | function buildCookieOptions(httpOnly) {
function setAuthCookies (line 56) | function setAuthCookies(res, session) {
function clearAuthCookies (line 99) | function clearAuthCookies(res) {
function parseCookies (line 108) | function parseCookies(req) {
constant AUTH_INTERCEPT_ENDPOINTS (line 115) | const AUTH_INTERCEPT_ENDPOINTS = new Set([
function collectRequestBody (line 123) | function collectRequestBody(req) {
function prepareAuthRequestBody (line 136) | function prepareAuthRequestBody(pathname, body, cookies) {
function forwardAuthRequest (line 149) | function forwardAuthRequest(req, res, targetUrl) {
FILE: frontend/services/agentConfigService.ts
type UpdateAgentInfoPayload (line 374) | interface UpdateAgentInfoPayload {
FILE: frontend/services/agentVersionService.ts
type ToolInstance (line 8) | interface ToolInstance {
type Agent (line 20) | interface Agent {
type AgentVersion (line 49) | interface AgentVersion {
type AgentVersionResponse (line 60) | interface AgentVersionResponse {
type FetchAgentVersionResult (line 66) | interface FetchAgentVersionResult {
type AgentVersionDetail (line 75) | interface AgentVersionDetail extends Agent {
type AgentVersionDetailResponse (line 79) | interface AgentVersionDetailResponse {
type FetchAgentVersionDetailResult (line 85) | interface FetchAgentVersionDetailResult {
type AgentVersionListData (line 94) | interface AgentVersionListData {
type AgentVersionListResponse (line 99) | interface AgentVersionListResponse {
type FetchAgentVersionListResult (line 105) | interface FetchAgentVersionListResult {
type VersionPublishRequest (line 114) | interface VersionPublishRequest {
type VersionPublishResponse (line 122) | interface VersionPublishResponse {
type VersionRollbackRequest (line 131) | interface VersionRollbackRequest {
type VersionRollbackResponse (line 139) | interface VersionRollbackResponse {
type VersionUpdateRequest (line 148) | interface VersionUpdateRequest {
type VersionUpdateResponse (line 156) | interface VersionUpdateResponse {
type VersionCompareRequest (line 167) | interface VersionCompareRequest {
type VersionCompareResponse (line 175) | interface VersionCompareResponse {
type VersionDifference (line 188) | interface VersionDifference {
function fetchAgentVersion (line 201) | async function fetchAgentVersion(
function fetchAgentVersionDetail (line 236) | async function fetchAgentVersionDetail(
function fetchAgentVersionList (line 275) | async function fetchAgentVersionList(
function publishVersion (line 314) | async function publishVersion(
function rollbackVersion (line 355) | async function rollbackVersion(
function compareVersions (line 394) | async function compareVersions(
function deleteVersion (line 437) | async function deleteVersion(
function updateVersion (line 474) | async function updateVersion(
FILE: frontend/services/api.ts
constant API_BASE_URL (line 7) | const API_BASE_URL = "/api";
constant API_ENDPOINTS (line 9) | const API_ENDPOINTS = {
class ApiError (line 309) | class ApiError extends Error {
method constructor (line 310) | constructor(
type Window (line 424) | interface Window {
FILE: frontend/services/configService.ts
class ConfigService (line 10) | class ConfigService {
method fetchConfig (line 15) | async fetchConfig(): Promise<unknown> {
method saveConfig (line 29) | async saveConfig(config: GlobalConfig): Promise<void> {
FILE: frontend/services/conversationService.ts
method getList (line 26) | async getList(): Promise<ConversationListItem[]> {
method create (line 39) | async create(title?: string) {
method rename (line 58) | async rename(conversationId: number, name: string) {
method getDetail (line 78) | async getDetail(conversationId: number, signal?: AbortSignal): Promise<A...
method delete (line 108) | async delete(conversationId: number) {
method stop (line 124) | async stop(conversationId: number) {
method createWebSocket (line 142) | createWebSocket(): WebSocket {
method processAudioData (line 147) | processAudioData(inputData: Float32Array): Int16Array {
method getAudioConstraints (line 157) | getAudioConstraints() {
method getAudioContextOptions (line 170) | getAudioContextOptions() {
method createWebSocket (line 181) | createWebSocket(): WebSocket {
method createTTSService (line 186) | createTTSService() {
method preprocessFiles (line 683) | async preprocessFiles(query: string, files: File[], conversationId?: num...
method runAgent (line 735) | async runAgent(params: {
method generateTitle (line 792) | async generateTitle(params: {
method updateOpinion (line 812) | async updateOpinion(params: { message_id: number; opinion: 'Y' | 'N' | n...
method getMessageId (line 826) | async getMessageId(conversationId: number, messageIndex: number) {
FILE: frontend/services/groupService.ts
type Group (line 6) | interface Group {
type CreateGroupRequest (line 17) | interface CreateGroupRequest {
type UpdateGroupRequest (line 22) | interface UpdateGroupRequest {
type GroupListResponse (line 27) | interface GroupListResponse {
type GroupDetailResponse (line 39) | interface GroupDetailResponse {
type GroupMembersResponse (line 44) | interface GroupMembersResponse {
type CreateGroupResponse (line 48) | interface CreateGroupResponse {
function listGroups (line 57) | async function listGroups(
function getGroup (line 98) | async function getGroup(groupId: number): Promise<Group> {
function getGroupMembers (line 120) | async function getGroupMembers(groupId: number): Promise<User[]> {
function createGroup (line 142) | async function createGroup(
function updateGroup (line 168) | async function updateGroup(
function deleteGroup (line 188) | async function deleteGroup(groupId: number): Promise<void> {
function addUserToGroup (line 204) | async function addUserToGroup(
function removeUserFromGroup (line 224) | async function removeUserFromGroup(
function updateGroupMembers (line 246) | async function updateGroupMembers(
function getTenantDefaultGroupId (line 272) | async function getTenantDefaultGroupId(tenantId: string): Promise<number...
FILE: frontend/services/invitationService.ts
type Invitation (line 5) | interface Invitation {
type InvitationListRequest (line 20) | interface InvitationListRequest {
type InvitationListResponse (line 28) | interface InvitationListResponse {
type CreateInvitationRequest (line 39) | interface CreateInvitationRequest {
type UpdateInvitationRequest (line 48) | interface UpdateInvitationRequest {
type CreateInvitationResponse (line 54) | interface CreateInvitationResponse {
type InvitationDetailResponse (line 59) | interface InvitationDetailResponse {
function listInvitations (line 67) | async function listInvitations(
function createInvitation (line 101) | async function createInvitation(
function updateInvitation (line 123) | async function updateInvitation(
function deleteInvitation (line 143) | async function deleteInvitation(invitationCode: string): Promise<void> {
function checkInvitationCodeExists (line 159) | async function checkInvitationCodeExists(invitationCode: string): Promis...
FILE: frontend/services/knowledgeBasePollingService.ts
class KnowledgeBasePollingService (line 9) | class KnowledgeBasePollingService {
method setActiveKnowledgeBase (line 22) | setActiveKnowledgeBase(kbId: string | null): void {
method startDocumentStatusPolling (line 27) | startDocumentStatusPolling(kbId: string, callback: (documents: Documen...
method handlePollingTimeout (line 129) | private async handlePollingTimeout(
method pollForKnowledgeBaseReady (line 168) | pollForKnowledgeBaseReady(
method handleNewKnowledgeBaseCreation (line 233) | async handleNewKnowledgeBaseCreation(kbId: string, kbName: string, ori...
method stopPolling (line 250) | stopPolling(kbId: string): void {
method stopAllPolling (line 259) | stopAllPolling(): void {
method triggerKnowledgeBaseListUpdate (line 274) | triggerKnowledgeBaseListUpdate(forceRefresh: boolean = false): void {
method triggerDocumentsUpdate (line 282) | triggerDocumentsUpdate(kbId: string, documents: Document[]): void {
FILE: frontend/services/knowledgeBaseService.ts
class KnowledgeBaseService (line 23) | class KnowledgeBaseService {
method checkHealth (line 25) | async checkHealth(): Promise<boolean> {
method syncDifyKnowledgeBases (line 47) | async syncDifyKnowledgeBases(
method getDifyKnowledgeBases (line 87) | async getDifyKnowledgeBases(
method getIdataKnowledgeSpaces (line 138) | async getIdataKnowledgeSpaces(
method syncIdataKnowledgeBases (line 173) | async syncIdataKnowledgeBases(
method getIdataKnowledgeBases (line 218) | async getIdataKnowledgeBases(
method syncDataMateAndCreateRecords (line 276) | async syncDataMateAndCreateRecords(datamateUrl?: string): Promise<{
method testDataMateConnection (line 320) | async testDataMateConnection(
method syncDifyDatasets (line 354) | async syncDifyDatasets(
method getKnowledgeBasesInfo (line 426) | async getKnowledgeBasesInfo(
method getKnowledgeBases (line 597) | async getKnowledgeBases(skipHealthCheck = false): Promise<string[]> {
method checkKnowledgeBaseNameExists (line 628) | async checkKnowledgeBaseNameExists(name: string): Promise<boolean> {
method checkKnowledgeBaseName (line 639) | async checkKnowledgeBaseName(
method createKnowledgeBase (line 664) | async createKnowledgeBase(
method deleteKnowledgeBase (line 737) | async deleteKnowledgeBase(id: string): Promise<void> {
method getAllFiles (line 759) | async getAllFiles(kbId: string, kbSource?: string): Promise<Document[]> {
method getFileTypeFromName (line 816) | private getFileTypeFromName(filename: string): string {
method uploadDocuments (line 827) | async uploadDocuments(
method deleteDocument (line 920) | async deleteDocument(docId: string, kbId: string): Promise<void> {
method summaryIndex (line 944) | async summaryIndex(
method changeSummary (line 1034) | async changeSummary(indexName: string, summaryResult: string): Promise...
method getSummary (line 1070) | async getSummary(indexName: string): Promise<string> {
method previewChunks (line 1104) | async previewChunks(
method previewChunksPaginated (line 1145) | async previewChunksPaginated(
method createChunk (line 1201) | async createChunk(
method updateChunk (line 1235) | async updateChunk(
method deleteChunk (line 1267) | async deleteChunk(indexName: string, chunkId: string): Promise<void> {
method hybridSearch (line 1291) | async hybridSearch(
method updateKnowledgeBase (line 1340) | async updateKnowledgeBase(
method getDocumentErrorInfo (line 1378) | async getDocumentErrorInfo(
FILE: frontend/services/marketService.ts
constant MARKET_API_TIMEOUT (line 17) | const MARKET_API_TIMEOUT = 5000;
class MarketApiError (line 22) | class MarketApiError extends Error {
method constructor (line 23) | constructor(
function fetchWithTimeout (line 41) | async function fetchWithTimeout(
function fetchMarketAgentList (line 83) | async function fetchMarketAgentList(
function fetchMarketAgentDetail (line 114) | async function fetchMarketAgentDetail(
function fetchMarketCategories (line 145) | async function fetchMarketCategories(): Promise<MarketCategory[]> {
function fetchMarketTags (line 174) | async function fetchMarketTags(): Promise<MarketTag[]> {
function fetchMarketAgentMcpServers (line 203) | async function fetchMarketAgentMcpServers(
FILE: frontend/services/memoryService.ts
function getFriendlyErrorMessage (line 13) | function getFriendlyErrorMessage(raw: string): string {
function requestJson (line 49) | async function requestJson(
type MemoryConfig (line 60) | interface MemoryConfig {
function loadMemoryConfig (line 67) | async function loadMemoryConfig(): Promise<MemoryConfig> {
function setMemorySwitch (line 104) | async function setMemorySwitch(enabled: boolean): Promise<boolean> {
function setMemoryAgentShare (line 120) | async function setMemoryAgentShare(
function addDisabledAgentId (line 138) | async function addDisabledAgentId(agentId: string): Promise<boolean> {
function removeDisabledAgentId (line 152) | async function removeDisabledAgentId(agentId: string): Promise<boolean> {
function addDisabledUserAgentId (line 168) | async function addDisabledUserAgentId(
function removeDisabledUserAgentId (line 187) | async function removeDisabledUserAgentId(
function listMemories (line 208) | async function listMemories(
function fetchTenantSharedGroup (line 235) | async function fetchTenantSharedGroup(): Promise<MemoryGroup> {
function fetchAgentSharedGroups (line 244) | async function fetchAgentSharedGroups(): Promise<MemoryGroup[]> {
function fetchUserPersonalGroup (line 295) | async function fetchUserPersonalGroup(): Promise<MemoryGroup> {
function fetchUserAgentGroups (line 304) | async function fetchUserAgentGroups(): Promise<MemoryGroup[]> {
function addMemory (line 366) | async function addMemory(
function clearMemory (line 392) | async function clearMemory(
function deleteMemory (line 413) | async function deleteMemory(
FILE: frontend/services/modelService.ts
class ModelError (line 28) | class ModelError extends Error {
method constructor (line 29) | constructor(message: string, public code?: number) {
method toString (line 41) | toString() {
function detectProviderFromUrl (line 880) | function detectProviderFromUrl(
function getProviderIconByUrl (line 895) | function getProviderIconByUrl(
function getOfficialProviderIcon (line 907) | function getOfficialProviderIcon(): string {
FILE: frontend/services/storageService.ts
function extractObjectNameFromUrl (line 19) | function extractObjectNameFromUrl(url: string): string | null {
function convertImageUrlToApiUrl (line 106) | function convertImageUrlToApiUrl(url: string): string {
function resolveS3UrlToDataUrlInternal (line 160) | async function resolveS3UrlToDataUrlInternal(
function resolveS3UrlToDataUrl (line 172) | async function resolveS3UrlToDataUrl(
method uploadFiles (line 201) | async uploadFiles(
method getFileUrl (line 236) | async getFileUrl(objectName: string): Promise<string> {
method downloadFile (line 255) | async downloadFile(objectName: string, filename?: string): Promise<void> {
method downloadDatamateFile (line 295) | async downloadDatamateFile(options: {
FILE: frontend/services/tenantService.ts
type Tenant (line 5) | interface Tenant {
type CreateTenantRequest (line 15) | interface CreateTenantRequest {
type UpdateTenantRequest (line 19) | interface UpdateTenantRequest {
type TenantListResponse (line 23) | interface TenantListResponse {
type TenantListPaginatedResponse (line 28) | interface TenantListPaginatedResponse {
type TenantDetailResponse (line 37) | interface TenantDetailResponse {
type CreateTenantResponse (line 42) | interface CreateTenantResponse {
type TenantUser (line 47) | interface TenantUser {
type TenantUsersResponse (line 57) | interface TenantUsersResponse {
type ListTenantsParams (line 63) | interface ListTenantsParams {
function listTenants (line 71) | async function listTenants(params?: ListTenantsParams): Promise<TenantLi...
function getTenant (line 99) | async function getTenant(tenantId: string): Promise<Tenant> {
function createTenant (line 121) | async function createTenant(
function updateTenant (line 143) | async function updateTenant(
function deleteTenant (line 169) | async function deleteTenant(tenantId: string): Promise<void> {
function getTenantUsers (line 186) | async function getTenantUsers(tenantId: string): Promise<TenantUsersResp...
FILE: frontend/services/tokenService.ts
type UserToken (line 3) | interface UserToken {
type TokenListResponse (line 8) | interface TokenListResponse {
type TokenCreateResponse (line 13) | interface TokenCreateResponse {
function getUserTokens (line 21) | async function getUserTokens(userId: string | number): Promise<UserToken...
function deleteUserToken (line 39) | async function deleteUserToken(tokenId: number): Promise<void> {
function createUserToken (line 56) | async function createUserToken(): Promise<UserToken> {
FILE: frontend/services/userService.ts
type User (line 5) | interface User {
type UpdateUserRequest (line 15) | interface UpdateUserRequest {
type UserListResponse (line 19) | interface UserListResponse {
type UserDetailResponse (line 31) | interface UserDetailResponse {
type CreateUserResponse (line 36) | interface CreateUserResponse {
function listUsers (line 45) | async function listUsers(
function getUser (line 88) | async function getUser(userId: string): Promise<User> {
function updateUser (line 107) | async function updateUser(
function deleteUser (line 130) | async function deleteUser(userId: string): Promise<void> {
FILE: frontend/stores/agentConfigStore.ts
type EditableAgent (line 21) | type EditableAgent = Pick<
type AgentConfigStoreState (line 43) | interface AgentConfigStoreState {
FILE: frontend/types/agentConfig.ts
type AgentBusinessInfo (line 8) | type AgentBusinessInfo = Partial<Pick<
type AgentProfileInfo (line 13) | type AgentProfileInfo = Partial<
type Agent (line 33) | interface Agent {
type Tool (line 64) | interface Tool {
type ToolParam (line 78) | interface ToolParam {
type AgentConfigDataResponse (line 90) | interface AgentConfigDataResponse {
type ToolGroup (line 96) | interface ToolGroup {
type ToolSubGroup (line 104) | interface ToolSubGroup {
type TreeNodeDatum (line 111) | interface TreeNodeDatum {
type AgentSetupOrchestratorProps (line 124) | interface AgentSetupOrchestratorProps {
type SubAgentPoolProps (line 184) | interface SubAgentPoolProps {
type ToolPoolProps (line 201) | interface ToolPoolProps {
type SimplePromptEditorProps (line 218) | interface SimplePromptEditorProps {
type CollaborativeAgentDisplayProps (line 226) | interface CollaborativeAgentDisplayProps {
type ExpandEditModalProps (line 241) | interface ExpandEditModalProps {
type AgentDebuggingProps (line 251) | interface AgentDebuggingProps {
type DebugConfigProps (line 259) | interface DebugConfigProps {
type McpConfigModalProps (line 264) | interface McpConfigModalProps {
type AgentCallRelationshipTool (line 272) | interface AgentCallRelationshipTool {
type AgentCallRelationshipSubAgent (line 278) | interface AgentCallRelationshipSubAgent {
type AgentCallRelationship (line 286) | interface AgentCallRelationship {
type AgentCallRelationshipModalProps (line 293) | interface AgentCallRelationshipModalProps {
type AgentCallRelationshipTreeNodeDatum (line 301) | interface AgentCallRelationshipTreeNodeDatum {
type LayoutConfig (line 314) | interface LayoutConfig {
type AgentConfigCustomEvent (line 323) | interface AgentConfigCustomEvent extends CustomEvent {
type AgentRefreshEvent (line 328) | interface AgentRefreshEvent extends CustomEvent {
type McpServer (line 335) | interface McpServer {
type McpTool (line 351) | interface McpTool {
type McpContainer (line 358) | interface McpContainer {
type GeneratePromptParams (line 376) | interface GeneratePromptParams {
type StreamResponseData (line 387) | interface StreamResponseData {
FILE: frontend/types/auth.ts
type UserRole (line 4) | type UserRole = USER_ROLES;
type User (line 6) | interface User {
type Session (line 17) | interface Session {
type ErrorResponse (line 25) | interface ErrorResponse {
type AuthFormValues (line 33) | interface AuthFormValues {
type AuthContextType (line 41) | interface AuthContextType {
type SessionResponse (line 66) | interface SessionResponse {
type AuthInfoResponse (line 76) | interface AuthInfoResponse {
type AuthEventKey (line 86) | type AuthEventKey = (typeof AUTH_EVENTS)[keyof typeof AUTH_EVENTS];
type AuthzEventKey (line 87) | type AuthzEventKey = (typeof AUTHZ_EVENTS)[keyof typeof AUTHZ_EVENTS];
type AuthEvents (line 90) | interface AuthEvents {
type AuthzEvents (line 101) | interface AuthzEvents {
type AuthenticationContextType (line 111) | interface AuthenticationContextType {
type AuthenticationStateReturn (line 156) | interface AuthenticationStateReturn {
type AuthenticationUIReturn (line 181) | interface AuthenticationUIReturn {
type AuthorizationContextType (line 202) | interface AuthorizationContextType {
FILE: frontend/types/chat.ts
type MessageRole (line 4) | type MessageRole = typeof MESSAGE_ROLES[keyof typeof MESSAGE_ROLES];
type StepSection (line 7) | interface StepSection {
type StepContent (line 12) | interface StepContent {
type AgentStep (line 40) | interface AgentStep {
type ChatAgentSelectorProps (line 57) | interface ChatAgentSelectorProps {
type SearchResult (line 65) | interface SearchResult {
type FileAttachment (line 80) | interface FileAttachment {
type AttachmentItem (line 90) | interface AttachmentItem {
type ChatAttachmentProps (line 100) | interface ChatAttachmentProps {
type ChatMessageType (line 107) | interface ChatMessageType {
type ProcessedMessages (line 139) | interface ProcessedMessages {
type ChatStreamMainProps (line 147) | interface ChatStreamMainProps {
type CardItem (line 175) | interface CardItem {
type MessageHandlerContext (line 182) | interface MessageHandlerContext {
type MessageHandler (line 187) | interface MessageHandler {
type ApiMessageItem (line 196) | interface ApiMessageItem {
type SearchResultItem (line 201) | interface SearchResultItem {
type MinioFileItem (line 214) | interface MinioFileItem {
type ApiMessage (line 223) | interface ApiMessage {
type ApiConversationDetail (line 235) | interface ApiConversationDetail {
type ConversationListItem (line 241) | interface ConversationListItem {
type FilePreview (line 249) | interface FilePreview {
type SettingsMenuItem (line 259) | interface SettingsMenuItem {
type ImageItem (line 266) | interface ImageItem {
type ChatRightPanelProps (line 275) | interface ChatRightPanelProps {
type TaskMessageType (line 285) | interface TaskMessageType extends ChatMessageType {
type MessageGroup (line 290) | interface MessageGroup {
type ChatTaskMessageResult (line 296) | interface ChatTaskMessageResult {
type StorageUploadResult (line 304) | interface StorageUploadResult {
FILE: frontend/types/conversation.ts
type ConversationListItem (line 1) | interface ConversationListItem {
type ConversationListResponse (line 8) | interface ConversationListResponse {
type ApiMessageItem (line 14) | interface ApiMessageItem {
type ApiMessage (line 19) | interface ApiMessage {
type ApiConversationDetail (line 33) | interface ApiConversationDetail {
type ApiConversationResponse (line 39) | interface ApiConversationResponse {
FILE: frontend/types/knowledgeBase.ts
type KnowledgeBase (line 11) | interface KnowledgeBase {
type KnowledgeBaseCreateParams (line 39) | interface KnowledgeBaseCreateParams {
type Document (line 50) | interface Document {
type DocumentState (line 69) | interface DocumentState {
type DocumentAction (line 80) | type DocumentAction =
type KnowledgeBaseState (line 109) | interface KnowledgeBaseState {
type KnowledgeBaseAction (line 121) | type KnowledgeBaseAction =
type UIState (line 158) | interface UIState {
type UIAction (line 174) | type UIAction =
type AbortableError (line 192) | interface AbortableError extends Error {
class DataMateSyncError (line 197) | class DataMateSyncError extends Error {
method constructor (line 198) | constructor(message: string) {
type KnowledgeBasesWithDataMateStatus (line 205) | interface KnowledgeBasesWithDataMateStatus {
FILE: frontend/types/market.ts
type MarketCategory (line 5) | interface MarketCategory {
type MarketTag (line 17) | interface MarketTag {
type MarketAgentListItem (line 25) | interface MarketAgentListItem {
type MarketAgentTool (line 40) | interface MarketAgentTool {
type MarketMcpServer (line 53) | interface MarketMcpServer {
type MarketAgentDetail (line 59) | interface MarketAgentDetail extends MarketAgentListItem {
type MarketPagination (line 84) | interface MarketPagination {
type MarketAgentListResponse (line 91) | interface MarketAgentListResponse {
type MarketAgentListParams (line 98) | interface MarketAgentListParams {
FILE: frontend/types/memory.ts
type MemoryItem (line 1) | interface MemoryItem {
type MemoryGroup (line 10) | interface MemoryGroup {
type MemoryDeleteModalProps (line 17) | interface MemoryDeleteModalProps {
type MemoryManageModalProps (line 24) | interface MemoryManageModalProps {
type LabelWithIconFunction (line 34) | type LabelWithIconFunction = (Icon: React.ElementType, text: string) => ...
type UseMemoryOptions (line 37) | interface UseMemoryOptions {
FILE: frontend/types/modelConfig.ts
type ModelConnectStatus (line 2) | type ModelConnectStatus =
type ApiResponse (line 9) | interface ApiResponse<T = any> {
type ModelSource (line 16) | type ModelSource =
type ModelType (line 26) | type ModelType =
type ModelOption (line 36) | interface ModelOption {
type AppConfig (line 52) | interface AppConfig {
type ModelApiConfig (line 64) | interface ModelApiConfig {
type SingleModelConfig (line 70) | interface SingleModelConfig {
type ModelConfig (line 78) | interface ModelConfig {
type GlobalConfig (line 89) | interface GlobalConfig {
type ModelValidationResponse (line 95) | interface ModelValidationResponse {
FILE: pathology-ai/code-changes/backend/local_mcp_service.py
class ConfidenceLevel (line 13) | class ConfidenceLevel(Enum):
class RiskLevel (line 20) | class RiskLevel(Enum):
function demo_tool (line 29) | async def demo_tool(para_1: str, para_2: int) -> str:
function generate_knowledge_graph (line 48) | async def generate_knowledge_graph(topic: str, nodes: str = "", relation...
function generate_diagnosis_flow (line 131) | async def generate_diagnosis_flow(disease: str, steps: str = "", decisio...
function generate_medical_chart (line 183) | async def generate_medical_chart(chart_type: str, title: str, labels: st...
function generate_radar_chart (line 242) | async def generate_radar_chart(title: str, dimensions: str = "", values:...
function generate_medical_guide (line 296) | async def generate_medical_guide(condition: str, urgency: str = "urgent"...
function generate_timeline (line 396) | async def generate_timeline(title: str, events: str = "") -> str:
function generate_gantt_chart (line 437) | async def generate_gantt_chart(title: str, tasks: str = "") -> str:
function generate_quadrant_chart (line 488) | async def generate_quadrant_chart(title: str, x_axis: str = "紧急程度", y_ax...
function generate_state_diagram (line 540) | async def generate_state_diagram(title: str, states: str = "", transitio...
function generate_sankey_diagram (line 602) | async def generate_sankey_diagram(title: str, flows: str = "") -> str:
function start_diagnosis_game (line 702) | async def start_diagnosis_game(difficulty: int = 1, case_type: str = "ra...
function diagnosis_action (line 751) | async def diagnosis_action(case_id: str, action_type: str, action_detail...
function search_pathology_images (line 1014) | async def search_pathology_images(keyword: str, count: int = 6) -> str:
function chain_of_diagnosis (line 1127) | async def chain_of_diagnosis(
function evaluate_diagnosis_confidence (line 1297) | async def evaluate_diagnosis_confidence(
FILE: pathology-ai/code-changes/frontend/DiagnosisConfidenceCard.tsx
type ConfidenceLevel (line 7) | type ConfidenceLevel = "HIGH" | "MEDIUM" | "LOW" | "UNCERTAIN";
type RiskLevel (line 10) | type RiskLevel = "CRITICAL" | "HIGH" | "MEDIUM" | "LOW";
Copy disabled (too large)
Download .json
Condensed preview — 929 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (11,135K chars).
[
{
"path": ".claude/skills/prompts-writing/SKILL.md",
"chars": 2556,
"preview": "---\nname: prompt-writing\ndescription: Create, refine, and optimize high-quality YAML prompts for AI assistants. Use when"
},
{
"path": ".claude/skills/prompts-writing/examples.md",
"chars": 14371,
"preview": "# Prompt Writing Examples\n\nReal-world YAML prompt examples for AI assistants with explanations.\n\n## 1. Code Review Agent"
},
{
"path": ".claude/skills/prompts-writing/references/best-practices.md",
"chars": 7263,
"preview": "# Prompt Writing Best Practices\n\nThis document provides comprehensive guidelines for creating high-quality YAML prompts."
},
{
"path": ".claude/skills/prompts-writing/references/templates.md",
"chars": 7363,
"preview": "# Prompt Templates\n\nThis document provides reusable template patterns for YAML-based prompts.\n\n## 1. Agent System Prompt"
},
{
"path": ".claude/skills/skill-creator/.openskills.json",
"chars": 194,
"preview": "{\n \"source\": \"anthropics/skills\",\n \"sourceType\": \"git\",\n \"repoUrl\": \"https://github.com/anthropics/skills\",\n \"subpat"
},
{
"path": ".claude/skills/skill-creator/LICENSE.txt",
"chars": 11357,
"preview": "\n Apache License\n Version 2.0, January 2004\n "
},
{
"path": ".claude/skills/skill-creator/SKILL.md",
"chars": 17701,
"preview": "---\nname: skill-creator\ndescription: Guide for creating effective skills. This skill should be used when users want to c"
},
{
"path": ".claude/skills/skill-creator/references/output-patterns.md",
"chars": 1813,
"preview": "# Output Patterns\n\nUse these patterns when skills need to produce consistent, high-quality output.\n\n## Template Pattern\n"
},
{
"path": ".claude/skills/skill-creator/references/workflows.md",
"chars": 814,
"preview": "# Workflow Patterns\n\n## Sequential Workflows\n\nFor complex tasks, break operations into clear, sequential steps. It is of"
},
{
"path": ".claude/skills/skill-creator/scripts/init_skill.py",
"chars": 10796,
"preview": "#!/usr/bin/env python3\n\"\"\"\nSkill Initializer - Creates a new skill from template\n\nUsage:\n init_skill.py <skill-name> "
},
{
"path": ".claude/skills/skill-creator/scripts/package_skill.py",
"chars": 3268,
"preview": "#!/usr/bin/env python3\n\"\"\"\nSkill Packager - Creates a distributable .skill file of a skill folder\n\nUsage:\n python uti"
},
{
"path": ".claude/skills/skill-creator/scripts/quick_validate.py",
"chars": 3523,
"preview": "#!/usr/bin/env python3\n\"\"\"\nQuick validation script for skills - minimal version\n\"\"\"\n\nimport sys\nimport os\nimport re\nimpo"
},
{
"path": ".cursor/rules/backend/app_layer_rules.mdc",
"chars": 6441,
"preview": "---\nglobs: backend/apps/**/*.py\ndescription: App layer (API) contract for FastAPI endpoints in backend/apps. Parse/valid"
},
{
"path": ".cursor/rules/backend/database_layer_rules.mdc",
"chars": 3622,
"preview": "---\nglobs: backend/database/**/*.py\ndescription: Database layer standards for models, CRUD, transactions, and exceptions"
},
{
"path": ".cursor/rules/backend/service_layer_rules.mdc",
"chars": 3836,
"preview": "---\nglobs: backend/services/**/*.py\ndescription: Service layer implements core business logic orchestration; raise custo"
},
{
"path": ".cursor/rules/english_comments.mdc",
"chars": 1006,
"preview": "---\nalwaysApply: true\ndescription: Enforce English-only comments and docstrings across the codebase\n---\n# English-only C"
},
{
"path": ".cursor/rules/environment_variable.mdc",
"chars": 1594,
"preview": "---\nglobs: backend/**/*.py,sdk/**/*.py\nalwaysApply: false\ndescription: Centralize env var access in backend/consts/const"
},
{
"path": ".cursor/rules/frontend/component_layer_rules.mdc",
"chars": 4409,
"preview": "---\nglobs: frontend/components/**/*.tsx,frontend/app/**/components/**/*.tsx\ndescription: Component layer rules for reusa"
},
{
"path": ".cursor/rules/frontend/frontend_overview_rules.mdc",
"chars": 4202,
"preview": "---\nglobs: frontend/**/*.{ts,tsx}\ndescription: Frontend overview - directory structure, layer responsibilities, and depe"
},
{
"path": ".cursor/rules/frontend/hook_layer_rules.mdc",
"chars": 2853,
"preview": "---\nglobs: frontend/hooks/**/*.ts\ndescription: Hook layer rules for custom React hooks and state management\n---\n\n### Pur"
},
{
"path": ".cursor/rules/frontend/page_layer_rules.mdc",
"chars": 1959,
"preview": "---\nglobs: frontend/app/**/*.tsx\ndescription: Page layer rules for Next.js App Router pages and layouts\n---\n\n### Purpose"
},
{
"path": ".cursor/rules/frontend/service_layer_rules.mdc",
"chars": 1901,
"preview": "---\nglobs: frontend/services/**/*.ts\ndescription: Compact service layer rules for API calls and data management\n---\n\n###"
},
{
"path": ".cursor/rules/frontend/type_layer_rules.mdc",
"chars": 2150,
"preview": "---\nglobs: frontend/types/**/*.ts\ndescription: Type layer rules for TypeScript type definitions and interfaces\n---\n\n### "
},
{
"path": ".cursor/rules/frontend/ui_standards_rules.mdc",
"chars": 3132,
"preview": "---\nglobs: frontend/app/**,frontend/components/**\nalwaysApply: false\n---\n# Frontend UI Standards Rules\n\n## Principle\nUse"
},
{
"path": ".cursor/rules/pytest_unit_test_rules.mdc",
"chars": 1733,
"preview": "---\nglobs: test/**/*.py\ndescription: Pytest Unit Test Rules for this repository\n---\n\n## Pytest Unit Test Rules (Concise)"
},
{
"path": ".devcontainer/devcontainer.json",
"chars": 676,
"preview": "{\n \"name\": \"nexent-data-process\",\n \"dockerComposeFile\": \"../docker/docker-compose.dev.yml\",\n \"service\": \"nexent-data-"
},
{
"path": ".dockerignore",
"chars": 653,
"preview": "# Python\n**/.venv/\n**/__pycache__/\n**/*.pyc\n**/*.pyo\n**/*.pyd\n**/.Python\n**/pip-log.txt\n**/pip-delete-this-directory.txt"
},
{
"path": ".editorconfig",
"chars": 213,
"preview": "root = true\n\n[*]\ncharset = utf-8\nend_of_line = lf\ninsert_final_newline = true\ntrim_trailing_whitespace = true\n\n[*.{js,js"
},
{
"path": ".github/CODEOWNERS",
"chars": 95,
"preview": "# These owners will be the default owners for everything in the repo\n* @Phinease @WMC001\n"
},
{
"path": ".github/ISSUE_TEMPLATE/bug_report.yml",
"chars": 948,
"preview": "name: 'Bug Report'\ndescription: 'Report errors or unexpected behavior'\ntitle: '[Bug] '\ntype: Bug\nlabels: ['unconfirm']\nb"
},
{
"path": ".github/ISSUE_TEMPLATE/document_issue.yml",
"chars": 546,
"preview": "name: 'Document Issue'\ndescription: 'Report an issue with the documentation'\ntitle: '[Document] '\ntype: Feature\nlabels: "
},
{
"path": ".github/ISSUE_TEMPLATE/feature_request.yml",
"chars": 850,
"preview": "name: 'Feature Request'\ndescription: 'Suggest an idea'\ntitle: '[Request] '\ntype: Feature\nlabels: ['enhancement']\nbody:\n "
},
{
"path": ".github/ISSUE_TEMPLATE/improvement_proposal.yml",
"chars": 574,
"preview": "name: 'Improvement Proposal'\ndescription: 'Suggest enhancements or new features'\ntitle: '[Improvement] '\ntype: Feature\nl"
},
{
"path": ".github/dependabot.yml",
"chars": 663,
"preview": "version: 2\n\nupdates:\n - package-ecosystem: \"npm\"\n directory: \"/frontend\"\n schedule:\n interval: \"weekly\"\n "
},
{
"path": ".github/workflows/auto-build-data-process-dev.yml",
"chars": 1653,
"preview": "name: Docker Build Data-Process Images\n\nconcurrency:\n group: docker-build-data-process-dev-${{ github.ref }}\n cancel-i"
},
{
"path": ".github/workflows/auto-build-doc-dev.yml",
"chars": 1034,
"preview": "name: Docker Build Doc Check\n\nconcurrency:\n group: docker-build-doc-dev-${{ github.ref }}\n cancel-in-progress: true\n\no"
},
{
"path": ".github/workflows/auto-build-main-dev.yml",
"chars": 1015,
"preview": "name: Docker Build Main Images\n\nconcurrency:\n group: docker-build-main-dev-${{ github.ref }}\n cancel-in-progress: true"
},
{
"path": ".github/workflows/auto-build-mcp-dev.yml",
"chars": 1016,
"preview": "name: Docker Build MCP Images\n\nconcurrency:\n group: docker-build-mcp-dev-${{ github.ref }}\n cancel-in-progress: true\n\n"
},
{
"path": ".github/workflows/auto-build-terminal-dev.yml",
"chars": 1011,
"preview": "name: Docker Build Terminal Images\n\nconcurrency:\n group: docker-build-terminal-dev-${{ github.ref }}\n cancel-in-progre"
},
{
"path": ".github/workflows/auto-build-web-dev.yml",
"chars": 981,
"preview": "name: Docker Build Web Images\n\nconcurrency:\n group: docker-build-web-dev-${{ github.ref }}\n cancel-in-progress: true\n\n"
},
{
"path": ".github/workflows/auto-image-pull-test.yml",
"chars": 7103,
"preview": "name: Docker Image Pull Test\n\non:\n schedule:\n # Run every 30 minutes (at minute 0 and 30 of every hour)\n - cron: "
},
{
"path": ".github/workflows/auto-unit-test.yml",
"chars": 2793,
"preview": "name: Run Automated Unit Tests\n\nconcurrency:\n group: automated-unit-test-${{ github.ref }}\n cancel-in-progress: true\n\n"
},
{
"path": ".github/workflows/auto-web-check-dev.yml",
"chars": 1338,
"preview": "name: Run Auto Web Type Check\n\nconcurrency:\n group: auto-web-type-check-${{ github.ref }}\n cancel-in-progress: true\n\no"
},
{
"path": ".github/workflows/codeql.yml",
"chars": 4757,
"preview": "# For most projects, this workflow file will not need changing; you simply need\n# to commit it to your repository.\n#\n# Y"
},
{
"path": ".github/workflows/codeql_main.yml",
"chars": 4787,
"preview": "# For most projects, this workflow file will not need changing; you simply need\n# to commit it to your repository.\n#\n# Y"
},
{
"path": ".github/workflows/deploy-docs.yml",
"chars": 1631,
"preview": "# Workflow to build VitePress site and deploy it to GitHub Pages\n#\nname: Deploy VitePress Docs to Pages\n\non:\n # Run on "
},
{
"path": ".github/workflows/docker-build-push-mainland.yml",
"chars": 22450,
"preview": "name: Docker Build and Push All Images to tencentyun\n\non:\n workflow_dispatch:\n inputs:\n version:\n descri"
},
{
"path": ".github/workflows/docker-build-push-overseas.yml",
"chars": 18388,
"preview": "name: Docker Build and Push All Images to DockerHub\n\non:\n workflow_dispatch:\n inputs:\n version:\n descrip"
},
{
"path": ".github/workflows/docker-deploy.yml",
"chars": 4515,
"preview": "name: Deploy Nexent Community\n\non:\n workflow_dispatch:\n inputs:\n deployment_mode:\n description: 'Deploym"
},
{
"path": ".github/workflows/sdk_publish.yml",
"chars": 1080,
"preview": "name: Publish SDK to PyPI\n\non:\n workflow_dispatch:\n inputs:\n version:\n description: 'Version to publish "
},
{
"path": ".gitignore",
"chars": 444,
"preview": ".idea\n/.env\n.vscode\n\n*.DS_Store\n*.egg-info\n*.pyc\n\n__pycache__/\nsdk/build\nuploads/\n/sdk/nexent/core/nlp/baidu_stopwords.t"
},
{
"path": "AGENTS.md",
"chars": 1614,
"preview": "# AGENTS\n\n<!-- Skills section removed -->\n\n<skills_system priority=\"1\">\n\n## Available Skills\n\n<!-- SKILLS_TABLE_START --"
},
{
"path": "AUTHORS",
"chars": 361,
"preview": "Nexent Team:\n\nTeam Manager / Product Manager:\nShuangrui Chen @Phinease\n\nSenior System Engineer:\nSimeng Bian @Simeng Bian"
},
{
"path": "CLAUDE.md",
"chars": 6473,
"preview": "# Claude Code Rules\n\n## Code Quality Standards\n\n### English-Only Comments and Documentation\n- All comments and docstring"
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 5490,
"preview": "\n# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nWe as members, contributors, and leaders pledge to make particip"
},
{
"path": "CONTRIBUTING.md",
"chars": 7572,
"preview": "# Nexent Contributing Guide ✨\n\nThank you for considering contributing to Nexent! From code to docs to sharing your exper"
},
{
"path": "LICENSE",
"chars": 1388,
"preview": "# Nexent Open Source License\n\nNexent is licensed under the MIT License, with the following additional conditions:\n\nNexen"
},
{
"path": "NOTICE",
"chars": 497,
"preview": "# Nexent Open Source Project\n\nCopyright © 2025 Huawei Technologies Co., Ltd.\n\nThis product includes software developed b"
},
{
"path": "README.md",
"chars": 6201,
"preview": "\n\n[\n\n[\n"
},
{
"path": "backend/consts/error_code.py",
"chars": 9733,
"preview": "\"\"\"\nError code definitions for the application.\n\nFormat: XXYYZZ (6 digits, string)\n- XX: Module code (01-99, based on si"
},
{
"path": "backend/consts/error_message.py",
"chars": 8918,
"preview": "\"\"\"\nError message mappings for error codes.\n\nThis module provides default English error messages.\nFrontend should use i1"
},
{
"path": "backend/consts/exceptions.py",
"chars": 6785,
"preview": "\"\"\"\nCustom exception classes for the application.\n\nThis module provides two types of exceptions:\n\n1. New Framework (with"
},
{
"path": "backend/consts/model.py",
"chars": 31555,
"preview": "from enum import Enum\nfrom typing import Optional, Any, List, Dict\n\nfrom pydantic import BaseModel, Field, EmailStr\nfrom"
},
{
"path": "backend/consts/provider.py",
"chars": 713,
"preview": "from enum import Enum\n\n\nclass ProviderEnum(str, Enum):\n \"\"\"Supported model providers\"\"\"\n SILICON = \"silicon\"\n O"
},
{
"path": "backend/data_process/__init__.py",
"chars": 491,
"preview": "\"\"\"\nCelery application for Nexent data processing tasks\n\nThis module provides Celery-based task management for data proc"
},
{
"path": "backend/data_process/app.py",
"chars": 3669,
"preview": "\"\"\"\nCelery application configuration for data processing tasks\n\"\"\"\nimport logging\n\nfrom celery import Celery\nfrom celery"
},
{
"path": "backend/data_process/ray_actors.py",
"chars": 7147,
"preview": "import logging\nimport json\nfrom typing import Any, Dict, List, Optional\n\nimport ray\n\nfrom consts.const import RAY_ACTOR_"
},
{
"path": "backend/data_process/ray_config.py",
"chars": 8856,
"preview": "\"\"\"\nRay configuration management module\n\"\"\"\n\nimport logging\nimport os\nfrom typing import Any, Dict, Optional\n\nimport ray"
},
{
"path": "backend/data_process/tasks.py",
"chars": 47331,
"preview": "\"\"\"\nCelery tasks for data processing and vector storage\n\"\"\"\nimport asyncio\nimport json\nimport logging\nimport os\nimport t"
},
{
"path": "backend/data_process/utils.py",
"chars": 11812,
"preview": "\"\"\"\nUtility functions for Celery tasks\n\"\"\"\nimport asyncio\nimport json\nimport logging\nimport time\nfrom typing import Any,"
},
{
"path": "backend/data_process/worker.py",
"chars": 11734,
"preview": "\"\"\"\r\nCelery worker script for data processing tasks\r\n\r\nThis script is used to start Celery workers for processing data\r\n"
},
{
"path": "backend/data_process_service.py",
"chars": 38773,
"preview": "import uvicorn\nimport os\nimport sys\nimport subprocess\nimport signal\nimport logging\nimport argparse\nimport time\nimport th"
},
{
"path": "backend/database/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "backend/database/agent_db.py",
"chars": 15634,
"preview": "import logging\nfrom typing import List\nfrom sqlalchemy import update\n\nfrom database.client import get_db_session, as_dic"
},
{
"path": "backend/database/agent_version_db.py",
"chars": 12030,
"preview": "import logging\nfrom typing import List, Optional, Tuple\nfrom sqlalchemy import select, insert, update, func\n\nfrom databa"
},
{
"path": "backend/database/attachment_db.py",
"chars": 10052,
"preview": "import io\nimport os\nimport uuid\nfrom datetime import datetime\nfrom typing import Any, BinaryIO, Dict, List, Optional\n\nfr"
},
{
"path": "backend/database/client.py",
"chars": 9564,
"preview": "import logging\nfrom contextlib import contextmanager\nfrom typing import Any, BinaryIO, Dict, List, Optional, Tuple\n\nimpo"
},
{
"path": "backend/database/conversation_db.py",
"chars": 35560,
"preview": "import json\nfrom datetime import datetime\nfrom typing import Any, Dict, List, Optional, TypedDict\n\nfrom sqlalchemy impor"
},
{
"path": "backend/database/db_models.py",
"chars": 24494,
"preview": "from sqlalchemy import BigInteger, Boolean, Column, Integer, JSON, Numeric, PrimaryKeyConstraint, Sequence, String, Text"
},
{
"path": "backend/database/group_db.py",
"chars": 12328,
"preview": "\"\"\"\nDatabase operations for group management\n\"\"\"\nfrom typing import Any, Dict, List, Optional, Union\n\nfrom database.clie"
},
{
"path": "backend/database/invitation_db.py",
"chars": 10621,
"preview": "\"\"\"\nDatabase operations for invitation code management\n\"\"\"\nfrom typing import Any, Dict, List, Optional\n\nfrom database.c"
},
{
"path": "backend/database/knowledge_db.py",
"chars": 14086,
"preview": "from typing import Any, Dict, List, Optional\n\nimport uuid\nfrom sqlalchemy import func\nfrom sqlalchemy.exc import SQLAlch"
},
{
"path": "backend/database/memory_config_db.py",
"chars": 3879,
"preview": "from typing import Any, Dict, List\n\nfrom .client import filter_property, get_db_session\nfrom .db_models import MemoryUse"
},
{
"path": "backend/database/model_management_db.py",
"chars": 9311,
"preview": "from typing import Any, Dict, List, Optional\n\nfrom sqlalchemy import and_, desc, func, insert, select, update\n\nfrom cons"
},
{
"path": "backend/database/partner_db.py",
"chars": 2902,
"preview": "from typing import Optional\nfrom sqlalchemy.exc import SQLAlchemyError\n\nfrom database.client import get_db_session\nfrom "
},
{
"path": "backend/database/remote_mcp_db.py",
"chars": 6596,
"preview": "import logging\nfrom typing import Any, Dict, List\n\nfrom database.client import as_dict, filter_property, get_db_session\n"
},
{
"path": "backend/database/role_permission_db.py",
"chars": 2192,
"preview": "\"\"\"\nDatabase operations for role permission management\n\"\"\"\nfrom typing import Any, Dict, List, Optional\n\nfrom database.c"
},
{
"path": "backend/database/tenant_config_db.py",
"chars": 5560,
"preview": "import logging\nfrom typing import Any, Dict\n\nfrom sqlalchemy import func\nfrom sqlalchemy.exc import SQLAlchemyError\n\nfro"
},
{
"path": "backend/database/token_db.py",
"chars": 5716,
"preview": "\"\"\"\nDatabase operations for user API token (API Key) management.\n\"\"\"\nimport secrets\nfrom typing import Any, Dict, List, "
},
{
"path": "backend/database/tool_db.py",
"chars": 13100,
"preview": "import re\nfrom typing import List\n\nfrom database.agent_db import logger\nfrom database.client import get_db_session, filt"
},
{
"path": "backend/database/user_tenant_db.py",
"chars": 6005,
"preview": "\"\"\"\nDatabase operations for user tenant relationship management\n\"\"\"\nimport logging\nfrom typing import Any, List, Dict, O"
},
{
"path": "backend/database/utils.py",
"chars": 926,
"preview": "from typing import Any, Dict\n\n\n# Global tracking field management methods\ndef add_creation_tracking(data: Dict[str, Any]"
},
{
"path": "backend/mcp_service.py",
"chars": 675,
"preview": "import logging\nfrom utils.logging_utils import configure_logging\nfrom fastmcp import FastMCP\nfrom tool_collection.mcp.lo"
},
{
"path": "backend/middleware/__init__.py",
"chars": 29,
"preview": "# Backend middleware package\n"
},
{
"path": "backend/middleware/exception_handler.py",
"chars": 6378,
"preview": "\"\"\"\nGlobal exception handler middleware.\n\nThis middleware provides centralized error handling for the FastAPI applicatio"
},
{
"path": "backend/northbound_service.py",
"chars": 437,
"preview": "import uvicorn\nimport logging\nimport warnings\nfrom dotenv import load_dotenv\nfrom apps.northbound_base_app import northb"
},
{
"path": "backend/prompts/cluster_summary_reduce_en.yaml",
"chars": 1338,
"preview": "system_prompt: |-\n You are a professional summary assistant. Your task is to merge multiple document summaries into a c"
},
{
"path": "backend/prompts/cluster_summary_reduce_zh.yaml",
"chars": 547,
"preview": "system_prompt: |-\n 你是一个专业的总结助手。你的任务是将多个文档总结合并为一个连贯的总结。\n \n **总结要求:**\n 1. 输入包含属于同一主题的多个文档的总结\n 2. 这些文档共享相似的主题或话题\n 3. "
},
{
"path": "backend/prompts/document_summary_agent_en.yaml",
"chars": 1135,
"preview": "system_prompt: |-\n You are a professional document summarization assistant. Your task is to generate a concise summary "
},
{
"path": "backend/prompts/document_summary_agent_zh.yaml",
"chars": 467,
"preview": "system_prompt: |-\n 你是一个专业的文档总结助手。你的任务是根据文档的关键内容片段生成简洁的总结。\n \n **总结要求:**\n 1. 输入包含文档的关键片段(通常来自开头、中间和结尾部分)\n 2. 你需要提取主要主"
},
{
"path": "backend/prompts/managed_system_prompt_template_en.yaml",
"chars": 9029,
"preview": "system_prompt: |-\n ### Basic Information\n You are {{APP_NAME}}, {{APP_DESCRIPTION}}, it is {{time|default('current tim"
},
{
"path": "backend/prompts/managed_system_prompt_template_zh.yaml",
"chars": 4333,
"preview": "system_prompt: |-\n ### 基本信息\n 你是{{APP_NAME}},{{APP_DESCRIPTION}},现在是{{time|default('当前时间')}}\n\n {%- if memory_list and "
},
{
"path": "backend/prompts/manager_system_prompt_template_en.yaml",
"chars": 10614,
"preview": "system_prompt: |-\n ### Basic Information\n You are {{APP_NAME}}, {{APP_DESCRIPTION}}, it is {{time|default('current tim"
},
{
"path": "backend/prompts/manager_system_prompt_template_zh.yaml",
"chars": 5224,
"preview": "system_prompt: |-\n ### 基本信息\n 你是{{APP_NAME}},{{APP_DESCRIPTION}}, 现在是{{time|default('当前时间')}}\n\n {%- if memory_list and"
},
{
"path": "backend/prompts/utils/generate_title_en.yaml",
"chars": 1137,
"preview": "SYSTEM_PROMPT: |-\n Please generate a concise and accurate title (no more than 12 characters) for the following user que"
},
{
"path": "backend/prompts/utils/generate_title_zh.yaml",
"chars": 431,
"preview": "SYSTEM_PROMPT: |-\n 请为以下用户问题生成一个简洁准确的标题(不超过12个字符),突出核心主题或关键信息。标题应该自然流畅,避免强制堆砌关键词。\n\n **标题生成要求:**\n 1. 标题应该概括问题的本质(例如:'如何"
},
{
"path": "backend/prompts/utils/prompt_generate_en.yaml",
"chars": 16203,
"preview": "DUTY_SYSTEM_PROMPT: |-\n ### You are a [Prompt Generation Expert], used to help users create efficient and clear prompts"
},
{
"path": "backend/prompts/utils/prompt_generate_zh.yaml",
"chars": 7091,
"preview": "DUTY_SYSTEM_PROMPT: |-\n ### 你是【提示词生成专家】,用于帮助用户创建高效、清晰的提示词。\n 现在正在做一个Agent应用的提示词工程,用户的输入包含三个部分:任务描述、使用工具、使用到的助手。\n 需要你主要"
},
{
"path": "backend/pyproject.toml",
"chars": 893,
"preview": "[project]\nname = \"backend\"\nversion = \"0.1.0\"\nrequires-python = \"==3.10.*\"\ndependencies = [\n \"uvicorn>=0.34.0\",\n \"f"
},
{
"path": "backend/runtime_service.py",
"chars": 618,
"preview": "import uvicorn\nimport logging\nimport warnings\n\nfrom consts.const import APP_VERSION\n\nwarnings.filterwarnings(\"ignore\", c"
},
{
"path": "backend/services/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "backend/services/agent_service.py",
"chars": 81059,
"preview": "import asyncio\nimport json\nimport logging\nimport os\nimport uuid\nfrom collections import deque\nfrom typing import Callabl"
},
{
"path": "backend/services/agent_version_service.py",
"chars": 26065,
"preview": "import logging\nfrom typing import Optional, Tuple, List, Dict, Any\nfrom sqlalchemy import update\n\nfrom database.client i"
},
{
"path": "backend/services/config_sync_service.py",
"chars": 7307,
"preview": "import logging\nfrom typing import Optional, Any\n\nfrom consts.const import (\n APP_DESCRIPTION,\n APP_NAME,\n AVATA"
},
{
"path": "backend/services/conversation_management_service.py",
"chars": 27820,
"preview": "import asyncio\nimport json\nimport logging\nfrom datetime import datetime\nfrom typing import Any, Dict, List, Optional\n\nfr"
},
{
"path": "backend/services/data_process_service.py",
"chars": 28114,
"preview": "import asyncio\nimport base64\nimport concurrent.futures\nimport io\nimport logging\nimport os\nimport shutil\nimport tempfile\n"
},
{
"path": "backend/services/datamate_service.py",
"chars": 11983,
"preview": "\"\"\"\nService layer for DataMate knowledge base integration.\nHandles API calls to DataMate to fetch knowledge bases and th"
},
{
"path": "backend/services/dify_service.py",
"chars": 7577,
"preview": "\"\"\"\nDify Service Layer\nHandles API calls to Dify for knowledge base operations.\n\nThis service layer provides functionali"
},
{
"path": "backend/services/file_management_service.py",
"chars": 13593,
"preview": "import asyncio\nimport hashlib\nimport logging\nimport os\nfrom io import BytesIO\nfrom pathlib import Path\nfrom typing impor"
},
{
"path": "backend/services/group_service.py",
"chars": 18445,
"preview": "\"\"\"\nGroup service for managing groups and group memberships.\n\"\"\"\nimport logging\nfrom typing import Any, Dict, List, Opti"
},
{
"path": "backend/services/idata_service.py",
"chars": 10467,
"preview": "\"\"\"\niData Service Layer\nHandles API calls to iData for knowledge space operations.\n\nThis service layer provides function"
},
{
"path": "backend/services/image_service.py",
"chars": 1798,
"preview": "import logging\nfrom http import HTTPStatus\n\nimport aiohttp\n\nfrom consts.const import DATA_PROCESS_SERVICE\nfrom consts.co"
},
{
"path": "backend/services/invitation_service.py",
"chars": 17617,
"preview": "\"\"\"\nInvitation service for managing invitation codes and records.\n\"\"\"\nimport logging\nimport random\nimport string\nfrom da"
},
{
"path": "backend/services/mcp_container_service.py",
"chars": 12881,
"preview": "\"\"\"\nMCP Container Service - Wrapper around SDK container management\n\nThis module provides a compatibility layer for the "
},
{
"path": "backend/services/memory_config_service.py",
"chars": 7392,
"preview": "import logging\nfrom typing import Dict, List, Union\n\nfrom consts.const import (\n\tMEMORY_SWITCH_KEY,\n\tMEMORY_AGENT_SHARE_"
},
{
"path": "backend/services/model_health_service.py",
"chars": 9600,
"preview": "import logging\n\nfrom nexent.core import MessageObserver\nfrom nexent.core.models import OpenAIModel, OpenAIVLModel\nfrom n"
},
{
"path": "backend/services/model_management_service.py",
"chars": 20194,
"preview": "import logging\nfrom typing import List, Dict, Any, Optional\n\nfrom consts.const import LOCALHOST_IP, LOCALHOST_NAME, DOCK"
},
{
"path": "backend/services/model_provider_service.py",
"chars": 8010,
"preview": "import logging\nfrom typing import List\n\nfrom consts.const import (\n DEFAULT_EXPECTED_CHUNK_SIZE,\n DEFAULT_MAXIMUM_"
},
{
"path": "backend/services/northbound_service.py",
"chars": 12509,
"preview": "import asyncio\nimport hashlib\nimport logging\nimport time\nfrom dataclasses import dataclass\nfrom typing import Any, Dict,"
},
{
"path": "backend/services/prompt_service.py",
"chars": 17740,
"preview": "import json\nimport logging\nimport queue\nimport threading\nfrom typing import Optional, List\n\nfrom jinja2 import StrictUnd"
},
{
"path": "backend/services/providers/__init__.py",
"chars": 375,
"preview": "# Provider exports\nfrom services.providers.base import AbstractModelProvider\nfrom services.providers.silicon_provider im"
},
{
"path": "backend/services/providers/base.py",
"chars": 5772,
"preview": "import logging\nfrom abc import ABC, abstractmethod\nfrom typing import Dict, List\n\nimport aiohttp\n\nlogger = logging.getLo"
},
{
"path": "backend/services/providers/dashscope_provider.py",
"chars": 5857,
"preview": "import httpx\nfrom typing import Dict, List\nimport asyncio\nfrom consts.const import DEFAULT_LLM_MAX_TOKENS\nfrom consts.pr"
},
{
"path": "backend/services/providers/modelengine_provider.py",
"chars": 4044,
"preview": "import logging\nfrom typing import Dict, List\n\nimport aiohttp\n\nfrom consts.const import DEFAULT_LLM_MAX_TOKENS\nfrom servi"
},
{
"path": "backend/services/providers/silicon_provider.py",
"chars": 2345,
"preview": "import httpx\nfrom typing import Dict, List\n\nfrom consts.const import DEFAULT_LLM_MAX_TOKENS\nfrom consts.provider import "
},
{
"path": "backend/services/providers/tokenpony_provider.py",
"chars": 4999,
"preview": "import httpx\nimport ssl\n\nfrom typing import Dict, List\n\n\nfrom consts.const import DEFAULT_LLM_MAX_TOKENS\nfrom consts.pro"
},
{
"path": "backend/services/redis_service.py",
"chars": 32818,
"preview": "import json\nimport logging\nfrom typing import Dict, Any, Optional\n\nimport redis\n\nfrom consts.const import REDIS_URL, RED"
},
{
"path": "backend/services/remote_mcp_service.py",
"chars": 14916,
"preview": "import logging\nimport os\nimport tempfile\n\nfrom fastmcp import Client\nfrom fastmcp.client.transports import StreamableHtt"
},
{
"path": "backend/services/tenant_service.py",
"chars": 18083,
"preview": "\"\"\"\nTenant service for managing tenant operations\n\"\"\"\nimport asyncio\nimport logging\nimport uuid\nfrom typing import Any, "
},
{
"path": "backend/services/tool_configuration_service.py",
"chars": 26949,
"preview": "import importlib\nimport inspect\nimport json\nimport logging\nfrom typing import Any, List, Optional, Dict\nfrom urllib.pars"
},
{
"path": "backend/services/user_management_service.py",
"chars": 19785,
"preview": "import logging\nfrom typing import Optional, Any, Tuple, Dict, List\n\nfrom database.token_db import (\n create_token as "
},
{
"path": "backend/services/user_service.py",
"chars": 7139,
"preview": "\"\"\"\nUser service layer - handles user-related business logic\n\"\"\"\nimport logging\nfrom typing import Dict, Any, List, Opti"
},
{
"path": "backend/services/vectordatabase_service.py",
"chars": 74529,
"preview": "\"\"\"\nElasticsearch Application Interface Module\n\nThis module provides REST API interfaces for interacting with Elasticsea"
},
{
"path": "backend/services/voice_service.py",
"chars": 8643,
"preview": "import asyncio\nimport logging\nfrom typing import Any, Optional\n\nfrom nexent.core.models.stt_model import STTConfig, STTM"
},
{
"path": "backend/tool_collection/langchain/compute_tool.py",
"chars": 1665,
"preview": "# from langchain_core.tools import tool, StructuredTool\n# from typing import Annotated\n# from pydantic import BaseModel,"
},
{
"path": "backend/tool_collection/mcp/local_mcp_service.py",
"chars": 338,
"preview": "from fastmcp import FastMCP\n\n# Create MCP server\nlocal_mcp_service = FastMCP(\"local\")\n\n@local_mcp_service.tool(name=\"tes"
},
{
"path": "backend/utils/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "backend/utils/auth_utils.py",
"chars": 15366,
"preview": "import logging\nimport time\nimport hmac\nimport hashlib\nfrom datetime import datetime, timedelta\nfrom typing import Dict, "
},
{
"path": "backend/utils/config_utils.py",
"chars": 5775,
"preview": "import json\nimport logging\nfrom typing import Dict, Any\n\nfrom sqlalchemy.sql import func\n\nfrom database.model_management"
},
{
"path": "backend/utils/document_vector_utils.py",
"chars": 33920,
"preview": "\"\"\"\nDocument Vector Utilities Module\n\nThis module provides utilities for document-level vector operations and clustering"
},
{
"path": "backend/utils/file_management_utils.py",
"chars": 17632,
"preview": "import asyncio\nimport logging\nimport os\nimport subprocess\nimport traceback\nfrom pathlib import Path\nfrom typing import L"
},
{
"path": "backend/utils/langchain_utils.py",
"chars": 2521,
"preview": "import importlib.util\nimport logging\nimport os\nfrom typing import Any, Callable, List, Optional, Tuple\n\nlogger = logging"
},
{
"path": "backend/utils/llm_utils.py",
"chars": 6025,
"preview": "import logging\nfrom typing import Callable, List, Optional\n\nfrom consts.const import MESSAGE_ROLE, THINK_END_PATTERN, TH"
},
{
"path": "backend/utils/logging_utils.py",
"chars": 1817,
"preview": "import logging\n\nclass ColorFormatter(logging.Formatter):\n COLOR_MAP = {\n 'WARNING': '\\033[33m', # Yellow\n "
},
{
"path": "backend/utils/memory_utils.py",
"chars": 2992,
"preview": "import logging\nfrom typing import Dict, Any\nfrom urllib.parse import urlparse\n\nfrom consts import const as _c\nfrom const"
},
{
"path": "backend/utils/model_name_utils.py",
"chars": 1713,
"preview": "import logging\nfrom typing import List\n\ndef split_repo_name(full_name: str):\n \"\"\"\n Split model_name into model_rep"
},
{
"path": "backend/utils/monitoring.py",
"chars": 2596,
"preview": "\"\"\"\nGlobal Monitoring Manager for Backend\n\nThis module initializes and configures the global monitoring manager instance"
},
{
"path": "backend/utils/prompt_template_utils.py",
"chars": 5145,
"preview": "import logging\nimport os\nfrom typing import Dict, Any\n\nimport yaml\n\nfrom consts.const import LANGUAGE\n\nlogger = logging."
},
{
"path": "backend/utils/str_utils.py",
"chars": 1095,
"preview": "import re\nfrom typing import List, Optional\n\n\ndef remove_think_blocks(text: str) -> str:\n \"\"\"Remove <think>...</think"
}
]
// ... and 729 more files (download for full content)
About this extraction
This page contains the full source code of the ModelEngine-Group/nexent GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 929 files (10.1 MB), approximately 2.7M tokens, and a symbol index with 8525 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.