@bolloon/bolloon-agent 0.1.36 → 0.1.37
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/dist/web/client.js +2861 -3746
- package/dist/web/components/p2p/index.js +226 -264
- package/dist/web/ui/message-renderer.js +323 -434
- package/dist/web/ui/step-timeline.js +255 -351
- package/package.json +2 -2
- package/.auto-evolve-calls +0 -1
- package/.last-auto-evolve-baseline +0 -1
- package/.playwright-mcp/page-2026-06-16T07-51-45-706Z.yml +0 -130
- package/.playwright-mcp/page-2026-06-16T07-56-44-116Z.yml +0 -131
- package/Bolloon.md +0 -144
- package/Dive-into/CITATION.cff +0 -17
- package/Dive-into/LICENSE +0 -25
- package/Dive-into/README.md +0 -598
- package/Dive-into/README_zh.md +0 -599
- package/Dive-into/assets/context.png +0 -0
- package/Dive-into/assets/extensibility.png +0 -0
- package/Dive-into/assets/iteration.png +0 -0
- package/Dive-into/assets/layered_architecture.png +0 -0
- package/Dive-into/assets/main_structure.png +0 -0
- package/Dive-into/assets/permission.png +0 -0
- package/Dive-into/assets/session_compact.png +0 -0
- package/Dive-into/assets/subagent.png +0 -0
- package/Dive-into/paper/Dive_into_Claude_Code.pdf +0 -0
- package/dist/agents/constraint-layer.js.map +0 -1
- package/dist/agents/pi-sdk.js.map +0 -1
- package/dist/agents/workflow-engine.js.map +0 -1
- package/dist/bollharness/src/index.js +0 -5
- package/dist/bollharness/src/scripts/checks/check_adr_plan_numbering.js +0 -6
- package/dist/bollharness/src/scripts/checks/check_api_types.js +0 -45
- package/dist/bollharness/src/scripts/checks/check_artifact_link.js +0 -146
- package/dist/bollharness/src/scripts/checks/check_bridge_deps.js +0 -6
- package/dist/bollharness/src/scripts/checks/check_bugfix_binding.js +0 -6
- package/dist/bollharness/src/scripts/checks/check_bugfix_binding_ci.js +0 -6
- package/dist/bollharness/src/scripts/checks/check_doc_file_references.js +0 -6
- package/dist/bollharness/src/scripts/checks/check_doc_freshness.js +0 -135
- package/dist/bollharness/src/scripts/checks/check_doc_links.js +0 -31
- package/dist/bollharness/src/scripts/checks/check_file_existence_claims.js +0 -6
- package/dist/bollharness/src/scripts/checks/check_fragment_integrity.js +0 -34
- package/dist/bollharness/src/scripts/checks/check_hook_installed.js +0 -63
- package/dist/bollharness/src/scripts/checks/check_issue_closure.js +0 -41
- package/dist/bollharness/src/scripts/checks/check_mcp_parity.js +0 -6
- package/dist/bollharness/src/scripts/checks/check_security.js +0 -48
- package/dist/bollharness/src/scripts/checks/check_skill_parity.js +0 -6
- package/dist/bollharness/src/scripts/checks/check_versions.js +0 -6
- package/dist/bollharness/src/scripts/checks/finding.js +0 -13
- package/dist/bollharness/src/scripts/checks/next_decision_number.js +0 -20
- package/dist/bollharness/src/scripts/checks/regenerate_magic_docs.js +0 -6
- package/dist/bollharness/src/scripts/ci/detect_rebaseline_triggers.js +0 -8
- package/dist/bollharness/src/scripts/ci/scan_subprocess_cfg.js +0 -8
- package/dist/bollharness/src/scripts/ci/scan_verify_artifacts.js +0 -8
- package/dist/bollharness/src/scripts/ci/scan_yaml_schema.js +0 -8
- package/dist/bollharness/src/scripts/context_router.js +0 -67
- package/dist/bollharness/src/scripts/deploy-guard.js +0 -157
- package/dist/bollharness/src/scripts/guard-feedback.js +0 -192
- package/dist/bollharness/src/scripts/guard_router.js +0 -158
- package/dist/bollharness/src/scripts/hooks/_hook_output.js +0 -6
- package/dist/bollharness/src/scripts/hooks/auto-python3.js +0 -6
- package/dist/bollharness/src/scripts/hooks/deploy-progress-on-session-end.js +0 -6
- package/dist/bollharness/src/scripts/hooks/failure-analyzer.js +0 -6
- package/dist/bollharness/src/scripts/hooks/gate-judgment-inject.js +0 -92
- package/dist/bollharness/src/scripts/hooks/gate-transition-judgment.js +0 -63
- package/dist/bollharness/src/scripts/hooks/inbox-ack.js +0 -6
- package/dist/bollharness/src/scripts/hooks/inbox-inject-on-start.js +0 -6
- package/dist/bollharness/src/scripts/hooks/inbox-validate.js +0 -6
- package/dist/bollharness/src/scripts/hooks/inbox-write-ledger.js +0 -6
- package/dist/bollharness/src/scripts/hooks/initializer-agent.js +0 -6
- package/dist/bollharness/src/scripts/hooks/loop-detection.js +0 -73
- package/dist/bollharness/src/scripts/hooks/owner-guard.js +0 -6
- package/dist/bollharness/src/scripts/hooks/precompact.js +0 -6
- package/dist/bollharness/src/scripts/hooks/review-agent-gatekeeper.js +0 -6
- package/dist/bollharness/src/scripts/hooks/risk-tracker.js +0 -108
- package/dist/bollharness/src/scripts/hooks/sanitize-on-read.js +0 -6
- package/dist/bollharness/src/scripts/hooks/session-reflection.js +0 -7
- package/dist/bollharness/src/scripts/hooks/session-start-magic-docs.js +0 -7
- package/dist/bollharness/src/scripts/hooks/session-start-reset-risk.js +0 -7
- package/dist/bollharness/src/scripts/hooks/session-start-toolkit-reminder.js +0 -7
- package/dist/bollharness/src/scripts/hooks/stop-evaluator.js +0 -157
- package/dist/bollharness/src/scripts/hooks/tool-call-counter.js +0 -6
- package/dist/bollharness/src/scripts/hooks/trace-analyzer.js +0 -10
- package/dist/bollharness/src/scripts/install/install-trust-token.js +0 -7
- package/dist/bollharness/src/scripts/install/multi_project_registry.js +0 -9
- package/dist/bollharness/src/scripts/install/phase2_auto.js +0 -21
- package/dist/bollharness/src/scripts/install/pre_commit_installer.js +0 -6
- package/dist/bollharness/src/scripts/install/tier_selector.js +0 -7
- package/dist/bollharness/src/scripts/install/transcript_miner.js +0 -7
- package/dist/bollharness/src/scripts/lib/claim_patterns.js +0 -10
- package/dist/bollharness/src/scripts/lib/sanitize_patterns.js +0 -12
- package/dist/bollharness/src/scripts/sanitize.js +0 -6
- package/dist/bollharness-integration/context-router-judgment.js.map +0 -1
- package/dist/bollharness-integration/context-router.js.map +0 -1
- package/dist/bollharness-integration/gate-state-machine.js.map +0 -1
- package/dist/bollharness-integration/gate-transition-hooks.js.map +0 -1
- package/dist/bollharness-integration/guard-checker.js.map +0 -1
- package/dist/bollharness-integration/index.js.map +0 -1
- package/dist/bollharness-integration/integration.js.map +0 -1
- package/dist/bollharness-integration/llm/pi-ai.d.ts +0 -60
- package/dist/bollharness-integration/pi-ecosystem-colony/index.d.ts +0 -153
- package/dist/bollharness-integration/pi-ecosystem-goals/index.d.ts +0 -136
- package/dist/bollharness-integration/pi-ecosystem-judgment/decision.d.ts +0 -117
- package/dist/bollharness-integration/pi-ecosystem-judgment/distillation.d.ts +0 -78
- package/dist/bollharness-integration/pi-ecosystem-judgment/index.d.ts +0 -139
- package/dist/bollharness-integration/pi-ecosystem-mcp/index.d.ts +0 -127
- package/dist/bollharness-integration/pi-ecosystem-subagents/index.d.ts +0 -95
- package/dist/bollharness-integration/skill-adapter.js.map +0 -1
- package/dist/constraint-runtime/src/_archive_helper.js +0 -9
- package/dist/constraint-runtime/src/agent/coordinator.js +0 -48
- package/dist/constraint-runtime/src/agent/index.js +0 -1
- package/dist/constraint-runtime/src/assistant/index.js +0 -12
- package/dist/constraint-runtime/src/bootstrap/index.js +0 -12
- package/dist/constraint-runtime/src/bootstrap_graph.js +0 -13
- package/dist/constraint-runtime/src/bridge/index.js +0 -12
- package/dist/constraint-runtime/src/buddy/index.js +0 -12
- package/dist/constraint-runtime/src/cli/index.js +0 -12
- package/dist/constraint-runtime/src/command_graph.js +0 -10
- package/dist/constraint-runtime/src/commands.js +0 -60
- package/dist/constraint-runtime/src/components/index.js +0 -12
- package/dist/constraint-runtime/src/constants/index.js +0 -12
- package/dist/constraint-runtime/src/constraint/budget.js +0 -22
- package/dist/constraint-runtime/src/constraint/budget.js.map +0 -1
- package/dist/constraint-runtime/src/constraint/index.js +0 -2
- package/dist/constraint-runtime/src/constraint/permission.js +0 -20
- package/dist/constraint-runtime/src/constraint/permission.js.map +0 -1
- package/dist/constraint-runtime/src/context.js +0 -30
- package/dist/constraint-runtime/src/coordinator/index.js +0 -12
- package/dist/constraint-runtime/src/cost_hook.js +0 -4
- package/dist/constraint-runtime/src/cost_tracker.js +0 -8
- package/dist/constraint-runtime/src/deferred_init.js +0 -10
- package/dist/constraint-runtime/src/direct_modes.js +0 -6
- package/dist/constraint-runtime/src/dynamic-tool-loader.js +0 -85
- package/dist/constraint-runtime/src/entrypoints/index.js +0 -12
- package/dist/constraint-runtime/src/execution_registry.js +0 -44
- package/dist/constraint-runtime/src/history.js +0 -9
- package/dist/constraint-runtime/src/hooks/index.js +0 -12
- package/dist/constraint-runtime/src/index.js +0 -26
- package/dist/constraint-runtime/src/ink.js +0 -4
- package/dist/constraint-runtime/src/keybindings/index.js +0 -12
- package/dist/constraint-runtime/src/memdir/index.js +0 -12
- package/dist/constraint-runtime/src/migrations/index.js +0 -12
- package/dist/constraint-runtime/src/models.js +0 -1
- package/dist/constraint-runtime/src/models.js.map +0 -1
- package/dist/constraint-runtime/src/moreright/index.js +0 -12
- package/dist/constraint-runtime/src/native_ts/index.js +0 -12
- package/dist/constraint-runtime/src/output_styles/index.js +0 -12
- package/dist/constraint-runtime/src/parity_audit.js +0 -12
- package/dist/constraint-runtime/src/plugins/index.js +0 -12
- package/dist/constraint-runtime/src/port_manifest.js +0 -11
- package/dist/constraint-runtime/src/prefetch.js +0 -9
- package/dist/constraint-runtime/src/query.js +0 -1
- package/dist/constraint-runtime/src/remote/index.js +0 -12
- package/dist/constraint-runtime/src/remote_runtime.js +0 -9
- package/dist/constraint-runtime/src/runtime/index.js +0 -1
- package/dist/constraint-runtime/src/runtime/session.js +0 -35
- package/dist/constraint-runtime/src/schemas/index.js +0 -12
- package/dist/constraint-runtime/src/screens/index.js +0 -12
- package/dist/constraint-runtime/src/server/index.js +0 -12
- package/dist/constraint-runtime/src/services/index.js +0 -12
- package/dist/constraint-runtime/src/session_store.js +0 -22
- package/dist/constraint-runtime/src/setup.js +0 -30
- package/dist/constraint-runtime/src/skills/index.js +0 -1
- package/dist/constraint-runtime/src/skills/skill-registry.js +0 -28
- package/dist/constraint-runtime/src/state/index.js +0 -12
- package/dist/constraint-runtime/src/system_init.js +0 -20
- package/dist/constraint-runtime/src/thinking/engine.js +0 -42
- package/dist/constraint-runtime/src/thinking/index.js +0 -1
- package/dist/constraint-runtime/src/tool_pool.js +0 -8
- package/dist/constraint-runtime/src/tools/OpenCLI/execAdapter.js +0 -7
- package/dist/constraint-runtime/src/tools/OpenCLI/listAdapters.js +0 -7
- package/dist/constraint-runtime/src/tools/OpenCLI/runCommand.js +0 -7
- package/dist/constraint-runtime/src/tools/PolymarketSDK/cancelOrder.js +0 -6
- package/dist/constraint-runtime/src/tools/PolymarketSDK/createOrder.js +0 -6
- package/dist/constraint-runtime/src/tools/PolymarketSDK/getMarket.js +0 -5
- package/dist/constraint-runtime/src/tools/PolymarketSDK/getOrders.js +0 -6
- package/dist/constraint-runtime/src/tools/PolymarketSDK/listMarkets.js +0 -4
- package/dist/constraint-runtime/src/tools/SafeSDK/confirmTransaction.js +0 -6
- package/dist/constraint-runtime/src/tools/SafeSDK/createTransaction.js +0 -8
- package/dist/constraint-runtime/src/tools/SafeSDK/deploySafe.js +0 -6
- package/dist/constraint-runtime/src/tools/SafeSDK/executeTransaction.js +0 -6
- package/dist/constraint-runtime/src/tools/SafeSDK/getBalance.js +0 -6
- package/dist/constraint-runtime/src/tools/SafeSDK/getPendingTransactions.js +0 -6
- package/dist/constraint-runtime/src/tools/SafeSDK/proposeTransaction.js +0 -6
- package/dist/constraint-runtime/src/tools/WalletTools/autoPay.js +0 -29
- package/dist/constraint-runtime/src/tools/WalletTools/createWallet.js +0 -10
- package/dist/constraint-runtime/src/tools/WalletTools/getBalance.js +0 -13
- package/dist/constraint-runtime/src/tools/WalletTools/importWallet.js +0 -22
- package/dist/constraint-runtime/src/tools/WalletTools/sendTransaction.js +0 -25
- package/dist/constraint-runtime/src/tools/WalletTools/signMessage.js +0 -10
- package/dist/constraint-runtime/src/tools/WalletTools/transferToken.js +0 -25
- package/dist/constraint-runtime/src/tools.js +0 -80
- package/dist/constraint-runtime/src/transcript.js +0 -19
- package/dist/constraint-runtime/src/types/index.js +0 -12
- package/dist/constraint-runtime/src/upstream_proxy/index.js +0 -12
- package/dist/constraint-runtime/src/utils/index.js +0 -12
- package/dist/constraint-runtime/src/vim/index.js +0 -12
- package/dist/constraint-runtime/src/voice/index.js +0 -12
- package/dist/constraints/index.js.map +0 -1
- package/dist/documents/reader.js.map +0 -1
- package/dist/llm/config-store.js.map +0 -1
- package/dist/llm/pi-ai.js.map +0 -1
- package/dist/network/agent-network.js.map +0 -1
- package/dist/network/iroh-integration.js.map +0 -1
- package/dist/network/iroh-transport.js.map +0 -1
- package/dist/network/p2p.js.map +0 -1
- package/dist/network/storage/adapters/json-adapter.js.map +0 -1
- package/dist/pi-ecosystem-colony/index.js.map +0 -1
- package/dist/pi-ecosystem-goals/index.js.map +0 -1
- package/dist/pi-ecosystem-judgment/decision.js.map +0 -1
- package/dist/pi-ecosystem-judgment/distillation.js.map +0 -1
- package/dist/pi-ecosystem-judgment/human-value-store.js.map +0 -1
- package/dist/pi-ecosystem-judgment/index.js.map +0 -1
- package/dist/pi-ecosystem-judgment/value-injection.js.map +0 -1
- package/dist/pi-ecosystem-mcp/index.js.map +0 -1
- package/dist/pi-ecosystem-subagents/index.js.map +0 -1
- package/dist/social/ant-colony/AdaptiveHeartbeat.js.map +0 -1
- package/dist/social/ant-colony/PheromoneEngine.js.map +0 -1
- package/dist/social/ant-colony/types.js.map +0 -1
- package/dist/social/channels/ChannelManager.js.map +0 -1
- package/dist/social/channels/DiapChannelBridge.js.map +0 -1
- package/dist/social/channels/InterestMatcher.js.map +0 -1
- package/dist/social/channels/types.js.map +0 -1
- package/dist/social/global-shared-context.js.map +0 -1
- package/dist/social/heartbeat.js.map +0 -1
- package/dist/web/components/p2p/P2PModal.js +0 -188
- package/dist/web/components/p2p/p2p-modal.js +0 -657
- package/dist/web/components/p2p/p2p-tools.js +0 -248
- package/lefthook.yml +0 -33
- package/scripts/auto-evolve-loop.ts +0 -481
- package/scripts/auto-evolve-oneshot.sh +0 -155
- package/scripts/auto-evolve-snapshot.sh +0 -136
- package/scripts/build-cli.js +0 -216
- package/scripts/build-web.ts +0 -116
- package/scripts/detect-schema-changes.sh +0 -48
- package/scripts/diff-reviewer.ts +0 -159
- package/scripts/postinstall.js +0 -153
- package/scripts/validate-system-prompt.ts +0 -142
- package/scripts/weekly-report.ts +0 -364
- package/src/agents/agent-manifest-protocol.ts +0 -117
- package/src/agents/constraint-layer.ts +0 -309
- package/src/agents/iroh-secret.ts +0 -32
- package/src/agents/p2p-chat-tools.ts +0 -383
- package/src/agents/p2p-document-tools.ts +0 -347
- package/src/agents/permission-mode.ts +0 -127
- package/src/agents/pi-sdk.ts +0 -2895
- package/src/agents/pre-tool-validator.ts +0 -213
- package/src/agents/protocol.ts +0 -398
- package/src/agents/shell-guard.ts +0 -417
- package/src/agents/shell-tool.ts +0 -103
- package/src/agents/skill-loader.ts +0 -202
- package/src/agents/subagent-manager.ts +0 -553
- package/src/agents/workflow-engine.ts +0 -332
- package/src/agents/workflow-pivot-loop.ts +0 -766
- package/src/bollharness/.sanitize-report.json +0 -13
- package/src/bollharness/CLAUDE.md +0 -73
- package/src/bollharness/LICENSE +0 -21
- package/src/bollharness/README.md +0 -143
- package/src/bollharness/README.zh-CN.md +0 -131
- package/src/bollharness/package.json +0 -20
- package/src/bollharness/reference/SOURCE-COMMIT.txt +0 -3
- package/src/bollharness/reference/boll-reference/scripts/hooks/.sanitize-report.json +0 -12
- package/src/bollharness/reference/boll-reference/scripts/hooks/find-boll-root.sh +0 -27
- package/src/bollharness/reference/boll-reference/scripts/hooks/precompact.sh +0 -57
- package/src/bollharness/reference/boll-reference/scripts/hooks/stop-evaluator.md +0 -57
- package/src/bollharness/schemas/metrics-jsonl-allowlist.json +0 -67
- package/src/bollharness/scripts/checks/next_decision_number.sh +0 -48
- package/src/bollharness/scripts/ci/count-components.sh +0 -65
- package/src/bollharness/scripts/context-fragments/artifact-linkage.md +0 -14
- package/src/bollharness/scripts/context-fragments/auth-consumers.md +0 -17
- package/src/bollharness/scripts/context-fragments/bridge-constitution.md +0 -13
- package/src/bollharness/scripts/context-fragments/catalyst-distributed.md +0 -18
- package/src/bollharness/scripts/context-fragments/closure-checklist.md +0 -13
- package/src/bollharness/scripts/context-fragments/contract-consumers.md +0 -15
- package/src/bollharness/scripts/context-fragments/db-shared-structures.md +0 -15
- package/src/bollharness/scripts/context-fragments/fixed-three-layers.md +0 -19
- package/src/bollharness/scripts/context-fragments/general-dev-principles.md +0 -11
- package/src/bollharness/scripts/context-fragments/issue-first.md +0 -8
- package/src/bollharness/scripts/context-fragments/mcp-parity.md +0 -16
- package/src/bollharness/scripts/context-fragments/pi-agent-operations.md +0 -108
- package/src/bollharness/scripts/context-fragments/protocol-consumers.md +0 -15
- package/src/bollharness/scripts/context-fragments/run-events-consumers.md +0 -15
- package/src/bollharness/scripts/context-fragments/scene-fidelity.md +0 -13
- package/src/bollharness/scripts/context-fragments/truth-source-hierarchy.md +0 -15
- package/src/bollharness/scripts/context-fragments/two-language.md +0 -15
- package/src/bollharness/scripts/context-fragments/version-sources.md +0 -14
- package/src/bollharness/scripts/hooks/find-project-root.sh +0 -47
- package/src/bollharness/scripts/hooks/inbox-poll.sh +0 -78
- package/src/bollharness/scripts/hooks/precompact.sh +0 -56
- package/src/bollharness/scripts/hooks/stop-evaluator.md +0 -83
- package/src/bollharness/scripts/sync-from-upstream.sh +0 -281
- package/src/bollharness/src/index.ts +0 -5
- package/src/bollharness/src/scripts/checks/check_adr_plan_numbering.ts +0 -11
- package/src/bollharness/src/scripts/checks/check_api_types.ts +0 -52
- package/src/bollharness/src/scripts/checks/check_artifact_link.ts +0 -156
- package/src/bollharness/src/scripts/checks/check_bridge_deps.ts +0 -11
- package/src/bollharness/src/scripts/checks/check_bugfix_binding.ts +0 -11
- package/src/bollharness/src/scripts/checks/check_bugfix_binding_ci.ts +0 -11
- package/src/bollharness/src/scripts/checks/check_doc_file_references.ts +0 -11
- package/src/bollharness/src/scripts/checks/check_doc_freshness.ts +0 -141
- package/src/bollharness/src/scripts/checks/check_doc_links.ts +0 -36
- package/src/bollharness/src/scripts/checks/check_file_existence_claims.ts +0 -11
- package/src/bollharness/src/scripts/checks/check_fragment_integrity.ts +0 -40
- package/src/bollharness/src/scripts/checks/check_hook_installed.ts +0 -70
- package/src/bollharness/src/scripts/checks/check_issue_closure.ts +0 -51
- package/src/bollharness/src/scripts/checks/check_mcp_parity.ts +0 -11
- package/src/bollharness/src/scripts/checks/check_security.ts +0 -54
- package/src/bollharness/src/scripts/checks/check_skill_parity.ts +0 -11
- package/src/bollharness/src/scripts/checks/check_versions.ts +0 -11
- package/src/bollharness/src/scripts/checks/finding.ts +0 -35
- package/src/bollharness/src/scripts/checks/next_decision_number.ts +0 -24
- package/src/bollharness/src/scripts/checks/regenerate_magic_docs.ts +0 -11
- package/src/bollharness/src/scripts/ci/detect_rebaseline_triggers.ts +0 -14
- package/src/bollharness/src/scripts/ci/scan_subprocess_cfg.ts +0 -14
- package/src/bollharness/src/scripts/ci/scan_verify_artifacts.ts +0 -14
- package/src/bollharness/src/scripts/ci/scan_yaml_schema.ts +0 -14
- package/src/bollharness/src/scripts/context_router.ts +0 -76
- package/src/bollharness/src/scripts/deploy-guard.ts +0 -182
- package/src/bollharness/src/scripts/guard-feedback.ts +0 -215
- package/src/bollharness/src/scripts/guard_router.ts +0 -194
- package/src/bollharness/src/scripts/hooks/_hook_output.js +0 -3
- package/src/bollharness/src/scripts/hooks/_hook_output.ts +0 -11
- package/src/bollharness/src/scripts/hooks/auto-python3.ts +0 -10
- package/src/bollharness/src/scripts/hooks/deploy-progress-on-session-end.ts +0 -10
- package/src/bollharness/src/scripts/hooks/failure-analyzer.ts +0 -10
- package/src/bollharness/src/scripts/hooks/gate-judgment-inject.ts +0 -111
- package/src/bollharness/src/scripts/hooks/gate-transition-judgment.ts +0 -74
- package/src/bollharness/src/scripts/hooks/inbox-ack.ts +0 -10
- package/src/bollharness/src/scripts/hooks/inbox-inject-on-start.ts +0 -10
- package/src/bollharness/src/scripts/hooks/inbox-validate.ts +0 -10
- package/src/bollharness/src/scripts/hooks/inbox-write-ledger.ts +0 -10
- package/src/bollharness/src/scripts/hooks/initializer-agent.ts +0 -10
- package/src/bollharness/src/scripts/hooks/loop-detection.ts +0 -83
- package/src/bollharness/src/scripts/hooks/owner-guard.ts +0 -10
- package/src/bollharness/src/scripts/hooks/precompact.ts +0 -10
- package/src/bollharness/src/scripts/hooks/review-agent-gatekeeper.ts +0 -10
- package/src/bollharness/src/scripts/hooks/risk-tracker.ts +0 -121
- package/src/bollharness/src/scripts/hooks/sanitize-on-read.ts +0 -10
- package/src/bollharness/src/scripts/hooks/session-reflection.ts +0 -12
- package/src/bollharness/src/scripts/hooks/session-start-magic-docs.ts +0 -12
- package/src/bollharness/src/scripts/hooks/session-start-reset-risk.ts +0 -12
- package/src/bollharness/src/scripts/hooks/session-start-toolkit-reminder.ts +0 -12
- package/src/bollharness/src/scripts/hooks/stop-evaluator.ts +0 -164
- package/src/bollharness/src/scripts/hooks/tool-call-counter.ts +0 -10
- package/src/bollharness/src/scripts/hooks/trace-analyzer.ts +0 -14
- package/src/bollharness/src/scripts/install/install-trust-token.ts +0 -13
- package/src/bollharness/src/scripts/install/multi_project_registry.ts +0 -13
- package/src/bollharness/src/scripts/install/phase2_auto.ts +0 -28
- package/src/bollharness/src/scripts/install/pre_commit_installer.ts +0 -10
- package/src/bollharness/src/scripts/install/tier_selector.ts +0 -10
- package/src/bollharness/src/scripts/install/transcript_miner.ts +0 -13
- package/src/bollharness/src/scripts/lib/claim_patterns.ts +0 -11
- package/src/bollharness/src/scripts/lib/sanitize_patterns.ts +0 -13
- package/src/bollharness/src/scripts/sanitize.ts +0 -9
- package/src/bollharness/templates/persona/default.json +0 -19
- package/src/bollharness/templates/scaffold/.gitignore.append +0 -16
- package/src/bollharness/templates/scaffold/CLAUDE.md +0 -89
- package/src/bollharness-integration/channel-judgment-engine.ts +0 -634
- package/src/bollharness-integration/context-chain-router.ts +0 -474
- package/src/bollharness-integration/context-router-judgment.ts +0 -339
- package/src/bollharness-integration/context-router.ts +0 -583
- package/src/bollharness-integration/gate-state-machine.ts +0 -444
- package/src/bollharness-integration/gate-transition-hooks.ts +0 -137
- package/src/bollharness-integration/guard-checker.ts +0 -451
- package/src/bollharness-integration/index.ts +0 -195
- package/src/bollharness-integration/integration.ts +0 -538
- package/src/bollharness-integration/judgment-prompts.yaml +0 -535
- package/src/bollharness-integration/llm-judgment-engine.ts +0 -712
- package/src/bollharness-integration/skill-adapter.ts +0 -646
- package/src/bootstrap/bootstrap.ts +0 -135
- package/src/bootstrap/context-collector.ts +0 -371
- package/src/bootstrap/context-hierarchy.ts +0 -283
- package/src/bootstrap/lifecycle-hooks.ts +0 -289
- package/src/bootstrap/project-context.ts +0 -171
- package/src/cli/interface.ts +0 -211
- package/src/cli-entry.ts +0 -304
- package/src/constraints/index.ts +0 -6
- package/src/context-compaction/auto-compact.ts +0 -153
- package/src/context-compaction/budget-gate.ts +0 -32
- package/src/context-compaction/budget-reduce.ts +0 -37
- package/src/context-compaction/context-collapse.ts +0 -72
- package/src/context-compaction/index.ts +0 -24
- package/src/context-compaction/microcompact.ts +0 -54
- package/src/context-compaction/pipeline.ts +0 -133
- package/src/context-compaction/snip.ts +0 -51
- package/src/context-compaction/token-estimator.ts +0 -36
- package/src/context-compaction/types.ts +0 -99
- package/src/documents/reader.ts +0 -85
- package/src/documents/store.ts +0 -252
- package/src/electron-preload.ts +0 -25
- package/src/electron.ts +0 -200
- package/src/heartbeat/DaemonManager.ts +0 -283
- package/src/heartbeat/HealthMonitor.ts +0 -317
- package/src/heartbeat/StartupVerifier.ts +0 -223
- package/src/heartbeat/Watchdog.ts +0 -208
- package/src/heartbeat/index.ts +0 -109
- package/src/heartbeat/self-improve-bus.ts +0 -110
- package/src/heartbeat/types.ts +0 -82
- package/src/index.ts +0 -1724
- package/src/llm/audio-config-store.ts +0 -246
- package/src/llm/config-store.ts +0 -400
- package/src/llm/llm-judgment-client.ts +0 -471
- package/src/llm/pi-ai.ts +0 -653
- package/src/llm/system-prompt/health.ts +0 -159
- package/src/llm/system-prompt/layers/channel/local.md +0 -14
- package/src/llm/system-prompt/layers/channel/p2p-agent.md +0 -18
- package/src/llm/system-prompt/layers/channel/p2p-visitor.md +0 -19
- package/src/llm/system-prompt/layers/core/artifacts_storage.md +0 -89
- package/src/llm/system-prompt/layers/core/evenhandedness.md +0 -21
- package/src/llm/system-prompt/layers/core/hibs_reminders.md +0 -15
- package/src/llm/system-prompt/layers/core/identity.md +0 -37
- package/src/llm/system-prompt/layers/core/knowledge.md +0 -17
- package/src/llm/system-prompt/layers/core/memory_system.md +0 -12
- package/src/llm/system-prompt/layers/core/network_filesystem.md +0 -28
- package/src/llm/system-prompt/layers/core/refusal.md +0 -37
- package/src/llm/system-prompt/layers/core/tone.md +0 -31
- package/src/llm/system-prompt/layers/core/tools.thin.md +0 -13
- package/src/llm/system-prompt/layers/core/wellbeing.md +0 -41
- package/src/llm/system-prompt/layers/role/architect.md +0 -20
- package/src/llm/system-prompt/layers/role/expert.md +0 -19
- package/src/llm/system-prompt/layers/role/implementer.md +0 -15
- package/src/llm/system-prompt/layers/role/security.md +0 -15
- package/src/llm/system-prompt/layers/tool/artifacts.md +0 -72
- package/src/llm/system-prompt/layers/tool/bash.md +0 -25
- package/src/llm/system-prompt/layers/tool/hibs_api.md +0 -171
- package/src/llm/system-prompt/layers/tool/image_search.md +0 -70
- package/src/llm/system-prompt/layers/tool/manifest.md +0 -89
- package/src/llm/system-prompt/layers/tool/mcp_apps.md +0 -53
- package/src/llm/system-prompt/layers/tool/web_search.md +0 -83
- package/src/llm/system-prompt/registry.ts +0 -325
- package/src/llm/system-prompt/strip-hibsml.ts +0 -52
- package/src/llm/tool-manifest/ask_user_input.ts +0 -37
- package/src/llm/tool-manifest/bash.ts +0 -25
- package/src/llm/tool-manifest/create_file.ts +0 -26
- package/src/llm/tool-manifest/fetch_sports_data.ts +0 -28
- package/src/llm/tool-manifest/image_search.ts +0 -26
- package/src/llm/tool-manifest/index.ts +0 -88
- package/src/llm/tool-manifest/mcp.ts +0 -46
- package/src/llm/tool-manifest/message_compose.ts +0 -33
- package/src/llm/tool-manifest/places.ts +0 -86
- package/src/llm/tool-manifest/present_files.ts +0 -23
- package/src/llm/tool-manifest/recipe.ts +0 -42
- package/src/llm/tool-manifest/recommend_apps.ts +0 -25
- package/src/llm/tool-manifest/str_replace.ts +0 -29
- package/src/llm/tool-manifest/types.ts +0 -52
- package/src/llm/tool-manifest/view.ts +0 -26
- package/src/llm/tool-manifest/weather.ts +0 -29
- package/src/llm/tool-manifest/web.ts +0 -54
- package/src/llm/video-config-store.ts +0 -257
- package/src/network/agent-network.ts +0 -800
- package/src/network/hybrid-messenger.ts +0 -199
- package/src/network/iroh-bootstrap.ts +0 -57
- package/src/network/iroh-discovery.ts +0 -208
- package/src/network/iroh-integration.ts +0 -158
- package/src/network/iroh-transport.ts +0 -637
- package/src/network/known-peers.ts +0 -102
- package/src/network/p2p-direct.ts +0 -262
- package/src/network/p2p-secret.ts +0 -153
- package/src/network/p2p.ts +0 -964
- package/src/network/source-intent-broadcaster.ts +0 -242
- package/src/network/source-intent.ts +0 -167
- package/src/network/storage/adapters/json-adapter.ts +0 -454
- package/src/network/storage/index.ts +0 -203
- package/src/network/storage/types.ts +0 -166
- package/src/security/builtin-guards.ts +0 -162
- package/src/security/context-router-tool.ts +0 -122
- package/src/security/input-scanner.ts +0 -287
- package/src/security/react-harness.ts +0 -177
- package/src/security/tool-gate.ts +0 -294
- package/src/social/ant-colony/index.js +0 -19
- package/src/social/channels/ChannelManager.ts +0 -485
- package/src/social/channels/DiapChannelBridge.ts +0 -501
- package/src/social/channels/InterestMatcher.ts +0 -189
- package/src/social/channels/agent-workflow-config.json +0 -214
- package/src/social/channels/agent-workflow-config.yaml +0 -334
- package/src/social/channels/channel-agent-session.ts +0 -407
- package/src/social/channels/channel-heartbeat-agent.ts +0 -622
- package/src/social/channels/diap-doc-parser.ts +0 -282
- package/src/social/channels/harness-workflow-integrator.ts +0 -594
- package/src/social/channels/index.ts +0 -22
- package/src/social/channels/types.ts +0 -115
- package/src/social/global-shared-context.ts +0 -506
- package/src/social/heartbeat.ts +0 -1057
- package/src/social/persona/enhanced-persona.ts +0 -359
- package/src/types.d.ts +0 -12
- package/src/utils/auto-evolve-policy.ts +0 -138
- package/src/utils/auto-update.ts +0 -482
- package/src/utils/clamp.ts +0 -5
- package/src/web/agent-delegate-server.ts +0 -148
- package/src/web/api-config.html +0 -520
- package/src/web/client.js +0 -2352
- package/src/web/client.ts +0 -4326
- package/src/web/components/p2p/P2PModal.tsx +0 -416
- package/src/web/components/p2p/index.ts +0 -566
- package/src/web/components/p2p/index.tsx +0 -297
- package/src/web/components/p2p/p2p-connection.ts +0 -338
- package/src/web/components/p2p/p2p-identity.ts +0 -92
- package/src/web/components/p2p/p2p-manager.ts +0 -147
- package/src/web/components/p2p/p2p-messages.ts +0 -219
- package/src/web/components/p2p/p2p-modal.ts +0 -685
- package/src/web/components/p2p/p2p-store-memory.ts +0 -162
- package/src/web/components/p2p/p2p-tools.ts +0 -315
- package/src/web/components/p2p/types.ts +0 -170
- package/src/web/components/wallet-viem.mjs +0 -118
- package/src/web/design.md +0 -99
- package/src/web/icons/apple-touch-icon.png +0 -0
- package/src/web/icons/favicon-16x16.png +0 -0
- package/src/web/icons/favicon-192x192.png +0 -0
- package/src/web/icons/favicon-32x32.png +0 -0
- package/src/web/icons/favicon-48x48.png +0 -0
- package/src/web/icons/favicon-512x512.png +0 -0
- package/src/web/icons/favicon.icns +0 -0
- package/src/web/icons/favicon.ico +0 -0
- package/src/web/icons/icon.png +0 -0
- package/src/web/icons/image.png +0 -0
- package/src/web/index.html +0 -373
- package/src/web/iroh-delegate-transport.ts +0 -139
- package/src/web/manifest.json +0 -21
- package/src/web/server.ts +0 -5731
- package/src/web/style.css +0 -4737
- package/src/web/ui/message-renderer.ts +0 -540
- package/src/web/ui/step-timeline.ts +0 -394
- package/staging/auto-evolve/clean-001/.review-verdict +0 -9
- package/staging/auto-evolve/clean-001/clean-001.patch +0 -14
- package/staging/auto-evolve/e2e-001/.patch-id +0 -1
- package/staging/auto-evolve/e2e-001/.review-verdict +0 -12
- package/staging/auto-evolve/e2e-001/e2e-001.patch +0 -11
- package/staging/auto-evolve/test-bad/.review-verdict +0 -12
- package/staging/auto-evolve/test-bad/test-bad.patch +0 -11
- package/test-results/.last-run.json +0 -6
- package/test-results/src-test-web-loop-status-b-5734c-atus-bar-/346/230/276/347/244/272-spinner-/344/270/215/346/230/276/347/244/272/345/276/252/347/216/257/350/256/241/346/225/260/error-context.md +0 -285
- package/tsconfig.cli.json +0 -16
- package/tsconfig.electron.json +0 -20
- package/tsconfig.json +0 -18
|
@@ -1,594 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Harness Workflow Integrator
|
|
3
|
-
*
|
|
4
|
-
* 将 Channel Agent 与 Bollharness 配置系统集成:
|
|
5
|
-
* 1. 加载 YAML 工作流配置
|
|
6
|
-
* 2. 实现 Gate 状态机
|
|
7
|
-
* 3. Skill 路由调度
|
|
8
|
-
* 4. 多智能体协作协调
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import * as fs from 'fs/promises';
|
|
12
|
-
import * as path from 'path';
|
|
13
|
-
|
|
14
|
-
export interface GateConfig {
|
|
15
|
-
name: string;
|
|
16
|
-
entry_condition: string;
|
|
17
|
-
required_artifact: string;
|
|
18
|
-
required_skills: string[];
|
|
19
|
-
next_gate: number | null;
|
|
20
|
-
is_review_gate?: boolean;
|
|
21
|
-
reviewer_type?: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface AgentRole {
|
|
25
|
-
name: string;
|
|
26
|
-
description: string;
|
|
27
|
-
capabilities: string[];
|
|
28
|
-
default_skills: string[];
|
|
29
|
-
triggers: string[];
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface WorkflowConfig {
|
|
33
|
-
version: string;
|
|
34
|
-
workflows: {
|
|
35
|
-
default: {
|
|
36
|
-
name: string;
|
|
37
|
-
description: string;
|
|
38
|
-
initial_gate: number;
|
|
39
|
-
gates: Record<number, GateConfig>;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
agent_roles: Record<string, AgentRole>;
|
|
43
|
-
skill_routing: {
|
|
44
|
-
keyword_to_skill: Record<string, string[]>;
|
|
45
|
-
gate_to_skills: Record<number, string[]>;
|
|
46
|
-
};
|
|
47
|
-
fast_track: {
|
|
48
|
-
enabled: boolean;
|
|
49
|
-
conditions: string[];
|
|
50
|
-
required_steps: string[];
|
|
51
|
-
};
|
|
52
|
-
parallel_execution: {
|
|
53
|
-
enabled: boolean;
|
|
54
|
-
contract: {
|
|
55
|
-
required_fields: string[];
|
|
56
|
-
seam_validation: {
|
|
57
|
-
enabled: boolean;
|
|
58
|
-
blocking: boolean;
|
|
59
|
-
message: string;
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
collaboration_protocol: {
|
|
64
|
-
message_format: {
|
|
65
|
-
type: string;
|
|
66
|
-
fields: string[];
|
|
67
|
-
};
|
|
68
|
-
state_sync: {
|
|
69
|
-
enabled: boolean;
|
|
70
|
-
interval_ms: number;
|
|
71
|
-
sync_on_gate_change: boolean;
|
|
72
|
-
};
|
|
73
|
-
conflict_resolution: {
|
|
74
|
-
strategy: string;
|
|
75
|
-
escalation_gates: number[];
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export interface GateState {
|
|
81
|
-
current_gate: number;
|
|
82
|
-
entry_satisfied: boolean;
|
|
83
|
-
blockers: string[];
|
|
84
|
-
artifacts: Record<string, unknown>;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export interface SkillResult {
|
|
88
|
-
skill: string;
|
|
89
|
-
success: boolean;
|
|
90
|
-
output: string;
|
|
91
|
-
gate: number;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Harness Workflow Integrator 类
|
|
96
|
-
*/
|
|
97
|
-
export class HarnessWorkflowIntegrator {
|
|
98
|
-
private config: WorkflowConfig | null = null;
|
|
99
|
-
private currentGate: number = 0;
|
|
100
|
-
private artifacts: Map<string, unknown> = new Map();
|
|
101
|
-
private gateHistory: number[] = [];
|
|
102
|
-
private initialized: boolean = false;
|
|
103
|
-
|
|
104
|
-
constructor() {}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* 初始化,加载配置
|
|
108
|
-
*/
|
|
109
|
-
async initialize(configPath?: string): Promise<void> {
|
|
110
|
-
if (this.initialized) return;
|
|
111
|
-
|
|
112
|
-
const defaultPath = path.join(
|
|
113
|
-
process.env.HOME || '/tmp',
|
|
114
|
-
'.bolloon',
|
|
115
|
-
'channels',
|
|
116
|
-
'agent-workflow-config.yaml'
|
|
117
|
-
);
|
|
118
|
-
|
|
119
|
-
const filePath = configPath || defaultPath;
|
|
120
|
-
|
|
121
|
-
try {
|
|
122
|
-
const content = await fs.readFile(filePath, 'utf-8');
|
|
123
|
-
this.config = JSON.parse(content) as WorkflowConfig;
|
|
124
|
-
this.initialized = true;
|
|
125
|
-
console.log(`[HarnessIntegrator] Loaded workflow config from ${filePath}`);
|
|
126
|
-
} catch (e) {
|
|
127
|
-
// 使用内置默认配置
|
|
128
|
-
this.config = this.getDefaultConfig();
|
|
129
|
-
this.initialized = true;
|
|
130
|
-
console.log('[HarnessIntegrator] Using default workflow config');
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* 获取默认配置
|
|
136
|
-
*/
|
|
137
|
-
private getDefaultConfig(): WorkflowConfig {
|
|
138
|
-
return {
|
|
139
|
-
version: '1.0',
|
|
140
|
-
workflows: {
|
|
141
|
-
default: {
|
|
142
|
-
name: '默认协作工作流',
|
|
143
|
-
description: '基于 Harness Gate 的多智能体协作工作流',
|
|
144
|
-
initial_gate: 0,
|
|
145
|
-
gates: {
|
|
146
|
-
0: {
|
|
147
|
-
name: '问题锁定',
|
|
148
|
-
entry_condition: '用户提出需求',
|
|
149
|
-
required_artifact: '问题陈述 + Change Classification',
|
|
150
|
-
required_skills: ['arch'],
|
|
151
|
-
next_gate: 1
|
|
152
|
-
},
|
|
153
|
-
1: {
|
|
154
|
-
name: '架构设计',
|
|
155
|
-
entry_condition: 'Gate 0 产物存在',
|
|
156
|
-
required_artifact: 'ADR草稿 + 消费方清单',
|
|
157
|
-
required_skills: ['arch', 'lead'],
|
|
158
|
-
next_gate: 2
|
|
159
|
-
},
|
|
160
|
-
2: {
|
|
161
|
-
name: '架构审查',
|
|
162
|
-
entry_condition: 'ADR草稿完成',
|
|
163
|
-
required_artifact: '审查报告 (PASS/BLOCK)',
|
|
164
|
-
required_skills: ['arch', 'guardian-fixer'],
|
|
165
|
-
is_review_gate: true,
|
|
166
|
-
reviewer_type: 'independent',
|
|
167
|
-
next_gate: 3
|
|
168
|
-
},
|
|
169
|
-
3: {
|
|
170
|
-
name: '计划制定',
|
|
171
|
-
entry_condition: 'Gate 2 PASS',
|
|
172
|
-
required_artifact: 'PLAN文档 + 架构覆盖矩阵',
|
|
173
|
-
required_skills: ['harness-eng', 'plan-lock'],
|
|
174
|
-
next_gate: 4
|
|
175
|
-
},
|
|
176
|
-
4: {
|
|
177
|
-
name: '计划审查',
|
|
178
|
-
entry_condition: 'PLAN vN-final 冻结',
|
|
179
|
-
required_artifact: '审查报告 + plan-lock确认',
|
|
180
|
-
required_skills: ['arch', 'guardian-fixer'],
|
|
181
|
-
is_review_gate: true,
|
|
182
|
-
reviewer_type: 'independent',
|
|
183
|
-
next_gate: 5
|
|
184
|
-
},
|
|
185
|
-
5: {
|
|
186
|
-
name: '任务分解',
|
|
187
|
-
entry_condition: 'Gate 4 PASS + plan-lock',
|
|
188
|
-
required_artifact: 'WP拆分 + TASK.md',
|
|
189
|
-
required_skills: ['task-arch', 'crystal-learn'],
|
|
190
|
-
next_gate: 6
|
|
191
|
-
},
|
|
192
|
-
6: {
|
|
193
|
-
name: '任务审查',
|
|
194
|
-
entry_condition: '全部TASK.md完成',
|
|
195
|
-
required_artifact: '审查报告 (PASS/BLOCK)',
|
|
196
|
-
required_skills: ['task-arch', 'guardian-fixer'],
|
|
197
|
-
is_review_gate: true,
|
|
198
|
-
reviewer_type: 'independent',
|
|
199
|
-
next_gate: 7
|
|
200
|
-
},
|
|
201
|
-
7: {
|
|
202
|
-
name: '代码实现',
|
|
203
|
-
entry_condition: 'Gate 6 PASS',
|
|
204
|
-
required_artifact: '代码 + LOG.md',
|
|
205
|
-
required_skills: ['harness-eng', 'harness-dev'],
|
|
206
|
-
next_gate: 8
|
|
207
|
-
},
|
|
208
|
-
8: {
|
|
209
|
-
name: '测试验证',
|
|
210
|
-
entry_condition: '全部WP代码 + LOG.md存在',
|
|
211
|
-
required_artifact: '审查报告 + 验收确认',
|
|
212
|
-
required_skills: ['harness-eng', 'harness-eng-test'],
|
|
213
|
-
is_review_gate: true,
|
|
214
|
-
reviewer_type: 'independent',
|
|
215
|
-
next_gate: null
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
},
|
|
220
|
-
agent_roles: {
|
|
221
|
-
architect: {
|
|
222
|
-
name: '架构师',
|
|
223
|
-
description: '负责架构决策、方案比较',
|
|
224
|
-
capabilities: ['架构设计', '方案比较', '边界冻结'],
|
|
225
|
-
default_skills: ['arch', 'lead'],
|
|
226
|
-
triggers: ['架构设计', '方案比较']
|
|
227
|
-
},
|
|
228
|
-
developer: {
|
|
229
|
-
name: '开发工程师',
|
|
230
|
-
description: '负责代码实现和优化',
|
|
231
|
-
capabilities: ['代码编写', '调试', '重构'],
|
|
232
|
-
default_skills: ['harness-dev', 'harness-eng'],
|
|
233
|
-
triggers: ['实现', '写代码', '开发']
|
|
234
|
-
},
|
|
235
|
-
reviewer: {
|
|
236
|
-
name: '代码审查员',
|
|
237
|
-
description: '独立审查代码质量和架构',
|
|
238
|
-
capabilities: ['代码审查', '质量评估', '问题发现'],
|
|
239
|
-
default_skills: ['guardian-fixer', 'arch'],
|
|
240
|
-
triggers: ['代码审查', 'review', '审核']
|
|
241
|
-
}
|
|
242
|
-
},
|
|
243
|
-
skill_routing: {
|
|
244
|
-
keyword_to_skill: {
|
|
245
|
-
'架构': ['arch', 'lead'],
|
|
246
|
-
'设计': ['arch'],
|
|
247
|
-
'review': ['guardian-fixer', 'arch'],
|
|
248
|
-
'代码': ['guardian-fixer', 'harness-dev'],
|
|
249
|
-
'安全': ['guardian-fixer', 'arch'],
|
|
250
|
-
'任务': ['task-arch', 'harness-eng'],
|
|
251
|
-
'分解': ['task-arch'],
|
|
252
|
-
'实现': ['harness-dev', 'harness-eng'],
|
|
253
|
-
'测试': ['harness-eng-test', 'guardian-fixer'],
|
|
254
|
-
'验证': ['harness-eng-test']
|
|
255
|
-
},
|
|
256
|
-
gate_to_skills: {
|
|
257
|
-
0: ['arch', 'lead'],
|
|
258
|
-
1: ['arch', 'lead'],
|
|
259
|
-
2: ['guardian-fixer', 'arch'],
|
|
260
|
-
3: ['harness-eng', 'plan-lock'],
|
|
261
|
-
4: ['guardian-fixer', 'arch'],
|
|
262
|
-
5: ['task-arch', 'crystal-learn'],
|
|
263
|
-
6: ['task-arch', 'guardian-fixer'],
|
|
264
|
-
7: ['harness-eng', 'harness-dev'],
|
|
265
|
-
8: ['harness-eng', 'harness-eng-test']
|
|
266
|
-
}
|
|
267
|
-
},
|
|
268
|
-
fast_track: {
|
|
269
|
-
enabled: true,
|
|
270
|
-
conditions: [
|
|
271
|
-
'改动不超过 3 个文件',
|
|
272
|
-
'Change Classification = implementation',
|
|
273
|
-
'无跨模块接缝',
|
|
274
|
-
'不影响用户心智或产品语义',
|
|
275
|
-
'不引入新的架构决策'
|
|
276
|
-
],
|
|
277
|
-
required_steps: ['执行 skill', '单人审查']
|
|
278
|
-
},
|
|
279
|
-
parallel_execution: {
|
|
280
|
-
enabled: true,
|
|
281
|
-
contract: {
|
|
282
|
-
required_fields: ['write_set', 'parallel_tracks', 'depends_on', 'integration_owner', 'seam_owner', 'golden_journeys'],
|
|
283
|
-
seam_validation: {
|
|
284
|
-
enabled: true,
|
|
285
|
-
blocking: true,
|
|
286
|
-
message: '任何跨 WP 共享接口必须有 seam_owner'
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
},
|
|
290
|
-
collaboration_protocol: {
|
|
291
|
-
message_format: {
|
|
292
|
-
type: 'structured',
|
|
293
|
-
fields: ['type', 'from', 'to', 'content', 'gate', 'skill', 'timestamp', 'artifact']
|
|
294
|
-
},
|
|
295
|
-
state_sync: {
|
|
296
|
-
enabled: true,
|
|
297
|
-
interval_ms: 5000,
|
|
298
|
-
sync_on_gate_change: true
|
|
299
|
-
},
|
|
300
|
-
conflict_resolution: {
|
|
301
|
-
strategy: 'gate_based',
|
|
302
|
-
escalation_gates: [2, 4, 6, 8]
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
};
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
* 获取当前 Gate 配置
|
|
310
|
-
*/
|
|
311
|
-
getGateConfig(gate: number): GateConfig | null {
|
|
312
|
-
if (!this.config) return null;
|
|
313
|
-
return this.config.workflows.default.gates[gate] || null;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* 获取当前 Gate
|
|
318
|
-
*/
|
|
319
|
-
getCurrentGate(): number {
|
|
320
|
-
return this.currentGate;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
/**
|
|
324
|
-
* 获取 Gate Pack (用于 Skill 输出)
|
|
325
|
-
*/
|
|
326
|
-
getGatePack(): {
|
|
327
|
-
current_gate: number;
|
|
328
|
-
entry_satisfied: boolean;
|
|
329
|
-
blockers: string[];
|
|
330
|
-
required_artifact: string;
|
|
331
|
-
required_skills: string[];
|
|
332
|
-
required_review_substrate?: string;
|
|
333
|
-
} {
|
|
334
|
-
const gateConfig = this.getGateConfig(this.currentGate);
|
|
335
|
-
return {
|
|
336
|
-
current_gate: this.currentGate,
|
|
337
|
-
entry_satisfied: this.checkEntryCondition(),
|
|
338
|
-
blockers: this.getBlockers(),
|
|
339
|
-
required_artifact: gateConfig?.required_artifact || '',
|
|
340
|
-
required_skills: gateConfig?.required_skills || [],
|
|
341
|
-
required_review_substrate: gateConfig?.is_review_gate ? '独立审查' : undefined
|
|
342
|
-
};
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
/**
|
|
346
|
-
* 检查入口条件是否满足
|
|
347
|
-
*/
|
|
348
|
-
checkEntryCondition(): boolean {
|
|
349
|
-
if (this.currentGate === 0) return true;
|
|
350
|
-
return this.artifacts.size > 0;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* 获取阻塞条件
|
|
355
|
-
*/
|
|
356
|
-
getBlockers(): string[] {
|
|
357
|
-
const blockers: string[] = [];
|
|
358
|
-
const gateConfig = this.getGateConfig(this.currentGate);
|
|
359
|
-
|
|
360
|
-
if (!gateConfig) return blockers;
|
|
361
|
-
|
|
362
|
-
if (!this.checkEntryCondition()) {
|
|
363
|
-
blockers.push(`Gate ${this.currentGate} 入口条件未满足: ${gateConfig.entry_condition}`);
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
return blockers;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
/**
|
|
370
|
-
* 提交产物到当前 Gate
|
|
371
|
-
*/
|
|
372
|
-
submitArtifact(name: string, artifact: unknown): void {
|
|
373
|
-
this.artifacts.set(name, artifact);
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
/**
|
|
377
|
-
* 获取产物
|
|
378
|
-
*/
|
|
379
|
-
getArtifact(name: string): unknown {
|
|
380
|
-
return this.artifacts.get(name);
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
/**
|
|
384
|
-
* 尝试转移 Gate
|
|
385
|
-
*/
|
|
386
|
-
async transitionGate(reviewResult?: { verdict: 'PASS' | 'BLOCK'; details?: string }): Promise<{
|
|
387
|
-
success: boolean;
|
|
388
|
-
from: number;
|
|
389
|
-
to: number | null;
|
|
390
|
-
blockers: string[];
|
|
391
|
-
message: string;
|
|
392
|
-
}> {
|
|
393
|
-
const gateConfig = this.getGateConfig(this.currentGate);
|
|
394
|
-
|
|
395
|
-
if (!gateConfig) {
|
|
396
|
-
return {
|
|
397
|
-
success: false,
|
|
398
|
-
from: this.currentGate,
|
|
399
|
-
to: null,
|
|
400
|
-
blockers: ['无效的 Gate 配置'],
|
|
401
|
-
message: 'Gate 转移失败'
|
|
402
|
-
};
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
const blockers: string[] = [];
|
|
406
|
-
|
|
407
|
-
// 审查门需要审查结果
|
|
408
|
-
if (gateConfig.is_review_gate) {
|
|
409
|
-
if (!reviewResult) {
|
|
410
|
-
return {
|
|
411
|
-
success: false,
|
|
412
|
-
from: this.currentGate,
|
|
413
|
-
to: null,
|
|
414
|
-
blockers: ['审查门需要审查结果'],
|
|
415
|
-
message: `Gate ${this.currentGate} 是审查门,需要独立审查`
|
|
416
|
-
};
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
if (reviewResult.verdict === 'BLOCK') {
|
|
420
|
-
blockers.push(reviewResult.details || '审查未通过');
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
// 检查入口条件
|
|
425
|
-
if (!this.checkEntryCondition()) {
|
|
426
|
-
blockers.push(`入口条件未满足: ${gateConfig.entry_condition}`);
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
if (blockers.length > 0) {
|
|
430
|
-
return {
|
|
431
|
-
success: false,
|
|
432
|
-
from: this.currentGate,
|
|
433
|
-
to: this.currentGate,
|
|
434
|
-
blockers,
|
|
435
|
-
message: `Gate ${this.currentGate} BLOCKED`
|
|
436
|
-
};
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
// 执行转移
|
|
440
|
-
const nextGate = gateConfig.next_gate;
|
|
441
|
-
this.gateHistory.push(this.currentGate);
|
|
442
|
-
this.currentGate = nextGate ?? this.currentGate;
|
|
443
|
-
|
|
444
|
-
return {
|
|
445
|
-
success: true,
|
|
446
|
-
from: this.gateHistory[this.gateHistory.length - 1],
|
|
447
|
-
to: this.currentGate,
|
|
448
|
-
blockers: [],
|
|
449
|
-
message: nextGate === null ? '工作流完成' : `Gate ${this.gateHistory[this.gateHistory.length - 1]} → Gate ${this.currentGate}`
|
|
450
|
-
};
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
/**
|
|
454
|
-
* 基于关键词路由 Skill
|
|
455
|
-
*/
|
|
456
|
-
routeSkillsByKeyword(message: string): string[] {
|
|
457
|
-
if (!this.config) return [];
|
|
458
|
-
|
|
459
|
-
const lowerMessage = message.toLowerCase();
|
|
460
|
-
const skills: Set<string> = new Set();
|
|
461
|
-
|
|
462
|
-
for (const [keyword, skillList] of Object.entries(this.config.skill_routing.keyword_to_skill)) {
|
|
463
|
-
if (lowerMessage.includes(keyword.toLowerCase())) {
|
|
464
|
-
skillList.forEach(s => skills.add(s));
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
// 如果没有匹配,返回当前 Gate 的默认 skills
|
|
469
|
-
if (skills.size === 0) {
|
|
470
|
-
const gateSkills = this.config.skill_routing.gate_to_skills[this.currentGate];
|
|
471
|
-
return gateSkills || [];
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
return Array.from(skills);
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
/**
|
|
478
|
-
* 基于当前 Gate 获取 Skills
|
|
479
|
-
*/
|
|
480
|
-
getSkillsForCurrentGate(): string[] {
|
|
481
|
-
if (!this.config) return [];
|
|
482
|
-
return this.config.skill_routing.gate_to_skills[this.currentGate] || [];
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
/**
|
|
486
|
-
* 获取智能体角色
|
|
487
|
-
*/
|
|
488
|
-
getAgentRole(roleId: string): AgentRole | null {
|
|
489
|
-
if (!this.config) return null;
|
|
490
|
-
return this.config.agent_roles[roleId] || null;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
/**
|
|
494
|
-
* 根据能力匹配智能体角色
|
|
495
|
-
*/
|
|
496
|
-
matchAgentRole(capabilities: string[]): AgentRole | null {
|
|
497
|
-
if (!this.config) return null;
|
|
498
|
-
|
|
499
|
-
for (const role of Object.values(this.config.agent_roles)) {
|
|
500
|
-
const hasMatch = capabilities.some(cap =>
|
|
501
|
-
role.capabilities.some(rc => rc.includes(cap) || cap.includes(rc))
|
|
502
|
-
);
|
|
503
|
-
if (hasMatch) return role;
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
return this.config.agent_roles['architect'];
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
/**
|
|
510
|
-
* 检查是否可以使用快速通道
|
|
511
|
-
*/
|
|
512
|
-
canUseFastTrack(changeDescription: string): {
|
|
513
|
-
canUse: boolean;
|
|
514
|
-
blockers: string[];
|
|
515
|
-
} {
|
|
516
|
-
if (!this.config?.fast_track.enabled) {
|
|
517
|
-
return { canUse: false, blockers: ['快速通道未启用'] };
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
const blockers: string[] = [];
|
|
521
|
-
const conditions = this.config.fast_track.conditions;
|
|
522
|
-
|
|
523
|
-
// 简化检查:实际应用中需要更复杂的分析
|
|
524
|
-
if (changeDescription.length > 500) {
|
|
525
|
-
blockers.push('改动可能超过 3 个文件');
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
if (changeDescription.includes('API') || changeDescription.includes('契约')) {
|
|
529
|
-
blockers.push('涉及契约变更');
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
if (changeDescription.includes('模块') || changeDescription.includes('跨模块')) {
|
|
533
|
-
blockers.push('涉及跨模块接缝');
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
return {
|
|
537
|
-
canUse: blockers.length === 0,
|
|
538
|
-
blockers
|
|
539
|
-
};
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
/**
|
|
543
|
-
* 获取工作流状态摘要
|
|
544
|
-
*/
|
|
545
|
-
getWorkflowStatus(): {
|
|
546
|
-
currentGate: number;
|
|
547
|
-
gateName: string;
|
|
548
|
-
progress: string;
|
|
549
|
-
blockers: string[];
|
|
550
|
-
history: number[];
|
|
551
|
-
} {
|
|
552
|
-
const gateConfig = this.getGateConfig(this.currentGate);
|
|
553
|
-
const totalGates = 9;
|
|
554
|
-
|
|
555
|
-
return {
|
|
556
|
-
currentGate: this.currentGate,
|
|
557
|
-
gateName: gateConfig?.name || '未知',
|
|
558
|
-
progress: `${this.currentGate}/${totalGates} Gates`,
|
|
559
|
-
blockers: this.getBlockers(),
|
|
560
|
-
history: [...this.gateHistory]
|
|
561
|
-
};
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
/**
|
|
565
|
-
* 重置工作流
|
|
566
|
-
*/
|
|
567
|
-
reset(): void {
|
|
568
|
-
this.currentGate = 0;
|
|
569
|
-
this.artifacts.clear();
|
|
570
|
-
this.gateHistory = [];
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
/**
|
|
574
|
-
* 导出配置为 JSON
|
|
575
|
-
*/
|
|
576
|
-
exportConfig(): string {
|
|
577
|
-
if (!this.config) return '';
|
|
578
|
-
return JSON.stringify(this.config, null, 2);
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
// 单例实例
|
|
583
|
-
let integratorInstance: HarnessWorkflowIntegrator | null = null;
|
|
584
|
-
|
|
585
|
-
export function createHarnessWorkflowIntegrator(): HarnessWorkflowIntegrator {
|
|
586
|
-
return new HarnessWorkflowIntegrator();
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
export function getHarnessWorkflowIntegrator(): HarnessWorkflowIntegrator {
|
|
590
|
-
if (!integratorInstance) {
|
|
591
|
-
integratorInstance = new HarnessWorkflowIntegrator();
|
|
592
|
-
}
|
|
593
|
-
return integratorInstance;
|
|
594
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Channel Agent Social Module - 频道智能体社交系统
|
|
3
|
-
*
|
|
4
|
-
* 基于 Diap 去中心化协议的对外社交频道系统
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export {
|
|
8
|
-
ChannelType,
|
|
9
|
-
type SocialChannel,
|
|
10
|
-
type ChannelMember,
|
|
11
|
-
type ChannelPresence,
|
|
12
|
-
type ChannelAnnouncement,
|
|
13
|
-
type ChannelMessage,
|
|
14
|
-
type DiscoveredAgent,
|
|
15
|
-
type ChannelDiscoveryResult,
|
|
16
|
-
type ServiceRegistration,
|
|
17
|
-
DEFAULT_CHANNEL_CONFIG
|
|
18
|
-
} from './types.js';
|
|
19
|
-
|
|
20
|
-
export { InterestMatcher, interestMatcher } from './InterestMatcher.js';
|
|
21
|
-
export { ChannelManager } from './ChannelManager.js';
|
|
22
|
-
export { DiapChannelBridge, type DiapBridgeConfig } from './DiapChannelBridge.js';
|