bailinghub 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dockerignore +42 -0
- package/.env.example +83 -0
- package/.gitignore +44 -0
- package/.npmignore +56 -0
- package/CODE_OF_CONDUCT.md +24 -0
- package/CONTRIBUTING.md +74 -0
- package/Dockerfile +16 -0
- package/LICENSE +176 -0
- package/LICENSING.md +9 -0
- package/NOTICE +23 -0
- package/README.en.md +264 -0
- package/README.md +279 -0
- package/SECURITY.md +30 -0
- package/THIRD_PARTY_NOTICES.md +254 -0
- package/VISION.md +41 -0
- package/assets/architecture-overview.en-dark.png +0 -0
- package/assets/architecture-overview.en-dark.svg +57 -0
- package/assets/architecture-overview.en.png +0 -0
- package/assets/architecture-overview.en.svg +57 -0
- package/assets/architecture-overview.zh-CN-dark.png +0 -0
- package/assets/architecture-overview.zh-CN-dark.svg +57 -0
- package/assets/architecture-overview.zh-CN.png +0 -0
- package/assets/architecture-overview.zh-CN.svg +57 -0
- package/assets/bailinghub-lockup-dark.png +0 -0
- package/assets/bailinghub-lockup-dark.svg +8 -0
- package/assets/bailinghub-lockup.png +0 -0
- package/assets/bailinghub-lockup.svg +8 -0
- package/brain/README.en.md +23 -0
- package/brain/README.md +45 -0
- package/brain/agents/code-review.md +41 -0
- package/brain/agents/triage.md +37 -0
- package/brain/profiles.json +114 -0
- package/brain/runbooks/ticket-triage.md +24 -0
- package/config.example.json +58 -0
- package/contracts/client-api/consumers.json +28 -0
- package/contracts/client-api/v1/error-response.schema.json +21 -0
- package/contracts/client-api/v1/health-response.schema.json +13 -0
- package/contracts/client-api/v1/job-response.schema.json +49 -0
- package/contracts/client-api/v1/manifest.json +63 -0
- package/contracts/client-api/v1/run-request.schema.json +42 -0
- package/contracts/client-api/v1/submit-response.schema.json +35 -0
- package/contracts/client-api/v1/vectors.json +153 -0
- package/demo/business/Dockerfile +8 -0
- package/demo/business/server.mjs +483 -0
- package/docker-compose.images.yml +67 -0
- package/docker-compose.yml +79 -0
- package/docs/AI_FRIENDLY_TOOLS.en.md +69 -0
- package/docs/AI/345/217/213/345/245/275/345/267/245/345/205/267/350/256/276/350/256/241/346/214/207/345/215/227.md +198 -0
- package/docs/ARCHITECTURE.en.md +81 -0
- package/docs/ARCHITECTURE.md +795 -0
- package/docs/CHANGELOG.en.md +275 -0
- package/docs/CHANGELOG.md +279 -0
- package/docs/CHANNELS.en.md +35 -0
- package/docs/CHANNELS.md +72 -0
- package/docs/CLIENT_API.md +89 -0
- package/docs/COMPATIBILITY.en.md +103 -0
- package/docs/CONTRACT.en.md +254 -0
- package/docs/CONTRACT.md +653 -0
- package/docs/DEMO.en.md +90 -0
- package/docs/DEMO.md +297 -0
- package/docs/ECOSYSTEM.en.md +39 -0
- package/docs/ECOSYSTEM.md +39 -0
- package/docs/INDEPENDENT_VALIDATION.en.md +184 -0
- package/docs/INDEPENDENT_VALIDATION.md +184 -0
- package/docs/INTEGRATION.en.md +120 -0
- package/docs/KERNEL_HOST_API.en.md +59 -0
- package/docs/KERNEL_HOST_API.md +59 -0
- package/docs/OPERATIONS.en.md +182 -0
- package/docs/OPERATIONS.md +231 -0
- package/docs/PIPELINE.en.md +74 -0
- package/docs/PIPELINE.md +67 -0
- package/docs/QUICKSTART.en.md +297 -0
- package/docs/QUICKSTART.md +152 -0
- package/docs/README.en.md +103 -0
- package/docs/README.md +119 -0
- package/docs/RELEASE_NOTES_v0.1.0.en.md +46 -0
- package/docs/RELEASE_NOTES_v0.1.0.md +66 -0
- package/docs/RELEASE_NOTES_v0.1.1.en.md +38 -0
- package/docs/RELEASE_NOTES_v0.1.1.md +38 -0
- package/docs/RELEASE_NOTES_v0.1.10.en.md +102 -0
- package/docs/RELEASE_NOTES_v0.1.10.md +102 -0
- package/docs/RELEASE_NOTES_v0.1.11.en.md +99 -0
- package/docs/RELEASE_NOTES_v0.1.11.md +99 -0
- package/docs/RELEASE_NOTES_v0.1.12.en.md +64 -0
- package/docs/RELEASE_NOTES_v0.1.12.md +64 -0
- package/docs/RELEASE_NOTES_v0.1.13.en.md +46 -0
- package/docs/RELEASE_NOTES_v0.1.13.md +46 -0
- package/docs/RELEASE_NOTES_v0.1.14.en.md +55 -0
- package/docs/RELEASE_NOTES_v0.1.14.md +55 -0
- package/docs/RELEASE_NOTES_v0.1.15.en.md +50 -0
- package/docs/RELEASE_NOTES_v0.1.15.md +50 -0
- package/docs/RELEASE_NOTES_v0.1.16.en.md +106 -0
- package/docs/RELEASE_NOTES_v0.1.16.md +105 -0
- package/docs/RELEASE_NOTES_v0.1.2.en.md +39 -0
- package/docs/RELEASE_NOTES_v0.1.2.md +39 -0
- package/docs/RELEASE_NOTES_v0.1.3.en.md +55 -0
- package/docs/RELEASE_NOTES_v0.1.3.md +55 -0
- package/docs/RELEASE_NOTES_v0.1.4.en.md +55 -0
- package/docs/RELEASE_NOTES_v0.1.4.md +55 -0
- package/docs/RELEASE_NOTES_v0.1.5.en.md +49 -0
- package/docs/RELEASE_NOTES_v0.1.5.md +49 -0
- package/docs/RELEASE_NOTES_v0.1.6.en.md +41 -0
- package/docs/RELEASE_NOTES_v0.1.6.md +41 -0
- package/docs/RELEASE_NOTES_v0.1.7.en.md +39 -0
- package/docs/RELEASE_NOTES_v0.1.7.md +39 -0
- package/docs/RELEASE_NOTES_v0.1.8.en.md +88 -0
- package/docs/RELEASE_NOTES_v0.1.8.md +88 -0
- package/docs/RELEASE_NOTES_v0.1.9.en.md +127 -0
- package/docs/RELEASE_NOTES_v0.1.9.md +127 -0
- package/docs/RELEASE_NOTES_v0.2.0.en.md +95 -0
- package/docs/RELEASE_NOTES_v0.2.0.md +96 -0
- package/docs/RELEASE_NOTES_v0.3.0.en.md +77 -0
- package/docs/RELEASE_NOTES_v0.3.0.md +77 -0
- package/docs/SDK.en.md +177 -0
- package/docs/STREAMING.en.md +78 -0
- package/docs/STREAMING.md +109 -0
- package/docs/TOOLS.en.md +205 -0
- package/docs/TOOLS_DESIGN.en.md +142 -0
- package/docs/TOOLS_DESIGN.md +466 -0
- package/docs/TOOLS_MODEL.en.md +56 -0
- package/docs/TOOLS_MODEL.md +903 -0
- package/docs/WIDGET_RENDERERS.en.md +133 -0
- package/docs/WIDGET_RENDERERS.md +139 -0
- package/docs/examples/bailing-tool-verify.mjs +94 -0
- package/docs/examples/bailing-tool-verify.php +154 -0
- package/docs/examples/bailing-tool-verify.py +107 -0
- package/docs/examples/custom-streaming-chat-client.mjs +108 -0
- package/docs/examples/widget-chart-renderer-adapter.mjs +44 -0
- package/docs/integrations/bailian/README.en.md +181 -0
- package/docs/integrations/bailian/README.md +165 -0
- package/docs/integrations/bailian/bailian-mcp-config.json +17 -0
- package/docs/integrations/bailian/verify_recipe.py +97 -0
- package/docs/integrations/deepseek/README.en.md +225 -0
- package/docs/integrations/deepseek/README.md +225 -0
- package/docs/integrations/deepseek/verify_e2e.py +131 -0
- package/docs/integrations/dify/README.en.md +131 -0
- package/docs/integrations/dify/README.md +131 -0
- package/docs/integrations/dify/bailinghub-control-plane.openapi.json +129 -0
- package/docs/integrations/dify/verify_contract.py +88 -0
- package/docs/integrations/dify/verify_e2e.py +117 -0
- package/docs/integrations/jeecgboot/README.en.md +193 -0
- package/docs/integrations/jeecgboot/README.md +161 -0
- package/docs/integrations/jeecgboot/adapter-contract.v1.json +94 -0
- package/docs/integrations/jeecgboot/jeecgboot-user-adapter.openapi.json +183 -0
- package/docs/integrations/jeecgboot/verify_recipe.mjs +97 -0
- package/docs/integrations/ruoyi-vue-pro/README.en.md +91 -0
- package/docs/integrations/ruoyi-vue-pro/README.md +155 -0
- package/docs/integrations/ruoyi-vue-pro/adapter-contract.v1.json +71 -0
- package/docs/integrations/ruoyi-vue-pro/ruoyi-vue-pro-trade-adapter.openapi.json +148 -0
- package/docs/integrations/ruoyi-vue-pro/verify_recipe.mjs +71 -0
- package/docs/user-guide/README.en.md +39 -0
- package/docs/user-guide/README.md +40 -0
- package/docs/user-guide/concepts.en.md +69 -0
- package/docs/user-guide/concepts.md +225 -0
- package/docs/user-guide/console-map.en.md +58 -0
- package/docs/user-guide/console-map.md +473 -0
- package/docs/user-guide/overview.en.md +61 -0
- package/docs/user-guide/overview.md +156 -0
- package/docs/user-guide/scenarios.en.md +70 -0
- package/docs/user-guide/scenarios.md +398 -0
- package/docs//345/205/274/345/256/271/346/200/247/344/270/216/345/215/207/347/272/247.md +134 -0
- package/docs//347/254/254/344/270/211/346/226/271/345/257/271/346/216/245/346/214/207/345/215/227.md +625 -0
- package/package.json +119 -0
- package/schemas/agent-capability-contract.schema.json +104 -0
- package/schemas/api/approval-decision.schema.json +28 -0
- package/schemas/api/approval-request.schema.json +31 -0
- package/schemas/api/delivery-callback.schema.json +28 -0
- package/schemas/api/job-response.schema.json +6 -0
- package/schemas/api/kb-doc-upsert.schema.json +21 -0
- package/schemas/api/run-request.schema.json +6 -0
- package/schemas/api/run-response.schema.json +6 -0
- package/schemas/api/tool-spec.schema.json +38 -0
- package/schemas/config/alert-rule.schema.json +22 -0
- package/schemas/config/channel.schema.json +91 -0
- package/schemas/config/chat-entry.schema.json +47 -0
- package/schemas/config/client.schema.json +56 -0
- package/schemas/config/common.schema.json +215 -0
- package/schemas/config/credential.schema.json +48 -0
- package/schemas/config/executor-token.schema.json +20 -0
- package/schemas/config/page-context.schema.json +21 -0
- package/schemas/config/route.schema.json +152 -0
- package/schemas/config/storage-bucket.schema.json +31 -0
- package/schemas/config/target.schema.json +17 -0
- package/schemas/config/tool-provider.schema.json +60 -0
- package/schemas/tool-definition.schema.json +188 -0
- package/scripts/check-client-api-ecosystem.mjs +69 -0
- package/scripts/check-doc-links.mjs +136 -0
- package/scripts/check-image-tags.sh +43 -0
- package/scripts/check-package-artifact.mjs +185 -0
- package/scripts/check-release-consistency.mjs +199 -0
- package/scripts/check-release-consistency.test.mjs +63 -0
- package/scripts/client-api-contract-test.ts +127 -0
- package/scripts/create-admin.ts +27 -0
- package/scripts/demo-e2e.ts +133 -0
- package/scripts/docker-entrypoint.sh +33 -0
- package/scripts/doctor.ts +107 -0
- package/scripts/e2e-console.mjs +214 -0
- package/scripts/export-oss.mjs +204 -0
- package/scripts/generate-readme-assets.mjs +181 -0
- package/scripts/generate-third-party-notices.mjs +93 -0
- package/scripts/image-release-policy.mjs +75 -0
- package/scripts/image-release-policy.test.mjs +58 -0
- package/scripts/init-db.ts +21 -0
- package/scripts/install.sh +461 -0
- package/scripts/oss-boundary-check.mjs +183 -0
- package/scripts/publish-images.sh +63 -0
- package/scripts/publish-mysql-image.sh +41 -0
- package/scripts/release-audit.mjs +348 -0
- package/scripts/sdk-contract-test.ts +62 -0
- package/scripts/sdk-p1-check.mjs +58 -0
- package/scripts/sdk-runtime-test.mjs +106 -0
- package/scripts/security-scan.mjs +110 -0
- package/scripts/seed-demo.ts +116 -0
- package/scripts/selftest.ts +226 -0
- package/scripts/smoke.ts +31 -0
- package/scripts/validate-examples.mjs +93 -0
- package/scripts/verify-bootstrap-admin-restart.ts +66 -0
- package/scripts/verify-github-repo.mjs +195 -0
- package/scripts/verify-oss-export.mjs +192 -0
- package/scripts/verify-routing.ts +29 -0
- package/scripts/widget-renderer-test.mjs +206 -0
- package/scripts/write-build-info.mjs +29 -0
- package/sdk/dotnet/Bailing.Connect/Bailing.Connect.csproj +12 -0
- package/sdk/dotnet/Bailing.Connect/BailingConnect.cs +260 -0
- package/sdk/dotnet/README.md +32 -0
- package/sdk/dotnet/examples/BuildSpec/BuildSpec.csproj +11 -0
- package/sdk/dotnet/examples/BuildSpec/Program.cs +36 -0
- package/sdk/go/README.md +33 -0
- package/sdk/go/bailingconnect/connect.go +367 -0
- package/sdk/go/examples/build-spec/main.go +39 -0
- package/sdk/go/go.mod +3 -0
- package/sdk/java/README.md +43 -0
- package/sdk/java/examples/BuildSpec.java +31 -0
- package/sdk/java/src/main/java/com/bailing/connect/BailingConnect.java +376 -0
- package/sdk/node/README.md +107 -0
- package/sdk/node/examples/build-spec.mjs +84 -0
- package/sdk/node/package.json +22 -0
- package/sdk/node/src/index.mjs +250 -0
- package/sdk/php/README.md +204 -0
- package/sdk/php/composer.json +18 -0
- package/sdk/php/examples/DemoStaffController.php +108 -0
- package/sdk/php/examples/build-spec.php +27 -0
- package/sdk/php/examples/thinkphp-integration.php +81 -0
- package/sdk/php/src/Attributes/AiParam.php +40 -0
- package/sdk/php/src/Attributes/AiTool.php +75 -0
- package/sdk/php/src/HubClient.php +122 -0
- package/sdk/php/src/SpecBuilder.php +328 -0
- package/sdk/php/src/SpecServer.php +209 -0
- package/sdk/php/src/Ticket.php +37 -0
- package/sdk/php/src/Verify.php +178 -0
- package/sdk/php7/README.md +191 -0
- package/sdk/php7/composer.json +18 -0
- package/sdk/php7/examples/build-spec.php +68 -0
- package/sdk/php7/examples/well-known.php +33 -0
- package/sdk/php7/src/HubClient.php +111 -0
- package/sdk/php7/src/SpecServer.php +203 -0
- package/sdk/php7/src/Ticket.php +33 -0
- package/sdk/php7/src/ToolDef.php +169 -0
- package/sdk/php7/src/ToolSpec.php +334 -0
- package/sdk/php7/src/Verify.php +165 -0
- package/sdk/python/README.md +107 -0
- package/sdk/python/bailing_connect/__init__.py +307 -0
- package/sdk/python/examples/build_spec.py +90 -0
- package/sdk/python/pyproject.toml +24 -0
- package/sql/001_init_state.sql +66 -0
- package/sql/002_routes.sql +44 -0
- package/sql/003_executor.sql +15 -0
- package/sql/004_clients.sql +22 -0
- package/sql/005_admins.sql +25 -0
- package/sql/006_ledger.sql +57 -0
- package/sql/007_delivery.sql +8 -0
- package/sql/008_kb.sql +66 -0
- package/sql/009_rbac.sql +5 -0
- package/sql/010_targets.sql +28 -0
- package/sql/011_observability.sql +11 -0
- package/sql/012_generic.sql +5 -0
- package/sql/013_tools.sql +24 -0
- package/sql/014_approvals.sql +27 -0
- package/sql/015_chat.sql +21 -0
- package/sql/016_chat_feedback.sql +19 -0
- package/sql/017_provider_autorefresh.sql +6 -0
- package/sql/018_kb_ingest.sql +11 -0
- package/sql/019_kb_datasources.sql +32 -0
- package/sql/022_storage_buckets.sql +25 -0
- package/sql/024_channels.sql +15 -0
- package/sql/025_chat_appearance.sql +7 -0
- package/sql/026_thread_memory.sql +10 -0
- package/sql/027_page_contexts.sql +23 -0
- package/sql/028_executor_capabilities.sql +4 -0
- package/sql/029_executor_tokens.sql +13 -0
- package/sql/030_route_permission.sql +5 -0
- package/sql/031_tool_embeddings.sql +20 -0
- package/sql/032_tool_provider_embed.sql +7 -0
- package/sql/033_alert_rules.sql +21 -0
- package/sql/034_client_allowed_channels.sql +6 -0
- package/sql/035_tool_idempotency.sql +15 -0
- package/sql/036_delivery_dlq.sql +15 -0
- package/sql/038_audit_trace_shape.sql +15 -0
- package/sql/039_runtime_locks.sql +9 -0
- package/sql/040_budget_policy.sql +3 -0
- package/sql/041_approval_intent.sql +14 -0
- package/sql/042_approval_decision_contract.sql +11 -0
- package/sql/043_rate_limits.sql +7 -0
- package/sql/044_job_run_after.sql +3 -0
- package/sql/045_job_claim_lease.sql +7 -0
- package/sql/046_tool_authz_probe.sql +5 -0
- package/sql/047_route_audience.sql +4 -0
- package/sql/048_llm_target.sql +17 -0
- package/sql/049_llm_input_shape.sql +11 -0
- package/sql/050_operational_metrics_indexes.sql +8 -0
- package/sql/051_instance_branding.sql +17 -0
- package/sql/052_tool_execution_journal.sql +19 -0
- package/sql/053_tool_spec_access_policy.sql +9 -0
- package/sql/README.en.md +41 -0
- package/sql/README.md +40 -0
- package/src/adapters/channels/wecom-api.test.ts +77 -0
- package/src/adapters/channels/wecom-api.ts +224 -0
- package/src/adapters/channels/wecom-crypto.test.ts +85 -0
- package/src/adapters/channels/wecom-crypto.ts +77 -0
- package/src/adapters/executors/claudecode.ts +39 -0
- package/src/adapters/executors/profiles.ts +86 -0
- package/src/adapters/executors/report.ts +35 -0
- package/src/adapters/executors/runner.ts +114 -0
- package/src/adapters/executors/wecomnotify.ts +63 -0
- package/src/adapters/llm/file.test.ts +81 -0
- package/src/adapters/llm/file.ts +250 -0
- package/src/adapters/llm/openai-chat-stream.test.ts +74 -0
- package/src/adapters/llm/openai-chat-stream.ts +154 -0
- package/src/adapters/llm/perception.ts +159 -0
- package/src/adapters/llm/speech.test.ts +75 -0
- package/src/adapters/llm/speech.ts +146 -0
- package/src/adapters/storage/object-storage.test.ts +38 -0
- package/src/adapters/storage/object-storage.ts +140 -0
- package/src/adapters/targets/demo-agent.ts +88 -0
- package/src/adapters/targets/llm.test.ts +733 -0
- package/src/adapters/targets/llm.ts +862 -0
- package/src/app/admin-bootstrap.test.ts +112 -0
- package/src/app/admin-bootstrap.ts +48 -0
- package/src/app/auth-default.ts +26 -0
- package/src/app/auth.test.ts +57 -0
- package/src/app/auth.ts +207 -0
- package/src/app/builtin-tools-default.ts +17 -0
- package/src/app/builtin-tools.test.ts +202 -0
- package/src/app/builtin-tools.ts +380 -0
- package/src/app/channels-default.ts +8 -0
- package/src/app/channels.ts +141 -0
- package/src/app/delivery-default.ts +14 -0
- package/src/app/delivery.test.ts +46 -0
- package/src/app/delivery.ts +215 -0
- package/src/app/engine-default.ts +54 -0
- package/src/app/engine.ts +427 -0
- package/src/app/http-mount.test.ts +27 -0
- package/src/app/http-server.test.ts +114 -0
- package/src/app/http-server.ts +127 -0
- package/src/app/http.test.ts +27 -0
- package/src/app/http.ts +118 -0
- package/src/app/kernel.test.ts +191 -0
- package/src/app/kernel.ts +544 -0
- package/src/app/monitor-default.ts +9 -0
- package/src/app/monitor.ts +46 -0
- package/src/app/operational-metrics.test.ts +73 -0
- package/src/app/operational-metrics.ts +124 -0
- package/src/app/oss-edition.test.ts +71 -0
- package/src/app/oss-edition.ts +108 -0
- package/src/app/outbound-default.ts +57 -0
- package/src/app/outbound.ts +133 -0
- package/src/app/readiness.test.ts +37 -0
- package/src/app/readiness.ts +39 -0
- package/src/app/runtime-composition.test.ts +51 -0
- package/src/app/runtime-composition.ts +73 -0
- package/src/app/runtime-context-default.ts +30 -0
- package/src/app/runtime-context.test.ts +60 -0
- package/src/app/runtime-context.ts +79 -0
- package/src/app/runtime-lifecycle-default.ts +48 -0
- package/src/app/runtime-lifecycle.test.ts +322 -0
- package/src/app/runtime-lifecycle.ts +440 -0
- package/src/app/runtime.ts +36 -0
- package/src/app/tool-approvals-default.ts +16 -0
- package/src/app/tool-approvals.ts +214 -0
- package/src/app/tool-assembly-default.ts +11 -0
- package/src/app/tool-assembly.test.ts +112 -0
- package/src/app/tool-assembly.ts +83 -0
- package/src/app/tool-context-default.ts +7 -0
- package/src/app/tool-context.test.ts +82 -0
- package/src/app/tool-context.ts +109 -0
- package/src/app/tool-debug.test.ts +111 -0
- package/src/app/tool-debug.ts +152 -0
- package/src/app/tool-proxy-default.ts +35 -0
- package/src/app/tool-proxy.ts +173 -0
- package/src/app/tool-specs-default.ts +33 -0
- package/src/app/tool-specs.test.ts +322 -0
- package/src/app/tool-specs.ts +555 -0
- package/src/app/tools-runtime-default.ts +14 -0
- package/src/app/tools-runtime.ts +23 -0
- package/src/architecture-boundary.test.ts +119 -0
- package/src/core/config/config-codec.test.ts +105 -0
- package/src/core/config/config-codec.ts +231 -0
- package/src/core/config/config-diagnostics.test.ts +285 -0
- package/src/core/config/config-diagnostics.ts +436 -0
- package/src/core/config/config-models.test.ts +584 -0
- package/src/core/config/config-models.ts +392 -0
- package/src/core/config/config-schema.test.ts +153 -0
- package/src/core/config/config.test.ts +314 -0
- package/src/core/config/config.ts +324 -0
- package/src/core/config/route-config.test.ts +232 -0
- package/src/core/config/route-config.ts +246 -0
- package/src/core/config/target-config.test.ts +139 -0
- package/src/core/config/target-config.ts +219 -0
- package/src/core/config/tools-config.test.ts +124 -0
- package/src/core/config/tools-config.ts +126 -0
- package/src/core/contracts/approval-decision.test.ts +67 -0
- package/src/core/contracts/approval-decision.ts +93 -0
- package/src/core/contracts/openapi-tools.ts +201 -0
- package/src/core/contracts/tool-annotations.ts +121 -0
- package/src/core/contracts/tool-definition.test.ts +147 -0
- package/src/core/contracts/tool-definition.ts +304 -0
- package/src/core/contracts/tools-idempotency.test.ts +435 -0
- package/src/core/contracts/tools.test.ts +487 -0
- package/src/core/contracts/tools.ts +831 -0
- package/src/core/contracts/types.ts +408 -0
- package/src/core/edition/capabilities.ts +6 -0
- package/src/core/edition/context.test.ts +20 -0
- package/src/core/edition/context.ts +78 -0
- package/src/core/edition/index.ts +4 -0
- package/src/core/edition/scope-resolver.ts +24 -0
- package/src/core/edition/store-factory.ts +6 -0
- package/src/core/observability/openmetrics.test.ts +57 -0
- package/src/core/observability/openmetrics.ts +103 -0
- package/src/core/platform/content.test.ts +46 -0
- package/src/core/platform/content.ts +90 -0
- package/src/core/platform/fence.test.ts +31 -0
- package/src/core/platform/fence.ts +11 -0
- package/src/core/platform/instance-branding.test.ts +65 -0
- package/src/core/platform/instance-branding.ts +202 -0
- package/src/core/platform/metrics-token.test.ts +31 -0
- package/src/core/platform/metrics-token.ts +42 -0
- package/src/core/platform/pagecontext.ts +0 -0
- package/src/core/platform/password.test.ts +13 -0
- package/src/core/platform/password.ts +38 -0
- package/src/core/platform/queue.test.ts +59 -0
- package/src/core/platform/queue.ts +75 -0
- package/src/core/platform/serial.test.ts +73 -0
- package/src/core/platform/serial.ts +64 -0
- package/src/core/platform/server-token.test.ts +46 -0
- package/src/core/platform/server-token.ts +60 -0
- package/src/core/platform/signing.test.ts +24 -0
- package/src/core/platform/signing.ts +22 -0
- package/src/core/platform/time.ts +73 -0
- package/src/core/platform/version.test.ts +19 -0
- package/src/core/platform/version.ts +90 -0
- package/src/core/runtime/budget-runtime.test.ts +93 -0
- package/src/core/runtime/budget-runtime.ts +110 -0
- package/src/core/runtime/context-runtime.test.ts +106 -0
- package/src/core/runtime/context-runtime.ts +95 -0
- package/src/core/runtime/credential-resolver.test.ts +129 -0
- package/src/core/runtime/credential-resolver.ts +93 -0
- package/src/core/runtime/credential-verify.test.ts +76 -0
- package/src/core/runtime/credential-verify.ts +161 -0
- package/src/core/runtime/debug-report.test.ts +20 -0
- package/src/core/runtime/debug-report.ts +100 -0
- package/src/core/runtime/execution-runtime.test.ts +350 -0
- package/src/core/runtime/execution-runtime.ts +197 -0
- package/src/core/runtime/finish-runtime.test.ts +168 -0
- package/src/core/runtime/finish-runtime.ts +83 -0
- package/src/core/runtime/identity-runtime.test.ts +38 -0
- package/src/core/runtime/identity-runtime.ts +104 -0
- package/src/core/runtime/inhub-runtime.test.ts +297 -0
- package/src/core/runtime/inhub-runtime.ts +198 -0
- package/src/core/runtime/job-stream.test.ts +55 -0
- package/src/core/runtime/job-stream.ts +187 -0
- package/src/core/runtime/knowledge-runtime.test.ts +120 -0
- package/src/core/runtime/knowledge-runtime.ts +98 -0
- package/src/core/runtime/launch-runtime.test.ts +187 -0
- package/src/core/runtime/launch-runtime.ts +182 -0
- package/src/core/runtime/memory-runtime.test.ts +85 -0
- package/src/core/runtime/memory-runtime.ts +32 -0
- package/src/core/runtime/memory.ts +141 -0
- package/src/core/runtime/redaction-runtime.test.ts +35 -0
- package/src/core/runtime/redaction-runtime.ts +60 -0
- package/src/core/runtime/routing-runtime.test.ts +89 -0
- package/src/core/runtime/routing-runtime.ts +146 -0
- package/src/core/runtime/smoke-runtime.test.ts +65 -0
- package/src/core/runtime/smoke-runtime.ts +237 -0
- package/src/core/runtime/summary-runtime.test.ts +234 -0
- package/src/core/runtime/summary-runtime.ts +153 -0
- package/src/core/runtime/trace-runtime.test.ts +234 -0
- package/src/core/runtime/trace-runtime.ts +330 -0
- package/src/core/state/audit-observability.test.ts +51 -0
- package/src/core/state/audit-observability.ts +74 -0
- package/src/core/state/state-codec.ts +44 -0
- package/src/core/state/state-contracts.ts +59 -0
- package/src/core/targets/adapter.ts +69 -0
- package/src/core/targets/registry.test.ts +65 -0
- package/src/core/targets/registry.ts +153 -0
- package/src/core/targets/resolve.ts +21 -0
- package/src/executor.ts +201 -0
- package/src/extension-api.test.ts +84 -0
- package/src/extension-api.ts +194 -0
- package/src/infrastructure/config/config-admin-repository.test.ts +193 -0
- package/src/infrastructure/config/config-admin-repository.ts +175 -0
- package/src/infrastructure/config/config-alert-rule-repository.ts +38 -0
- package/src/infrastructure/config/config-approval-ledger.ts +74 -0
- package/src/infrastructure/config/config-channel-repository.ts +31 -0
- package/src/infrastructure/config/config-chat-repository.ts +83 -0
- package/src/infrastructure/config/config-client-repository.ts +46 -0
- package/src/infrastructure/config/config-conversation-ledger.ts +222 -0
- package/src/infrastructure/config/config-credential-repository.test.ts +32 -0
- package/src/infrastructure/config/config-credential-repository.ts +47 -0
- package/src/infrastructure/config/config-delivery-dlq-ledger.ts +49 -0
- package/src/infrastructure/config/config-executor-ledger.ts +30 -0
- package/src/infrastructure/config/config-executor-token-repository.ts +44 -0
- package/src/infrastructure/config/config-instance-branding-repository.ts +75 -0
- package/src/infrastructure/config/config-knowledge-repository.ts +249 -0
- package/src/infrastructure/config/config-observability-ledger.ts +262 -0
- package/src/infrastructure/config/config-project-repository.ts +30 -0
- package/src/infrastructure/config/config-rate-limit-ledger.ts +56 -0
- package/src/infrastructure/config/config-route-repository.ts +41 -0
- package/src/infrastructure/config/config-storage-bucket-repository.ts +43 -0
- package/src/infrastructure/config/config-target-repository.ts +25 -0
- package/src/infrastructure/config/config-tool-call-ledger.ts +142 -0
- package/src/infrastructure/config/config-tool-embedding-repository.test.ts +124 -0
- package/src/infrastructure/config/config-tool-embedding-repository.ts +78 -0
- package/src/infrastructure/config/config-tool-provider-repository.test.ts +71 -0
- package/src/infrastructure/config/config-tool-provider-repository.ts +50 -0
- package/src/infrastructure/config/configstore.ts +130 -0
- package/src/infrastructure/config/local-instance-branding-provider.test.ts +94 -0
- package/src/infrastructure/config/local-instance-branding-provider.ts +79 -0
- package/src/infrastructure/mysql/pool-owner.test.ts +36 -0
- package/src/infrastructure/mysql/pool-owner.ts +56 -0
- package/src/infrastructure/schema/core-schema-migrator.test.ts +340 -0
- package/src/infrastructure/schema/core-schema-migrator.ts +461 -0
- package/src/infrastructure/schema/migration-files.test.ts +18 -0
- package/src/infrastructure/schema/migration-files.ts +27 -0
- package/src/infrastructure/schema/retired-migrations.ts +35 -0
- package/src/infrastructure/state/operational-metrics-storage.test.ts +107 -0
- package/src/infrastructure/state/state-jsonl.ts +268 -0
- package/src/infrastructure/state/state-mysql-update-plan.test.ts +54 -0
- package/src/infrastructure/state/state-mysql-update-plan.ts +63 -0
- package/src/infrastructure/state/state-mysql.ts +359 -0
- package/src/infrastructure/state/state.test.ts +319 -0
- package/src/infrastructure/state/state.ts +11 -0
- package/src/kernel-api/v1/artifact.test.ts +46 -0
- package/src/kernel-api/v1/artifact.ts +71 -0
- package/src/kernel-api/v1/contracts.ts +168 -0
- package/src/kernel-api/v1/execution-gate.test.ts +25 -0
- package/src/kernel-api/v1/execution-gate.ts +18 -0
- package/src/kernel-api/v1/index.ts +51 -0
- package/src/openclaw-stdio.test.ts +60 -0
- package/src/routes/admin-access-default.ts +20 -0
- package/src/routes/admin-access.ts +94 -0
- package/src/routes/admin-branding.test.ts +116 -0
- package/src/routes/admin-branding.ts +48 -0
- package/src/routes/admin-chat-default.ts +12 -0
- package/src/routes/admin-chat.ts +84 -0
- package/src/routes/admin-default.ts +35 -0
- package/src/routes/admin-dispatch-config-default.ts +13 -0
- package/src/routes/admin-dispatch-config.ts +121 -0
- package/src/routes/admin-format.ts +12 -0
- package/src/routes/admin-host.test.ts +56 -0
- package/src/routes/admin-infra-default.ts +12 -0
- package/src/routes/admin-infra.ts +142 -0
- package/src/routes/admin-kb-default.ts +13 -0
- package/src/routes/admin-kb.ts +160 -0
- package/src/routes/admin-runtime-default.ts +31 -0
- package/src/routes/admin-runtime.ts +444 -0
- package/src/routes/admin-tool-providers-default.ts +20 -0
- package/src/routes/admin-tool-providers.test.ts +114 -0
- package/src/routes/admin-tool-providers.ts +186 -0
- package/src/routes/admin.ts +246 -0
- package/src/routes/approvals-default.ts +32 -0
- package/src/routes/approvals.ts +120 -0
- package/src/routes/chat-default.ts +61 -0
- package/src/routes/chat-mount.test.ts +58 -0
- package/src/routes/chat.test.ts +222 -0
- package/src/routes/chat.ts +478 -0
- package/src/routes/critical-routes.test.ts +292 -0
- package/src/routes/executor-default.ts +45 -0
- package/src/routes/executor.ts +226 -0
- package/src/routes/kb-default.ts +23 -0
- package/src/routes/kb.ts +92 -0
- package/src/routes/private-default.ts +38 -0
- package/src/routes/private-host-auth.test.ts +84 -0
- package/src/routes/private.ts +210 -0
- package/src/routes/public-default.ts +46 -0
- package/src/routes/public.test.ts +504 -0
- package/src/routes/public.ts +313 -0
- package/src/routes/run-default.ts +25 -0
- package/src/routes/run.ts +188 -0
- package/src/routes/send-default.ts +24 -0
- package/src/routes/send.ts +143 -0
- package/src/routes/wecom-default.ts +27 -0
- package/src/routes/wecom.ts +307 -0
- package/src/server.ts +13 -0
- package/src/services/embedding.test.ts +185 -0
- package/src/services/embedding.ts +138 -0
- package/src/services/kb-repository.ts +79 -0
- package/src/services/kb.ts +328 -0
- package/src/services/kbsync.ts +166 -0
- package/src/services/tool-index-repository.ts +50 -0
- package/src/services/tools-index.test.ts +756 -0
- package/src/services/tools-index.ts +427 -0
- package/tsconfig.json +17 -0
- package/web/connect/bailing-connect-php.tgz +0 -0
- package/web/connect/bailing-connect-php7.tgz +0 -0
- package/web/connect/executor.mjs +152 -0
- package/web/connect/openclaw-stdio.mjs +145 -0
- package/web/connect/skills/connect-bailinghub-executor/SKILL.md +97 -0
- package/web/connect/skills/connect-bailinghub-executor/agents/openai.yaml +4 -0
- package/web/connect/skills/connect-bailinghub-executor/references/direct-protocol.md +99 -0
- package/web/connect/skills/connect-bailinghub-executor/references/openclaw.md +39 -0
- package/web/console/assets/Accounts-B4ePH5jp.css +1 -0
- package/web/console/assets/Accounts-Dwzm4D_V.js +3 -0
- package/web/console/assets/Approvals-BxhuI0ku.js +1 -0
- package/web/console/assets/Approvals-DlTSHl_7.css +1 -0
- package/web/console/assets/Audit-CSu6_3oD.css +1 -0
- package/web/console/assets/Audit-dFAbGynl.js +1 -0
- package/web/console/assets/BrandLockup-BtZyvkM5.js +1 -0
- package/web/console/assets/BrandLockup-DKYBYzKU.css +1 -0
- package/web/console/assets/Channels-CCn0L1jg.css +1 -0
- package/web/console/assets/Channels-Dqg4-_yr.js +105 -0
- package/web/console/assets/ChatEntries-BweMx_CU.css +1 -0
- package/web/console/assets/ChatEntries-CEGZ3NnJ.js +7 -0
- package/web/console/assets/Clients-C0QD1x7g.js +3 -0
- package/web/console/assets/Clients-DcTYN-Js.css +1 -0
- package/web/console/assets/Cost-BAJqLhpK.js +1 -0
- package/web/console/assets/Cost-CjT39DSZ.css +1 -0
- package/web/console/assets/Credentials-D_GDRgWi.js +1 -0
- package/web/console/assets/Credentials-ioLP0qYN.css +1 -0
- package/web/console/assets/Diagnostics-BWYnDxRj.js +1 -0
- package/web/console/assets/Diagnostics-Ya05PTDp.css +1 -0
- package/web/console/assets/Executors-CjhEM54c.css +1 -0
- package/web/console/assets/Executors-Cmryk4Vk.js +1 -0
- package/web/console/assets/HelpTip-CA6Bm7Nx.css +1 -0
- package/web/console/assets/HelpTip-CT07o3kB.js +1 -0
- package/web/console/assets/Kb-BSXQE0Fa.js +5 -0
- package/web/console/assets/Kb-CzIzd9xr.css +1 -0
- package/web/console/assets/Login-BnBPqC8Z.js +1 -0
- package/web/console/assets/Login-xtPwDB5_.css +1 -0
- package/web/console/assets/Projects-Bm8AjsNx.css +1 -0
- package/web/console/assets/Projects-CNHx4L_7.js +1 -0
- package/web/console/assets/Routes-DWGQN5Pv.css +1 -0
- package/web/console/assets/Routes-u5cEAEXQ.js +124 -0
- package/web/console/assets/Runs-BeFUR77_.js +3 -0
- package/web/console/assets/Runs-CUtSsPW-.css +1 -0
- package/web/console/assets/Setup-BjZfrmfN.js +1 -0
- package/web/console/assets/Setup-QjlHZKdB.css +1 -0
- package/web/console/assets/Shell-CbGNTN91.css +1 -0
- package/web/console/assets/Shell-EJuYf3OO.js +1 -0
- package/web/console/assets/StorageBuckets-DMXRJxUA.js +1 -0
- package/web/console/assets/StorageBuckets-GnXnVvF0.css +1 -0
- package/web/console/assets/SystemSettings-B72F-loY.js +1 -0
- package/web/console/assets/SystemSettings-BjiHyrXO.css +1 -0
- package/web/console/assets/SystemStatus-I11I67rw.css +1 -0
- package/web/console/assets/SystemStatus-hOj_TPYE.js +1 -0
- package/web/console/assets/Targets-DTb5tn6z.css +1 -0
- package/web/console/assets/Targets-UVVf7twC.js +1 -0
- package/web/console/assets/Tools-A20oaMaQ.css +1 -0
- package/web/console/assets/Tools-ihkr9R9x.js +2 -0
- package/web/console/assets/_plugin-vue_export-helper-DlAUqK2U.js +1 -0
- package/web/console/assets/docs-DPUOCa7R.js +1 -0
- package/web/console/assets/index-DZEQL_yy.js +1 -0
- package/web/console/assets/index-DxvruykG.js +2 -0
- package/web/console/assets/index-Fi9gkGxV.css +1 -0
- package/web/console/assets/llm-catalog-HwRIrS94.js +1 -0
- package/web/console/assets/request-BisL2T9B.js +1 -0
- package/web/console/assets/schema-CzpUpoLk.js +1 -0
- package/web/console/assets/util-SiQC2MJh.js +1 -0
- package/web/console/assets/vendor-element-D7WRzHhy.js +37 -0
- package/web/console/assets/vendor-mammoth-DvgsHdlx.js +231 -0
- package/web/console/assets/vendor-turndown-kLzRgxYD.js +61 -0
- package/web/console/assets/vendor-vue-B2uhHUfE.js +29 -0
- package/web/console/index.html +16 -0
- package/web/widget/widget.js +1490 -0
- package/web-admin/index.html +13 -0
- package/web-admin/package-lock.json +1854 -0
- package/web-admin/package.json +25 -0
- package/web-admin/src/App.vue +9 -0
- package/web-admin/src/branding.ts +90 -0
- package/web-admin/src/components/BrandLockup.vue +40 -0
- package/web-admin/src/components/HelpTip.vue +51 -0
- package/web-admin/src/components/RichText.vue +35 -0
- package/web-admin/src/docs.ts +16 -0
- package/web-admin/src/layout/Shell.vue +356 -0
- package/web-admin/src/llm-catalog.ts +129 -0
- package/web-admin/src/main.ts +116 -0
- package/web-admin/src/pages/Accounts.vue +162 -0
- package/web-admin/src/pages/Approvals.vue +179 -0
- package/web-admin/src/pages/Audit.vue +110 -0
- package/web-admin/src/pages/Channels.vue +738 -0
- package/web-admin/src/pages/ChatEntries.vue +778 -0
- package/web-admin/src/pages/Clients.vue +353 -0
- package/web-admin/src/pages/Cost.vue +314 -0
- package/web-admin/src/pages/Credentials.vue +418 -0
- package/web-admin/src/pages/Diagnostics.vue +440 -0
- package/web-admin/src/pages/Executors.vue +398 -0
- package/web-admin/src/pages/Kb.vue +698 -0
- package/web-admin/src/pages/Login.vue +314 -0
- package/web-admin/src/pages/Projects.vue +106 -0
- package/web-admin/src/pages/Routes.vue +1661 -0
- package/web-admin/src/pages/Runs.vue +1113 -0
- package/web-admin/src/pages/Setup.vue +354 -0
- package/web-admin/src/pages/StorageBuckets.vue +182 -0
- package/web-admin/src/pages/SystemSettings.vue +281 -0
- package/web-admin/src/pages/SystemStatus.vue +185 -0
- package/web-admin/src/pages/Targets.vue +193 -0
- package/web-admin/src/pages/Tools.vue +1051 -0
- package/web-admin/src/request.ts +18 -0
- package/web-admin/src/router.ts +142 -0
- package/web-admin/src/runtime-path.ts +27 -0
- package/web-admin/src/schema.ts +52 -0
- package/web-admin/src/store.ts +35 -0
- package/web-admin/src/styles/base.css +272 -0
- package/web-admin/src/table-widths.ts +603 -0
- package/web-admin/src/util.ts +16 -0
- package/web-admin/tsconfig.json +15 -0
- package/web-admin/vite.config.ts +35 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# User Guide
|
|
2
|
+
|
|
3
|
+
This guide is for business owners, product managers, system administrators, implementation consultants, and operators who want to add Agent capabilities to an existing business system.
|
|
4
|
+
|
|
5
|
+
It does not replace developer documentation. Developer docs explain HTTP, signatures, SDKs, and code. This guide explains what problem each BailingHub object solves, how to translate a business goal into console configuration, and what to hand to developers after configuration.
|
|
6
|
+
|
|
7
|
+
## Who Should Read This
|
|
8
|
+
|
|
9
|
+
- You operate an existing ERP, CRM, order, service, store, or internal management system.
|
|
10
|
+
- You want an Agent to answer questions, query live business data, or initiate controlled business actions.
|
|
11
|
+
- You do not want Agent logic, model credentials, governance, and audit code duplicated across every business system.
|
|
12
|
+
- You have installed BailingHub but need a business-oriented map of the console.
|
|
13
|
+
|
|
14
|
+
## Reading Order
|
|
15
|
+
|
|
16
|
+
| Document | Question answered |
|
|
17
|
+
|---|---|
|
|
18
|
+
| [overview.en.md](overview.en.md) | Why does an existing system need an Agent control plane? |
|
|
19
|
+
| [concepts.en.md](concepts.en.md) | How do routes, callers, targets, tools, knowledge, and channels relate? |
|
|
20
|
+
| [console-map.en.md](console-map.en.md) | What does each console menu do and what does it produce? |
|
|
21
|
+
| [scenarios.en.md](scenarios.en.md) | How do I configure a concrete business scenario step by step? |
|
|
22
|
+
|
|
23
|
+
## Open-Source Edition Boundary
|
|
24
|
+
|
|
25
|
+
The open-source edition is designed for one organization: one administration domain, one audit space, and one shared set of operators. It can connect multiple business systems, callers, routes, models, targets, tool providers, and channels. If mutually untrusted organizations require hard isolation, deploy separate open-source instances.
|
|
26
|
+
|
|
27
|
+
## What You Should Be Able To Produce
|
|
28
|
+
|
|
29
|
+
After reading this guide, you should be able to define:
|
|
30
|
+
|
|
31
|
+
- where a request enters: backend event, web chat, or an inbound messaging channel;
|
|
32
|
+
- which brain handles it: a hosted model, local OpenAI-compatible model, or executor-based Agent;
|
|
33
|
+
- which business capabilities the Agent may reach across one or more tool providers;
|
|
34
|
+
- which knowledge, page context, media, and conversation memory are assembled;
|
|
35
|
+
- how results return through polling, callback, webhook, or channel delivery;
|
|
36
|
+
- which high-risk calls become durable approval intents.
|
|
37
|
+
|
|
38
|
+
You can then give developers the generated call example, caller token, tool-signing secret, widget code, ticket requirements, or callback contract.
|
|
39
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# 使用者指南
|
|
2
|
+
|
|
3
|
+
这组文档面向准备在业务系统里落地 Agent 能力的使用者:业务负责人、产品经理、系统管理员、实施顾问和负责配置中枢的人。
|
|
4
|
+
|
|
5
|
+
它不替代开发者文档。开发者文档回答“接口怎么调、签名怎么验、SDK 怎么接”;使用者指南回答“我的业务想实现某个 Agent 能力,中枢里应该先配什么、为什么这么配、配完能交给开发者什么”。
|
|
6
|
+
|
|
7
|
+
## 适合谁读
|
|
8
|
+
|
|
9
|
+
- 你有一套已经在运行的业务系统,希望让 Agent 能查数据、答问题、处理部分业务动作。
|
|
10
|
+
- 你不想把 Agent 逻辑硬写进业务系统里,希望用一个独立中枢统一治理。
|
|
11
|
+
- 你需要和开发同事沟通:哪些接口要暴露、哪些动作要审批、哪些页面要嵌聊天组件。
|
|
12
|
+
- 你已经部署好百灵中枢,但不知道后台每个菜单到底解决什么问题。
|
|
13
|
+
|
|
14
|
+
## 阅读顺序
|
|
15
|
+
|
|
16
|
+
| 文档 | 解决的问题 |
|
|
17
|
+
|---|---|
|
|
18
|
+
| [overview.md](overview.md) | 为什么需要百灵中枢,它解决传统系统接 Agent 时的哪些具体问题。 |
|
|
19
|
+
| [concepts.md](concepts.md) | 路由、接入方、工具源、调度目标、模型凭证、知识库、聊天入口之间是什么关系。 |
|
|
20
|
+
| [console-map.md](console-map.md) | 后台每个菜单是干什么的、什么时候会用、配好后能拿到什么。 |
|
|
21
|
+
| [scenarios.md](scenarios.md) | 按业务场景一步一步配置:查订单、售后助手、审批退款、网页聊天、知识库问答、本地模型等。 |
|
|
22
|
+
|
|
23
|
+
## 立场说明
|
|
24
|
+
|
|
25
|
+
本文档只描述开源版百灵中枢的能力和使用方式。
|
|
26
|
+
|
|
27
|
+
开源版是一套单组织部署的中枢:一套后台、一个管理域、一套审计空间。它可以配置多个业务系统、多个接入方、多个路由、多个工具源和多个模型,但这些配置属于同一个中枢管理者。若多个组织之间需要完全隔离,建议分别部署多套开源版中枢。
|
|
28
|
+
|
|
29
|
+
## 读完后你应该能做什么
|
|
30
|
+
|
|
31
|
+
读完这组文档,你应该可以把一个业务需求拆成下面几类配置:
|
|
32
|
+
|
|
33
|
+
- 入口是什么:业务后端触发、网页聊天入口,还是企业微信、钉钉、飞书等入站渠道。
|
|
34
|
+
- 大脑是什么:云端模型、本地模型,还是远端执行器/自研 agent。
|
|
35
|
+
- Agent 能用哪些业务能力:一个或多个工具源里声明哪些接口,路由分别放行哪些 scope。
|
|
36
|
+
- Agent 回答时需要哪些资料:知识库、页面上下文、历史对话记忆。
|
|
37
|
+
- 结果怎么回到业务侧:轮询、callback、webhook、渠道送达。
|
|
38
|
+
- 高风险动作怎么处理:业务接口自身审批,还是中枢先冻结审批意图。
|
|
39
|
+
|
|
40
|
+
当这些内容在后台配置好后,你再把对应的调用代码、接入方 token、工具源签名密钥、聊天嵌入代码或回调验签说明交给开发者即可。
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Core Concepts
|
|
2
|
+
|
|
3
|
+
```text
|
|
4
|
+
Entry
|
|
5
|
+
-> Route
|
|
6
|
+
-> Target / Agent brain
|
|
7
|
+
-> Context: memory, knowledge, page, image, audio, file
|
|
8
|
+
-> Tool providers: one or more business systems
|
|
9
|
+
-> Approval, audit, and delivery
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Route
|
|
13
|
+
|
|
14
|
+
A route represents one Agent scenario, not an API and not a model. It selects the target, model settings, session policy, knowledge, media strategy, tool sources, approval delivery, retries, budget, and final delivery.
|
|
15
|
+
|
|
16
|
+
## Caller
|
|
17
|
+
|
|
18
|
+
A caller is a business-system credential. It receives an `app_id`, token, route allowlist, and rate limit. It answers “which system may trigger which routes.” The final business user is a separate acting subject carried in trusted metadata or a verified widget ticket.
|
|
19
|
+
|
|
20
|
+
## Target
|
|
21
|
+
|
|
22
|
+
A target is the brain adapter. The built-in `llm` target calls hosted or local OpenAI-compatible model services. Executor targets let an internal Agent, script, OpenClaw, Codex, Claude Code, or another runtime claim and report work.
|
|
23
|
+
|
|
24
|
+
## Model Credential
|
|
25
|
+
|
|
26
|
+
A model credential stores the service URL, API key, default model, and purpose. Credentials may cover chat, image, audio, file, or embedding capabilities. Routes reference credentials; credentials do not define business scenarios.
|
|
27
|
+
|
|
28
|
+
## Tool Provider
|
|
29
|
+
|
|
30
|
+
A tool provider is a business system's ACC-enabled OpenAPI document plus its base URL and signing secret. It declares operation names, parameters, scope, risk, acting-subject requirements, approval conditions, and audit sensitivity.
|
|
31
|
+
|
|
32
|
+
A route may select multiple providers through `tools.sources[]`. Each source has its own scope allowlist and optional subject field. BailingHub applies identity, approval, rate limits, signatures, and audit per source, then exposes one combined tool surface to the Agent. Operation IDs must be unique within a route.
|
|
33
|
+
|
|
34
|
+
## Knowledge Base
|
|
35
|
+
|
|
36
|
+
Knowledge bases provide retrievable documents such as manuals, policies, product material, and FAQs. Live order state, stock, permissions, and state-changing actions belong in tools, not static knowledge.
|
|
37
|
+
|
|
38
|
+
## Web Chat Entry
|
|
39
|
+
|
|
40
|
+
A web chat entry binds a public widget to a route. A business backend may sign a visitor ticket so the hub can carry a trusted acting subject into business-tool calls.
|
|
41
|
+
|
|
42
|
+
## Inbound Channel
|
|
43
|
+
|
|
44
|
+
An inbound channel adapts messages from systems such as WeCom, DingTalk, or Feishu into a route. Channel credentials and reply constraints stay in the channel adapter, not the route core.
|
|
45
|
+
|
|
46
|
+
## Media Storage And Input Policy
|
|
47
|
+
|
|
48
|
+
Images, audio, and files are first stored locally or in object storage. Route input policy then decides whether the hub extracts or transcribes them, sends them to a dedicated model, or passes them directly to a capable target.
|
|
49
|
+
|
|
50
|
+
## Job And Trace
|
|
51
|
+
|
|
52
|
+
A job is one durable Agent run. The trace records route resolution, context, tools, approvals, target execution, delivery, warnings, and errors.
|
|
53
|
+
|
|
54
|
+
## Approval Intent
|
|
55
|
+
|
|
56
|
+
When a high-risk or conditionally approved tool is requested, BailingHub freezes the exact tool and argument snapshot. Approval may happen in the business system or the console fallback. Approval authorizes that snapshot only; changed arguments require a new decision.
|
|
57
|
+
|
|
58
|
+
## From Requirement To Configuration
|
|
59
|
+
|
|
60
|
+
For “let logged-in users ask about their order and create a support request,” define:
|
|
61
|
+
|
|
62
|
+
- a web entry;
|
|
63
|
+
- a support route and model target;
|
|
64
|
+
- order and ticket tool providers or sources;
|
|
65
|
+
- a verified user subject;
|
|
66
|
+
- support knowledge;
|
|
67
|
+
- the final reply or callback path;
|
|
68
|
+
- approval only for operations that require it.
|
|
69
|
+
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# 核心概念:把业务需求拆成中枢配置
|
|
2
|
+
|
|
3
|
+
这一页不讲 API 细节,只讲后台里的核心对象之间是什么关系。
|
|
4
|
+
|
|
5
|
+
## 总体关系
|
|
6
|
+
|
|
7
|
+
可以把百灵中枢理解成下面这条链路:
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
入口
|
|
11
|
+
└─ 把用户问题、业务事件或外部消息送进来
|
|
12
|
+
↓
|
|
13
|
+
触发路由
|
|
14
|
+
└─ 判断这是哪个业务场景,应该交给哪个大脑,带哪些能力
|
|
15
|
+
↓
|
|
16
|
+
调度目标
|
|
17
|
+
└─ 真正处理任务的大脑:llm、本地模型、执行器、第三方 agent
|
|
18
|
+
↓
|
|
19
|
+
上下文
|
|
20
|
+
└─ 历史对话、知识库、页面上下文、图片/语音/文件理解
|
|
21
|
+
↓
|
|
22
|
+
工具源(可多个)
|
|
23
|
+
└─ Agent 可以跨业务系统安全调用的接口清单
|
|
24
|
+
↓
|
|
25
|
+
审计与送达
|
|
26
|
+
└─ 记录发生了什么,并把结果回到业务侧或用户侧
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
后台里的菜单基本都围绕这条链路展开。
|
|
30
|
+
|
|
31
|
+
## 触发路由:一个业务场景
|
|
32
|
+
|
|
33
|
+
触发路由是中枢最核心的配置。你可以把一条路由理解成“一个 Agent 场景”。
|
|
34
|
+
|
|
35
|
+
例如:
|
|
36
|
+
|
|
37
|
+
- `after-sales-assistant`:售后助手。
|
|
38
|
+
- `order-query`:订单查询助手。
|
|
39
|
+
- `operation-analyst`:经营分析助手。
|
|
40
|
+
- `staff-knowledge`:员工制度问答。
|
|
41
|
+
- `refund-review`:退款处理助手。
|
|
42
|
+
|
|
43
|
+
一条路由通常决定这些事:
|
|
44
|
+
|
|
45
|
+
- 交给哪个调度目标处理。
|
|
46
|
+
- 使用哪个模型凭证或目标配置。
|
|
47
|
+
- 是否按某个业务字段延续会话。
|
|
48
|
+
- 是否注入知识库。
|
|
49
|
+
- 是否启用对话记忆。
|
|
50
|
+
- 是否允许调用某个工具源里的部分工具。
|
|
51
|
+
- 结果是否需要 callback 或渠道送达。
|
|
52
|
+
- 高风险动作是否需要审批。
|
|
53
|
+
- 是否有预算、限流或重试策略。
|
|
54
|
+
|
|
55
|
+
路由不是接口,也不是模型。路由是把一个业务场景的 Agent 运行规则集中起来。
|
|
56
|
+
|
|
57
|
+
## 接入方:哪个业务系统能调用哪些路由
|
|
58
|
+
|
|
59
|
+
接入方是一把给业务系统的钥匙。
|
|
60
|
+
|
|
61
|
+
一个业务系统要调用中枢,通常先在后台创建一个接入方。接入方会得到:
|
|
62
|
+
|
|
63
|
+
- `app_id`:接入方标识。
|
|
64
|
+
- `token`:业务系统调用中枢时使用的密钥。
|
|
65
|
+
- `allowed_routes`:这个业务系统允许调用哪些路由。
|
|
66
|
+
- `rate_limit_per_min`:每分钟调用限制。
|
|
67
|
+
|
|
68
|
+
接入方解决的是“谁可以触发中枢”。
|
|
69
|
+
|
|
70
|
+
它不等于最终业务用户。最终业务用户通常由业务系统在 `metadata.principal` 或 `metadata` 的主体字段里声明。例如业务系统用自己的登录态确认当前用户是 `u_1001`,再把这个主体传给中枢。
|
|
71
|
+
|
|
72
|
+
## 调度目标:任务交给谁处理
|
|
73
|
+
|
|
74
|
+
调度目标是大脑插座。路由最终会指向一个调度目标。
|
|
75
|
+
|
|
76
|
+
常见目标:
|
|
77
|
+
|
|
78
|
+
- `llm`:中枢进程内调用云端模型或 OpenAI-compatible 模型服务。
|
|
79
|
+
- 自定义 executor 目标:由你的本地机器、内网脚本、自研 agent、OpenClaw、Codex、Claude Code、国内智能体工具或第三方 agent 出站认领任务。
|
|
80
|
+
- demo-agent:开源 demo 里的确定性演示目标,用来不依赖真实模型跑通工具治理闭环。
|
|
81
|
+
|
|
82
|
+
如果你的需求只是“让 Agent 回答、查知识库、调用工具”,通常先用 `llm`。如果你有自己的本地 agent、私有环境脚本、长任务处理器,或者希望把 OpenClaw、Codex、Claude Code、国内智能体工具接到中枢里统一调度,就注册 executor 类目标。
|
|
83
|
+
|
|
84
|
+
## 模型凭证:中枢怎么调用模型
|
|
85
|
+
|
|
86
|
+
模型凭证记录模型服务地址、API key、默认模型和用途。
|
|
87
|
+
|
|
88
|
+
它可以用于:
|
|
89
|
+
|
|
90
|
+
- 对话模型:回答问题、做工具编排。
|
|
91
|
+
- 视觉模型:理解图片。
|
|
92
|
+
- 语音模型:把语音转文字,或直送支持语音的模型。
|
|
93
|
+
- 向量模型:知识库或工具检索。
|
|
94
|
+
|
|
95
|
+
模型凭证不是业务场景。业务场景在路由里配置,路由再引用对应模型能力。
|
|
96
|
+
|
|
97
|
+
## 工具源:Agent 能调用哪些业务接口
|
|
98
|
+
|
|
99
|
+
工具源是业务系统暴露给 Agent 的接口清单。
|
|
100
|
+
|
|
101
|
+
业务系统通过 OpenAPI 或 SDK 声明:
|
|
102
|
+
|
|
103
|
+
- 哪些接口允许 Agent 调用。
|
|
104
|
+
- 每个接口叫什么。
|
|
105
|
+
- 参数是什么。
|
|
106
|
+
- 这个接口是只读、低风险、中风险还是高风险。
|
|
107
|
+
- 是否需要主体。
|
|
108
|
+
- 是否需要确认或审批。
|
|
109
|
+
|
|
110
|
+
中枢注册工具源后,不会自动把所有工具都交给 Agent。还需要在路由的 `tools.sources[]` 中选择一个或多个来源,并分别配置 `allow`,只放行当前场景需要的 scope。不同来源的 `operationId` 必须在同一路由内保持唯一,避免调用被路由到错误系统。
|
|
111
|
+
|
|
112
|
+
工具源解决的是“业务能力如何被 Agent 安全触达”。
|
|
113
|
+
|
|
114
|
+
## 知识库:Agent 回答时能参考哪些资料
|
|
115
|
+
|
|
116
|
+
知识库用于把文档、制度、帮助中心、产品说明、FAQ 等内容变成可检索资料。
|
|
117
|
+
|
|
118
|
+
知识库不会自动影响所有路由。只有路由里配置了知识库,任务执行时才会检索并注入相关片段。
|
|
119
|
+
|
|
120
|
+
适合放进知识库的内容:
|
|
121
|
+
|
|
122
|
+
- 使用手册。
|
|
123
|
+
- 售后政策。
|
|
124
|
+
- 员工制度。
|
|
125
|
+
- 产品说明。
|
|
126
|
+
- FAQ。
|
|
127
|
+
- 内部流程文档。
|
|
128
|
+
|
|
129
|
+
不适合只靠知识库解决的内容:
|
|
130
|
+
|
|
131
|
+
- 实时订单状态。
|
|
132
|
+
- 当前库存。
|
|
133
|
+
- 用户权限。
|
|
134
|
+
- 需要写入或变更业务状态的操作。
|
|
135
|
+
|
|
136
|
+
这些应该走工具源。
|
|
137
|
+
|
|
138
|
+
## 聊天入口:把路由嵌到网页里
|
|
139
|
+
|
|
140
|
+
聊天入口是一个公开的网页组件入口。它绑定一条路由,然后给你一段 `<script>` 嵌入代码。
|
|
141
|
+
|
|
142
|
+
适合:
|
|
143
|
+
|
|
144
|
+
- 官网客服。
|
|
145
|
+
- 业务后台里的 Agent 助手。
|
|
146
|
+
- H5 页面里的问答入口。
|
|
147
|
+
- 某个功能页的上下文助手。
|
|
148
|
+
|
|
149
|
+
聊天入口解决的是“用户从网页上怎么和这条路由对话”。
|
|
150
|
+
|
|
151
|
+
如果需要让登录用户带可信身份,业务后端应签发访客票据,组件带票进入中枢。中枢只验证票据,真正的权限仍由业务系统在工具接口里裁决。
|
|
152
|
+
|
|
153
|
+
## 入站渠道:让外部平台消息进中枢
|
|
154
|
+
|
|
155
|
+
入站渠道用于接企业微信、钉钉、飞书等外部平台消息。渠道配置绑定一条路由,外部消息进来后就按这条路由处理。
|
|
156
|
+
|
|
157
|
+
它和聊天入口的区别:
|
|
158
|
+
|
|
159
|
+
- 聊天入口面向网页组件。
|
|
160
|
+
- 入站渠道面向外部消息平台。
|
|
161
|
+
|
|
162
|
+
## 媒体存储:图片、语音、文件先放哪里
|
|
163
|
+
|
|
164
|
+
当用户通过聊天入口或渠道发送图片、语音、文件时,中枢需要先保存这些素材,再根据路由策略决定怎么处理。
|
|
165
|
+
|
|
166
|
+
默认可以使用服务器本地存储。生产环境如果需要 CDN、多副本共享、生命周期管理或已有对象存储,可以在后台配置媒体存储桶。
|
|
167
|
+
|
|
168
|
+
媒体存储只负责“素材落地和形成 URL”。具体是识别图片、转写语音、抽取文件文字,还是直送给多模态模型,由路由的输入策略决定。
|
|
169
|
+
|
|
170
|
+
## 任务:一次 Agent 运行记录
|
|
171
|
+
|
|
172
|
+
每次业务系统调用 `/run`、用户在聊天入口提问、外部渠道收到消息,都会形成一个任务。
|
|
173
|
+
|
|
174
|
+
任务里可以看到:
|
|
175
|
+
|
|
176
|
+
- 输入内容。
|
|
177
|
+
- 命中的路由。
|
|
178
|
+
- 调度目标。
|
|
179
|
+
- 会话信息。
|
|
180
|
+
- 工具调用。
|
|
181
|
+
- 知识引用。
|
|
182
|
+
- 审批意图。
|
|
183
|
+
- 最终输出。
|
|
184
|
+
- 错误信息。
|
|
185
|
+
|
|
186
|
+
任务是排查问题的第一入口。
|
|
187
|
+
|
|
188
|
+
## 审批意图:Agent 想做高风险动作时先冻结
|
|
189
|
+
|
|
190
|
+
如果工具声明为高风险,或配置了确认条件,中枢不会直接外发调用,而是生成审批意图。
|
|
191
|
+
|
|
192
|
+
审批意图包含:
|
|
193
|
+
|
|
194
|
+
- Agent 想调用哪个工具。
|
|
195
|
+
- 参数快照是什么。
|
|
196
|
+
- 替哪个主体操作。
|
|
197
|
+
- 风险和原因。
|
|
198
|
+
- 审批通过后只能执行这一份参数快照。
|
|
199
|
+
|
|
200
|
+
中枢可以记录审批意图,但业务侧通常更适合承接真正的审批流程。比如退款审批应该回到订单系统或财务系统里,由原有主管审批链处理。
|
|
201
|
+
|
|
202
|
+
## 变更审计和执行轨迹:为什么这样回答
|
|
203
|
+
|
|
204
|
+
中枢有两类记录:
|
|
205
|
+
|
|
206
|
+
- 变更审计:谁改了配置、工具源、路由、凭证等。
|
|
207
|
+
- 执行轨迹:某次任务运行时发生了什么。
|
|
208
|
+
|
|
209
|
+
前者解决“后台配置为什么变了”,后者解决“这次 Agent 为什么这样做”。
|
|
210
|
+
|
|
211
|
+
## 一个需求如何拆成配置
|
|
212
|
+
|
|
213
|
+
如果你的需求是“让门店后台有一个售后 Agent 助手”,可以拆成:
|
|
214
|
+
|
|
215
|
+
- 入口:网页聊天入口,嵌入门店后台。
|
|
216
|
+
- 路由:售后助手路由。
|
|
217
|
+
- 调度目标:`llm`。
|
|
218
|
+
- 模型凭证:选择一个对话模型。
|
|
219
|
+
- 知识库:售后政策、退款规则、商品说明。
|
|
220
|
+
- 工具源:查订单、创建售后工单、申请退款。
|
|
221
|
+
- 接入方:门店后台服务端,用来签发访客票据或触发 `/run`。
|
|
222
|
+
- 审批:退款申请或高金额退款进入业务审批。
|
|
223
|
+
- 任务:上线后用任务页观察回答和工具调用。
|
|
224
|
+
|
|
225
|
+
这就是中枢的基本使用方法:先把业务需求拆成入口、路由、大脑、知识、工具、身份、送达和审计,再分别配置。
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Console Map
|
|
2
|
+
|
|
3
|
+
## Jobs
|
|
4
|
+
|
|
5
|
+
Use Jobs as the normal operational home page. It shows conversations, runs, trace events, tool calls, approvals, model usage, errors, and delivery. It produces evidence for quality review and incident diagnosis.
|
|
6
|
+
|
|
7
|
+
## Routes
|
|
8
|
+
|
|
9
|
+
Routes define Agent scenarios. Configure target, model, context, one or more tool providers, global tool-call budget, approval delivery, retry, memory, audience, budget, and result delivery. The route row produces a stable `route_key` and generated call examples.
|
|
10
|
+
|
|
11
|
+
## Callers
|
|
12
|
+
|
|
13
|
+
Callers define which business systems may invoke which routes. Saving a caller produces an `app_id` and token. Keep tokens in backend secret storage, never in browser code.
|
|
14
|
+
|
|
15
|
+
## Targets
|
|
16
|
+
|
|
17
|
+
Targets register in-hub or executor-based brains. Most users configure these infrequently. Executor targets additionally require an executor token and a running worker.
|
|
18
|
+
|
|
19
|
+
## Model Credentials
|
|
20
|
+
|
|
21
|
+
Register model endpoints and API keys by purpose, then use Validate before assigning them to routes or knowledge bases. Model secrets stay in the hub.
|
|
22
|
+
|
|
23
|
+
## Tool Providers
|
|
24
|
+
|
|
25
|
+
Register an ACC-enabled OpenAPI JSON or YAML document, business API base URL, and signing secret. Inspect compiled tools, diagnostics, authorization probe, and semantic retrieval settings. Routes choose one or more providers and scope allowlists.
|
|
26
|
+
|
|
27
|
+
## Knowledge Bases
|
|
28
|
+
|
|
29
|
+
Create a base, select an embedding credential, ingest documents or data sources, and verify retrieval. Routes explicitly opt into one or more knowledge bases.
|
|
30
|
+
|
|
31
|
+
## Web Chat Entries
|
|
32
|
+
|
|
33
|
+
Bind a widget to a route, configure origins, appearance, welcome text, identity ticket behavior, AI disclosure, and embed code.
|
|
34
|
+
|
|
35
|
+
## Inbound Channels
|
|
36
|
+
|
|
37
|
+
Connect external messaging platforms and bind each channel to a route. Channel adapters own platform credentials and inbound/outbound message behavior.
|
|
38
|
+
|
|
39
|
+
## Media Storage
|
|
40
|
+
|
|
41
|
+
Use local storage for simple single-instance deployments. Configure object storage for multi-replica sharing, CDN delivery, lifecycle policy, or existing storage governance.
|
|
42
|
+
|
|
43
|
+
## Cost Observability
|
|
44
|
+
|
|
45
|
+
Review model tokens, estimated cost, route trends, and budget enforcement. Cost data supports optimization; it does not replace provider billing statements.
|
|
46
|
+
|
|
47
|
+
## Diagnostics
|
|
48
|
+
|
|
49
|
+
Use Diagnostics to identify invalid references, disabled dependencies, route-auto conflicts, expired leases, executor coverage, and delivery dead letters.
|
|
50
|
+
|
|
51
|
+
## System Status
|
|
52
|
+
|
|
53
|
+
Review build version, contract versions, migration state, runtime backend, and configuration health. Production readiness is also available at `/health/ready`.
|
|
54
|
+
|
|
55
|
+
## Accounts And Change Audit
|
|
56
|
+
|
|
57
|
+
Accounts control console RBAC. Change Audit records who changed configuration and when. These are administrative controls for the single organization operating the open-source instance.
|
|
58
|
+
|