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
package/docs/DEMO.en.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Docker Demo
|
|
2
|
+
|
|
3
|
+
The Docker demo is the fastest way to understand BailingHub end to end.
|
|
4
|
+
|
|
5
|
+
It starts:
|
|
6
|
+
|
|
7
|
+
- `bailinghub`: the hub service and console
|
|
8
|
+
- `mysql`: hub state database
|
|
9
|
+
- `bailing-demo-business`: a demo business system
|
|
10
|
+
- a demo route
|
|
11
|
+
- a demo integration client
|
|
12
|
+
- a demo OpenAPI tool provider
|
|
13
|
+
- audit and trace data
|
|
14
|
+
|
|
15
|
+
## Start
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
export BAILING_TOKEN="${BAILING_TOKEN:-$(openssl rand -hex 32)}"
|
|
19
|
+
docker compose up --build
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Keep the same `BAILING_TOKEN` for subsequent Compose commands, or save it in a local `.env` file. The one-line installer generates a random value automatically.
|
|
23
|
+
|
|
24
|
+
Open:
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
http://localhost:18900/console/
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Login:
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
admin / bailing-demo-admin
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Smoke Test
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
docker compose exec bailinghub npm run smoke
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
This checks health, console endpoints, schema loading, route readiness, and demo runtime paths.
|
|
43
|
+
|
|
44
|
+
## End-to-End Demo
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
docker compose exec bailinghub npm run demo:e2e
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The demo flow covers:
|
|
51
|
+
|
|
52
|
+
1. a business request entering the hub
|
|
53
|
+
2. route selection
|
|
54
|
+
3. context assembly
|
|
55
|
+
4. model/tool execution
|
|
56
|
+
5. signed business tool call
|
|
57
|
+
6. trace and audit records
|
|
58
|
+
7. job result inspection
|
|
59
|
+
|
|
60
|
+
## Demo Tool Provider
|
|
61
|
+
|
|
62
|
+
The demo business app exposes:
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
/.well-known/bailing/tools.json
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The hub imports this OpenAPI spec and compiles selected operations into governed tools.
|
|
69
|
+
|
|
70
|
+
The key point is not the demo business domain. The important contract is:
|
|
71
|
+
|
|
72
|
+
```text
|
|
73
|
+
business API -> OpenAPI/SDK tool spec -> hub governance -> signed tool call -> business authorization
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Production Difference
|
|
77
|
+
|
|
78
|
+
The demo is intentionally simple. Before production:
|
|
79
|
+
|
|
80
|
+
- set `BAILING_ENV=production`
|
|
81
|
+
- move all secrets to environment variables or a secret manager
|
|
82
|
+
- use MySQL
|
|
83
|
+
- create a real admin account
|
|
84
|
+
- create a real integration client
|
|
85
|
+
- configure real model credentials
|
|
86
|
+
- expose only selected business tools
|
|
87
|
+
- verify every tool call signature
|
|
88
|
+
- check your own business permission table after signature verification
|
|
89
|
+
|
|
90
|
+
See [QUICKSTART.en.md](QUICKSTART.en.md) for the full setup path.
|
package/docs/DEMO.md
ADDED
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
# Docker Demo:20 分钟跑通 Agent 调业务工具闭环
|
|
2
|
+
|
|
3
|
+
这个 demo 面向第一次拿到项目的开发者:不需要真实大模型 key,也不需要已有业务系统。
|
|
4
|
+
|
|
5
|
+
它会启动三件东西:
|
|
6
|
+
|
|
7
|
+
- `bailinghub`:中枢服务与控制台;
|
|
8
|
+
- `mysql`:中枢状态库;
|
|
9
|
+
- `demo-business`:一个极小业务系统,暴露订单、工单、退款审批、故障排障四类 Agent 工具。
|
|
10
|
+
|
|
11
|
+
## 启动
|
|
12
|
+
|
|
13
|
+
推荐先用透明的 Docker Compose 方式启动,便于你看清楚每个容器和配置项:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
export BAILING_TOKEN="${BAILING_TOKEN:-$(openssl rand -hex 32)}"
|
|
17
|
+
docker compose up --build
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
后续 Compose 命令请沿用同一个 `BAILING_TOKEN`,或把它保存到本机 `.env`。一键安装脚本会自动生成随机值。
|
|
21
|
+
|
|
22
|
+
如果是在一台全新的 Ubuntu/Debian 服务器上快速体验,也可以使用一键安装脚本。脚本会安装 Docker、下载官网提供的开源分发包、生成 `.env`、启动 demo,并打印后台账号密码:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
curl -fsSL https://www.bailinghub.com/install.sh | sh
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
一键安装默认使用官方预构建镜像,减少首次构建和依赖安装耗时。镜像拉取受网络影响时,可以显式切到源码构建:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
curl -fsSL https://www.bailinghub.com/install.sh | env BAILING_INSTALL_MODE=source sh
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
镜像模式会使用:
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
crpi-xm97pbcjrmf5in3s.cn-shanghai.personal.cr.aliyuncs.com/bailinghub/bailinghub:<version>
|
|
38
|
+
crpi-xm97pbcjrmf5in3s.cn-shanghai.personal.cr.aliyuncs.com/bailinghub/bailing-demo-business:<version>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
如果你使用自己的镜像仓库:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
curl -fsSL https://www.bailinghub.com/install.sh | env \
|
|
45
|
+
BAILING_INSTALL_MODE=image \
|
|
46
|
+
BAILINGHUB_IMAGE=<registry>/<namespace>/bailinghub:<tag> \
|
|
47
|
+
BAILING_DEMO_BUSINESS_IMAGE=<registry>/<namespace>/bailing-demo-business:<tag> \
|
|
48
|
+
sh
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
如果已经发布到 GitHub,或你想从自己的 fork 安装,可以显式指定仓库地址、分支或安装目录:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
curl -fsSL https://www.bailinghub.com/install.sh | env \
|
|
55
|
+
BAILING_REPO=https://github.com/bailinghub/bailinghub.git \
|
|
56
|
+
BAILING_REF=main \
|
|
57
|
+
BAILING_INSTALL_DIR=$HOME/bailinghub \
|
|
58
|
+
sh
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
启动后访问:
|
|
62
|
+
|
|
63
|
+
- 中枢健康检查:http://localhost:18900/health
|
|
64
|
+
- 控制台:http://localhost:18900/console/
|
|
65
|
+
- demo 业务系统:http://localhost:19080/
|
|
66
|
+
- demo 业务工具源:http://localhost:19080/.well-known/bailing/tools.json
|
|
67
|
+
|
|
68
|
+
默认控制台账号:
|
|
69
|
+
|
|
70
|
+
- 用户名:`admin`
|
|
71
|
+
- 密码:`bailing-demo-admin`
|
|
72
|
+
|
|
73
|
+
如果使用一键安装脚本,密码会写入安装目录下的 `.env`,同时在安装完成时打印;脚本不会覆盖已有 `.env`。
|
|
74
|
+
|
|
75
|
+
默认 demo 接入方:
|
|
76
|
+
|
|
77
|
+
- `app_id`:`demo-app`
|
|
78
|
+
- token:`bailing-demo-client-token`
|
|
79
|
+
- 可调用路由:`demo_support`
|
|
80
|
+
|
|
81
|
+
## 触发一条任务
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
curl -sS http://localhost:18900/run \
|
|
85
|
+
-H 'content-type: application/json' \
|
|
86
|
+
-H 'authorization: Bearer bailing-demo-client-token' \
|
|
87
|
+
-d '{
|
|
88
|
+
"request_id": "demo-001",
|
|
89
|
+
"route": "demo_support",
|
|
90
|
+
"source": "quickstart",
|
|
91
|
+
"input": "帮我查一下订单 SO-1001 的状态,并创建一个售后工单说明需要人工跟进",
|
|
92
|
+
"metadata": {
|
|
93
|
+
"visitor_uid": "visitor-001",
|
|
94
|
+
"operator_uid": "demo-user-001"
|
|
95
|
+
}
|
|
96
|
+
}'
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
返回里会有 `job_id`。稍等一两秒后查看结果:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
curl -sS "http://localhost:18900/jobs/<job_id>?token=bailing-demo-client-token"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
你会看到:
|
|
106
|
+
|
|
107
|
+
- 中枢通过 `demo_support` 路由派发任务;
|
|
108
|
+
- `demo-agent` 调用 `list_demo_orders` 查询订单;
|
|
109
|
+
- 用户要求工单时,继续调用 `create_demo_ticket`;
|
|
110
|
+
- demo 业务系统验证 `sha256=` 签名与 `X-Bailing-On-Behalf-Of`;
|
|
111
|
+
- 任务审计里留下 `tool_call` / `tool_result`。
|
|
112
|
+
|
|
113
|
+
也可以打开 http://localhost:19080/ 查看 demo 业务系统里的订单、工单、退款申请和业务侧审批意图。
|
|
114
|
+
|
|
115
|
+
## 为什么不用真实 LLM
|
|
116
|
+
|
|
117
|
+
开源第一体验不应该卡在模型 key、模型兼容性或网络额度上。`demo-agent` 是一个确定性的 inhub target:它不调用外部 LLM,但完整消费中枢的工具运行时,所以白名单、主体、签名、限流、审计、审批车道这些治理路径都是真实路径。
|
|
118
|
+
|
|
119
|
+
生产接入时,把路由 target 从 `demo-agent` 换成 `llm`,配置模型凭证即可。
|
|
120
|
+
|
|
121
|
+
## demo 工具
|
|
122
|
+
|
|
123
|
+
`demo-business` 暴露的 OpenAPI 工具:
|
|
124
|
+
|
|
125
|
+
- `list_demo_orders`:只读,`scope=demo.order.read`,需要主体;
|
|
126
|
+
- `create_demo_ticket`:中风险写操作,`scope=demo.ticket.create`,需要主体;
|
|
127
|
+
- `request_demo_refund`:高风险写操作,`scope=demo.refund.request`,需要审批。
|
|
128
|
+
- `demo_failure_probe`:故障排障示例,固定返回业务侧 5xx,用来观察 trace 如何记录失败。
|
|
129
|
+
|
|
130
|
+
中枢 seed 的路由工具配置:
|
|
131
|
+
|
|
132
|
+
```json
|
|
133
|
+
{
|
|
134
|
+
"sources": [{
|
|
135
|
+
"provider": "demo-business",
|
|
136
|
+
"allow": ["demo.order.*", "demo.ticket.*", "demo.refund.*", "demo.failure.*"],
|
|
137
|
+
"subject_field": "operator_uid"
|
|
138
|
+
}],
|
|
139
|
+
"max_calls": 5,
|
|
140
|
+
"approval": {
|
|
141
|
+
"type": "business_webhook",
|
|
142
|
+
"url": "http://demo-business:19080/approvals"
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
这就是业务系统接入中枢的最小形态:业务提供工具声明和验签授权,中枢负责工具治理和调用出口;需要人工判断的高风险动作,以审批意图 webhook 回到业务系统,由业务侧自己的审批人和界面处理。
|
|
148
|
+
|
|
149
|
+
## 高风险审批演示
|
|
150
|
+
|
|
151
|
+
发起退款诉求:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
curl -sS http://localhost:18900/run \
|
|
155
|
+
-H 'content-type: application/json' \
|
|
156
|
+
-H 'authorization: Bearer bailing-demo-client-token' \
|
|
157
|
+
-d '{
|
|
158
|
+
"request_id": "demo-refund-001",
|
|
159
|
+
"route": "demo_support",
|
|
160
|
+
"source": "quickstart",
|
|
161
|
+
"input": "帮 SO-1001 申请退款 199 元",
|
|
162
|
+
"metadata": {
|
|
163
|
+
"visitor_uid": "visitor-001",
|
|
164
|
+
"operator_uid": "demo-user-001"
|
|
165
|
+
}
|
|
166
|
+
}'
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
中枢会创建工具审批单,并把审批意图签名推送到 `demo-business /approvals`。打开 http://localhost:19080/ 可以看到业务侧收到的审批意图,直接点击“批准”或“拒绝”即可由 demo 业务系统回调中枢 `/approvals/{approval_id}/decision`。
|
|
170
|
+
|
|
171
|
+
## 故障排障演示
|
|
172
|
+
|
|
173
|
+
发起故障诉求:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
curl -sS http://localhost:18900/run \
|
|
177
|
+
-H 'content-type: application/json' \
|
|
178
|
+
-H 'authorization: Bearer bailing-demo-client-token' \
|
|
179
|
+
-d '{
|
|
180
|
+
"request_id": "demo-failure-001",
|
|
181
|
+
"route": "demo_support",
|
|
182
|
+
"source": "quickstart",
|
|
183
|
+
"input": "演示一次业务工具失败排障",
|
|
184
|
+
"metadata": {
|
|
185
|
+
"visitor_uid": "visitor-001",
|
|
186
|
+
"operator_uid": "demo-user-001"
|
|
187
|
+
}
|
|
188
|
+
}'
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
`demo_failure_probe` 会固定返回 500。控制台「任务」里可以查看该 job 的 trace,确认请求、响应、错误正文和排障包脱敏结果。
|
|
192
|
+
|
|
193
|
+
## Docker 拉取排障
|
|
194
|
+
|
|
195
|
+
如果新服务器执行源码构建时卡在 `node:22-bookworm-slim` 拉取,优先判断为 Docker Hub 网络问题,不是项目初始化失败。
|
|
196
|
+
|
|
197
|
+
一键安装默认使用 `BAILING_INSTALL_MODE=image`:中枢主服务、demo 业务系统和 MySQL 都会从官方镜像仓库拉取,不再依赖 Docker Hub。
|
|
198
|
+
|
|
199
|
+
方式一:给 Docker 配置当前环境可用的 registry mirror,然后重试:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
sudo mkdir -p /etc/docker
|
|
203
|
+
sudo tee /etc/docker/daemon.json >/dev/null <<'JSON'
|
|
204
|
+
{
|
|
205
|
+
"registry-mirrors": [
|
|
206
|
+
"https://mirror.ccs.tencentyun.com"
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
JSON
|
|
210
|
+
sudo systemctl restart docker
|
|
211
|
+
docker compose up -d --build
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
镜像源是否可用取决于服务器网络和云厂商环境;如果该地址不可用,请替换为所在环境可访问的镜像源。
|
|
215
|
+
|
|
216
|
+
如需源码构建,可显式指定可访问的 Node 基础镜像:
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
curl -fsSL https://www.bailinghub.com/install.sh | env \
|
|
220
|
+
BAILING_INSTALL_MODE=source \
|
|
221
|
+
BAILING_NODE_IMAGE=<registry>/library/node:22-bookworm-slim \
|
|
222
|
+
sh
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
如企业环境需要使用内部 MySQL 镜像源,可额外设置 `BAILING_MYSQL_IMAGE=<registry>/library/mysql:8.4` 覆盖。
|
|
226
|
+
|
|
227
|
+
## 发布官方镜像
|
|
228
|
+
|
|
229
|
+
维护者可用以下命令构建官方镜像:
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
npm run images:build
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
推送前先登录阿里云镜像仓库:
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
docker login --username=<aliyun-account> crpi-xm97pbcjrmf5in3s.cn-shanghai.personal.cr.aliyuncs.com
|
|
239
|
+
npm run images:publish
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
默认会发布:
|
|
243
|
+
|
|
244
|
+
```text
|
|
245
|
+
crpi-xm97pbcjrmf5in3s.cn-shanghai.personal.cr.aliyuncs.com/bailinghub/bailinghub:<package version>
|
|
246
|
+
crpi-xm97pbcjrmf5in3s.cn-shanghai.personal.cr.aliyuncs.com/bailinghub/bailinghub:latest
|
|
247
|
+
crpi-xm97pbcjrmf5in3s.cn-shanghai.personal.cr.aliyuncs.com/bailinghub/bailing-demo-business:<package version>
|
|
248
|
+
crpi-xm97pbcjrmf5in3s.cn-shanghai.personal.cr.aliyuncs.com/bailinghub/bailing-demo-business:latest
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
MySQL 基础镜像单独同步,默认只发布版本化标签:
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
npm run images:publish-mysql
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
默认发布:
|
|
258
|
+
|
|
259
|
+
```text
|
|
260
|
+
crpi-xm97pbcjrmf5in3s.cn-shanghai.personal.cr.aliyuncs.com/bailinghub/bailing-mysql:8.4
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
可用 `BAILING_IMAGE_REGISTRY`、`BAILING_IMAGE_NAMESPACE`、`BAILING_IMAGE_TAG` 覆盖 registry、namespace 和 tag。
|
|
264
|
+
|
|
265
|
+
## 一键验证闭环
|
|
266
|
+
|
|
267
|
+
进入中枢容器运行:
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
docker compose exec bailinghub npm run smoke
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
demo 环境会自动使用 `demo-app` 和 `demo_support`,检查:
|
|
274
|
+
|
|
275
|
+
- `/health`、控制台入口和公开 schema;
|
|
276
|
+
- 后台版本、系统体检、`route=auto` 预演;
|
|
277
|
+
- `/run` 创建 demo 任务并等待终态;
|
|
278
|
+
- 按 `request_id` 追溯 `debug_bundle`;
|
|
279
|
+
- 确认导出的排障包默认声明并执行脱敏。
|
|
280
|
+
|
|
281
|
+
控制台也可以在「系统体检」点击「运行 smoke」,结果会以检查项面板展示;如果 smoke 创建了任务,可直接跳到「任务 → 追溯」查看该任务的时间线和脱敏排障包。
|
|
282
|
+
|
|
283
|
+
## 真实 demo 端到端自测
|
|
284
|
+
|
|
285
|
+
完整验证 demo 业务闭环:
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
docker compose exec bailinghub npm run demo:e2e
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
它会依次验证:
|
|
292
|
+
|
|
293
|
+
- 查单 + 建工单;
|
|
294
|
+
- 高风险退款工具生成业务侧审批意图;
|
|
295
|
+
- demo 业务系统回调中枢批准;
|
|
296
|
+
- 审批批准后在业务系统生成退款申请;
|
|
297
|
+
- 故障工具返回 5xx 后任务仍可追踪。
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Community Derivatives And Ecosystem Collaboration
|
|
2
|
+
|
|
3
|
+
BailingHub welcomes independent distributions, industry adaptations, executors, channel adapters, and other integrations built on the open-source core. We also welcome independent ACC implementations that do not use BailingHub code.
|
|
4
|
+
|
|
5
|
+
A community project does not need to become part of BailingHub, and it is not required to contribute every modification upstream. Independent names, product directions, maintainer teams, and governance models are respected. When an improvement is broadly useful, we welcome an Issue, Discussion, or Pull Request to improve the upstream project together.
|
|
6
|
+
|
|
7
|
+
## Ways To Participate
|
|
8
|
+
|
|
9
|
+
| Path | Suitable work |
|
|
10
|
+
|---|---|
|
|
11
|
+
| Upstream contribution | Bug fixes, contract improvements, documentation, tests, and reusable capabilities that benefit all users. |
|
|
12
|
+
| Community distribution | An independently maintained BailingHub derivative for a particular industry, deployment environment, or user experience. |
|
|
13
|
+
| Ecosystem component | Model, executor, channel, storage, business-system connector, SDK, or deployment-panel integration. |
|
|
14
|
+
| Independent ACC implementation | A runtime or tool that implements ACC without depending on BailingHub code. |
|
|
15
|
+
|
|
16
|
+
## Official Listing Principles
|
|
17
|
+
|
|
18
|
+
Once qualifying community projects exist, BailingHub will create a public ecosystem page that makes strong independent work easier to discover. A project requesting a listing should:
|
|
19
|
+
|
|
20
|
+
- provide a publicly accessible project, documentation, or product page;
|
|
21
|
+
- identify its maintainers, independent status, and relationship to BailingHub or ACC;
|
|
22
|
+
- comply with the licenses, NOTICE files, and attribution requirements of the code and dependencies it uses;
|
|
23
|
+
- state the compatible BailingHub or ACC versions, major differences, and intended use cases;
|
|
24
|
+
- contain meaningful maintained work rather than only replaced names, logos, or screenshots;
|
|
25
|
+
- avoid implying official BailingHub security certification, service warranty, or maintenance responsibility.
|
|
26
|
+
|
|
27
|
+
An official listing means that an independent project is useful for the community to discover. It is not certification, a quality warranty, official endorsement, or a security audit. Each maintainer remains responsible for their own distribution, service, and users.
|
|
28
|
+
|
|
29
|
+
## Names And Origin
|
|
30
|
+
|
|
31
|
+
Community distributions should use their own names and visual identities. Truthful statements such as "based on BailingHub", "compatible with BailingHub", or "implements ACC" are welcome, but a project must not imply that it is an official BailingHub distribution or that it has received certification or endorsement that was not explicitly granted.
|
|
32
|
+
|
|
33
|
+
The [LICENSE](../LICENSE) and [NOTICE](../NOTICE) files govern code use and redistribution. Apache License 2.0 does not automatically grant rights to project names or marks.
|
|
34
|
+
|
|
35
|
+
## The Relationship We Want
|
|
36
|
+
|
|
37
|
+
We do not treat community derivatives as competition that must be prevented. Independent projects can explore different industries, delivery models, and product directions. Reusable capabilities can flow upstream, while specialized capabilities can remain independently maintained. BailingHub is willing to list strong implementations, maintain compatibility discussions, and collaborate on documentation, adapters, and releases when both sides agree.
|
|
38
|
+
|
|
39
|
+
For now, introduce your project or collaboration proposal through a [Feature request](https://github.com/bailinghub/bailinghub/issues/new?template=feature_request.yml). A dedicated ecosystem listing and submission path will be established when the first qualifying community project appears.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# 社区衍生与生态合作
|
|
2
|
+
|
|
3
|
+
百灵中枢欢迎开发者基于开源核心创建独立发行版、行业适配、执行器、渠道适配器和其他集成,也欢迎不使用百灵中枢代码、但遵循 ACC 的独立实现。
|
|
4
|
+
|
|
5
|
+
社区项目不需要成为百灵中枢的一部分,也不需要把所有修改贡献回上游。我们尊重独立名称、产品方向、维护团队和治理方式。对具备通用价值的改进,我们欢迎通过 Issue、Discussion 或 Pull Request 一起完善上游。
|
|
6
|
+
|
|
7
|
+
## 可以如何参与
|
|
8
|
+
|
|
9
|
+
| 方式 | 适合的项目 |
|
|
10
|
+
|---|---|
|
|
11
|
+
| 上游贡献 | 对所有用户都有价值的缺陷修复、契约完善、文档、测试和通用能力。 |
|
|
12
|
+
| 社区发行版 | 面向特定行业、部署环境或用户体验的独立 BailingHub 衍生版本。 |
|
|
13
|
+
| 生态组件 | 模型、执行器、渠道、存储、业务系统连接器、SDK 和部署面板适配。 |
|
|
14
|
+
| ACC 独立实现 | 不依赖 BailingHub 代码、独立实现 ACC 契约的运行时或工具。 |
|
|
15
|
+
|
|
16
|
+
## 官方展示原则
|
|
17
|
+
|
|
18
|
+
当出现符合条件的社区项目后,百灵中枢会建立公开生态页面,为优秀的独立项目提供可发现入口。申请展示的项目应当:
|
|
19
|
+
|
|
20
|
+
- 提供公开可访问的项目、文档或产品页面;
|
|
21
|
+
- 清楚说明维护者、独立身份以及与 BailingHub 或 ACC 的关系;
|
|
22
|
+
- 遵守所使用代码和依赖的许可证、NOTICE 与归属要求;
|
|
23
|
+
- 说明兼容的 BailingHub 或 ACC 版本,以及主要差异和适用场景;
|
|
24
|
+
- 具备真实维护内容,不是只替换名称、Logo 或截图的重复发布;
|
|
25
|
+
- 不暗示百灵中枢官方提供安全认证、服务担保或维护责任。
|
|
26
|
+
|
|
27
|
+
官方展示意味着“这是值得社区发现的独立项目”,不等于官方认证、质量担保、官方背书或安全审计。项目维护者始终对自己的发行版、服务和用户负责。
|
|
28
|
+
|
|
29
|
+
## 名称与来源
|
|
30
|
+
|
|
31
|
+
社区发行版应使用自己的名称和视觉标识。可以如实说明“基于 BailingHub”“兼容 BailingHub”或“实现 ACC”,但不得让用户误以为它是百灵中枢官方发行版,或已经获得未经明确授予的官方认证和背书。
|
|
32
|
+
|
|
33
|
+
具体代码使用和再分发条件以 [LICENSE](../LICENSE) 与 [NOTICE](../NOTICE) 为准。名称和标识不因 Apache License 2.0 自动获得授权。
|
|
34
|
+
|
|
35
|
+
## 我们希望形成的关系
|
|
36
|
+
|
|
37
|
+
我们不把社区衍生视为需要阻止的竞争。优秀的独立项目可以探索不同的行业、交付方式和产品方向;通用能力可以回到上游,独立能力可以继续由社区维护。百灵中枢愿意公开优秀实现、保持兼容对话,并在双方认可时开展文档、适配和发布协作。
|
|
38
|
+
|
|
39
|
+
当前可通过 [Feature request](https://github.com/bailinghub/bailinghub/issues/new?template=feature_request.yml) 介绍你的项目或合作设想。首个符合条件的社区项目出现后,我们会建立正式的生态展示与提交入口。
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# Independent Validation Task
|
|
2
|
+
|
|
3
|
+
This task answers one narrow question: **can a developer who is new to BailingHub independently deploy and verify a governed business-operation loop using only public documentation?**
|
|
4
|
+
|
|
5
|
+
It is not certification, a benchmark, or evidence of production adoption. Passing means that the public installation path and demo governance loop were independently reproducible. It does not mean that the validator connected BailingHub to a real business system.
|
|
6
|
+
|
|
7
|
+
## Scope
|
|
8
|
+
|
|
9
|
+
- Target: the open-source BailingHub Docker demo;
|
|
10
|
+
- Stable baseline: `v0.3.0`;
|
|
11
|
+
- Data: the bundled demo orders, tickets, refunds, and failure probe;
|
|
12
|
+
- Expected time: about 20 minutes after images and dependencies are available;
|
|
13
|
+
- Not required: a real model key, production API, production credential, or real business data.
|
|
14
|
+
|
|
15
|
+
Dify, n8n, MCP, and executor/OpenClaw tracks are optional extensions. Complete the core Docker demo before attempting them.
|
|
16
|
+
|
|
17
|
+
## Prerequisites
|
|
18
|
+
|
|
19
|
+
Choose one path:
|
|
20
|
+
|
|
21
|
+
- **One-line install on a fresh server (recommended)**: a non-production Ubuntu/Debian host, `curl`, and working `sudo` or root access. The installer checks and installs Docker and Compose;
|
|
22
|
+
- **Local source reproduction**: macOS or Linux, Git, `curl`, OpenSSL, Docker Engine or Docker Desktop, and Docker Compose v2 (`docker compose`).
|
|
23
|
+
|
|
24
|
+
Both paths validate the same governed demo loop. Do not run this task on a production host, production network, or Docker environment that contains important data.
|
|
25
|
+
|
|
26
|
+
## 1. Install the stable version
|
|
27
|
+
|
|
28
|
+
### Path A: fresh Ubuntu/Debian server (recommended)
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
curl -fsSL https://www.bailinghub.com/install.sh | sh
|
|
32
|
+
cd "$HOME/bailinghub"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The installer pulls the official `v0.3.0` images by default, generates random tokens and an admin password, starts the services, and runs the smoke test. The initial administrator is created only when the administrator table is empty; restarting, upgrading, recreating containers, or reinstalling against the same persistent database does not overwrite a changed password. The optional `/metrics` endpoint remains disabled and does not affect core validation. Keep the reported version, install mode, elapsed time, and the commands printed under `常用命令`, but never include passwords or tokens in your report. After Docker is installed, the current non-root login usually still needs the printed `sudo docker compose ...` commands; Docker group membership may not take effect until the next login.
|
|
36
|
+
|
|
37
|
+
If the default directory is already in use, choose a new empty directory instead of overwriting an existing deployment:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
curl -fsSL https://www.bailinghub.com/install.sh | env \
|
|
41
|
+
BAILING_INSTALL_DIR="$HOME/bailinghub-validation" \
|
|
42
|
+
sh
|
|
43
|
+
cd "$HOME/bailinghub-validation"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Path B: local source reproduction
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
git clone --depth 1 --branch v0.3.0 https://github.com/bailinghub/bailinghub.git
|
|
50
|
+
cd bailinghub
|
|
51
|
+
git rev-parse HEAD
|
|
52
|
+
export BAILING_TOKEN="$(openssl rand -hex 32)"
|
|
53
|
+
docker compose up -d --build
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Keep the commit SHA and run the remaining commands in the same terminal with the same `BAILING_TOKEN`. All write operations are confined to local demo data.
|
|
57
|
+
|
|
58
|
+
## 2. Check the services and console
|
|
59
|
+
|
|
60
|
+
For Path A, use the complete Compose prefix printed by the installer. Immediately after Docker is installed, it will usually be:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
sudo docker compose -f docker-compose.images.yml ps
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
For Path B, use:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
docker compose ps
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
For both paths, check health:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
curl -fsS http://localhost:18900/health
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The console is available at <http://localhost:18900/console/>:
|
|
79
|
+
|
|
80
|
+
- Path A uses the random admin password printed when installation completes. It is also stored in the installation directory's `.env`; never attach that file to an Issue;
|
|
81
|
+
- Path B uses the default demo account `admin / bailing-demo-admin`.
|
|
82
|
+
|
|
83
|
+
## 3. Run the smoke test
|
|
84
|
+
|
|
85
|
+
For Path A, use the command printed by the installer, usually:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
sudo docker compose -f docker-compose.images.yml exec -T bailinghub npm run smoke
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
For Path B, use:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
docker compose exec -T bailinghub npm run smoke
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Pass criteria: the process exits with code `0` and the final summary reports zero failures.
|
|
98
|
+
|
|
99
|
+
## 4. Run the governed business loop
|
|
100
|
+
|
|
101
|
+
For Path A, use the command printed by the installer, usually:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
sudo docker compose -f docker-compose.images.yml exec -T bailinghub npm run demo:e2e
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
For Path B, use:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
docker compose exec -T bailinghub npm run demo:e2e
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The command exercises these real local-demo paths:
|
|
114
|
+
|
|
115
|
+
1. query an order and create a support ticket;
|
|
116
|
+
2. create a business-side approval intent for a high-risk refund;
|
|
117
|
+
3. approve it in the demo business system and execute only the approved call;
|
|
118
|
+
4. return a 5xx from the failure probe while preserving a traceable task.
|
|
119
|
+
|
|
120
|
+
Pass criteria: the process exits with code `0` and ends with:
|
|
121
|
+
|
|
122
|
+
```text
|
|
123
|
+
结果:demo e2e passed
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## 5. Record the result
|
|
127
|
+
|
|
128
|
+
Record all four checkpoints:
|
|
129
|
+
|
|
130
|
+
| Checkpoint | PASS criteria |
|
|
131
|
+
|---|---|
|
|
132
|
+
| Services | Services are healthy in `docker compose ps`, and `/health` is reachable |
|
|
133
|
+
| Console | You can log in and inspect the demo configuration |
|
|
134
|
+
| Smoke | `npm run smoke` exits with code 0 and zero failures |
|
|
135
|
+
| Business loop | `npm run demo:e2e` exits with code 0 and prints `结果:demo e2e passed` |
|
|
136
|
+
|
|
137
|
+
Whether the result is PASS, partial, or failed, please use the [independent validation report](https://github.com/bailinghub/bailinghub/issues/new?template=independent_validation.yml). Include:
|
|
138
|
+
|
|
139
|
+
- BailingHub version, installation path, and the commit SHA when using the source path;
|
|
140
|
+
- operating system, CPU architecture, Docker, and Compose versions;
|
|
141
|
+
- the four checkpoint results;
|
|
142
|
+
- elapsed time excluding image downloads;
|
|
143
|
+
- the first blocker and sanitized logs;
|
|
144
|
+
- whether public docs were sufficient and which step was unclear.
|
|
145
|
+
|
|
146
|
+
**Never include** `BAILING_TOKEN`, client or executor tokens, admin credentials, model keys, a complete `.env`, personal information, or production business data.
|
|
147
|
+
|
|
148
|
+
## Optional extensions
|
|
149
|
+
|
|
150
|
+
After the core task passes, you may continue with:
|
|
151
|
+
|
|
152
|
+
- [Integration overview and first-success criteria](https://www.bailinghub.com/en/integrations);
|
|
153
|
+
- [Dify integration recipe](integrations/dify/README.en.md);
|
|
154
|
+
- [n8n community node](https://github.com/bailinghub/bailinghub-n8n-node);
|
|
155
|
+
- [MCP server](https://github.com/bailinghub/bailinghub-mcp-server);
|
|
156
|
+
- [Executor onboarding and OpenClaw adapter](https://github.com/bailinghub/bailinghub-openclaw-skill).
|
|
157
|
+
- [Real web chat streaming and reconnectable SSE](RELEASE_NOTES_v0.1.4.en.md).
|
|
158
|
+
- [Reliable one-line installer arguments and clean-server compatibility](RELEASE_NOTES_v0.1.5.en.md).
|
|
159
|
+
- [Independent validation paths and post-install privilege hints](RELEASE_NOTES_v0.1.6.en.md).
|
|
160
|
+
- [Versioned Client API and cross-ecosystem compatibility gates](RELEASE_NOTES_v0.1.7.en.md).
|
|
161
|
+
- [Create-once initial administrator bootstrap](RELEASE_NOTES_v0.1.8.en.md).
|
|
162
|
+
- [Instance branding, model identifier diagnostics, and ecosystem recipes](RELEASE_NOTES_v0.1.10.en.md).
|
|
163
|
+
- [Transient progress feedback for streaming chat](RELEASE_NOTES_v0.1.14.en.md).
|
|
164
|
+
- [Trusted rich rendering and chat reliability](RELEASE_NOTES_v0.1.15.en.md).
|
|
165
|
+
- [Bounded tool runtime and resilient semantic retrieval](RELEASE_NOTES_v0.1.16.en.md).
|
|
166
|
+
- [Composable Core and Kernel Host API v1](RELEASE_NOTES_v0.3.0.en.md).
|
|
167
|
+
|
|
168
|
+
Select the relevant track in the same Issue form and disclose whether you received direct maintainer assistance.
|
|
169
|
+
|
|
170
|
+
## Clean up
|
|
171
|
+
|
|
172
|
+
When you no longer need the local demo data, run this from the repository directory:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
# Path A: keep the Compose prefix printed by the installer
|
|
176
|
+
sudo docker compose -f docker-compose.images.yml down -v
|
|
177
|
+
|
|
178
|
+
# Path B
|
|
179
|
+
docker compose down -v
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
If Path A was run as root, or the current user already has Docker socket access, omit `sudo`. Run only the cleanup command for the path you selected.
|
|
183
|
+
|
|
184
|
+
This removes the containers and local volumes created for the demo.
|