@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,394 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* step-timeline.ts — 气泡内 4 状态步骤条 (2026-06-15)
|
|
3
|
-
*
|
|
4
|
-
* 职责 (单一):
|
|
5
|
-
* - 给每条 AI 消息挂一个可折叠/展开的步骤条
|
|
6
|
-
* - 状态机: idle ○ / active ● / done 🟢 / error 🔴
|
|
7
|
-
* - 摘要条 + 详情区共用同一份 Step[] 数据
|
|
8
|
-
* - 流式期间在 streaming 元素内, finalize 时搬到正式 message
|
|
9
|
-
* - 折叠状态按 channel 持久化 (localStorage)
|
|
10
|
-
*
|
|
11
|
-
* 状态 (模块私有, 每个 message 一个实例):
|
|
12
|
-
* - steps: Step[]
|
|
13
|
-
* - currentIndex: number
|
|
14
|
-
* - expanded: boolean (受 localStorage 影响)
|
|
15
|
-
*
|
|
16
|
-
* 输入 (从 message-renderer 调用):
|
|
17
|
-
* - createEmptyStepTimeline(channelId) -> HTMLElement
|
|
18
|
-
* - mountStepTimeline(messageEl, channelId) // 已有 message 上挂 timeline
|
|
19
|
-
* - pushStepToTimeline(timelineEl, type, data) // 订阅 step_start/done/error
|
|
20
|
-
* - migrateStepTimeline(fromEl, toEl) // finalize 时搬家
|
|
21
|
-
*
|
|
22
|
-
* 输出 (DOM):
|
|
23
|
-
* - .step-timeline / .step-timeline-summary / .step-timeline-body
|
|
24
|
-
* - .step-dot (摘要条圆点) / .step-timeline-node (详情区节点)
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
// ---------------------------------------------------------------------------
|
|
28
|
-
// 类型
|
|
29
|
-
// ---------------------------------------------------------------------------
|
|
30
|
-
export type StepStatus = 'idle' | 'active' | 'done' | 'error';
|
|
31
|
-
export interface Step {
|
|
32
|
-
name: string;
|
|
33
|
-
status: StepStatus;
|
|
34
|
-
args?: Record<string, unknown>;
|
|
35
|
-
output?: string;
|
|
36
|
-
error?: string;
|
|
37
|
-
/** 该 step 对应的事件 type (供调试/扩展) */
|
|
38
|
-
eventType?: 'step_start' | 'step_done' | 'step_error';
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const MAX_VISIBLE_NODES = 8;
|
|
42
|
-
const STORAGE_PREFIX = 'bolloon.stepTimeline.expanded.';
|
|
43
|
-
|
|
44
|
-
// ---------------------------------------------------------------------------
|
|
45
|
-
// 模块私有状态 (按 timeline 元素实例化)
|
|
46
|
-
// 用 WeakMap 避免循环引用泄漏
|
|
47
|
-
// ---------------------------------------------------------------------------
|
|
48
|
-
interface TimelineState {
|
|
49
|
-
steps: Step[];
|
|
50
|
-
currentIndex: number;
|
|
51
|
-
expanded: boolean;
|
|
52
|
-
channelId: string | null;
|
|
53
|
-
showAll: boolean; // "+N 更多" 展开
|
|
54
|
-
}
|
|
55
|
-
const stateMap = new WeakMap<HTMLElement, TimelineState>();
|
|
56
|
-
|
|
57
|
-
// ---------------------------------------------------------------------------
|
|
58
|
-
// 工具: 持久化
|
|
59
|
-
// ---------------------------------------------------------------------------
|
|
60
|
-
function readExpanded(channelId: string | null): boolean {
|
|
61
|
-
if (!channelId) return false;
|
|
62
|
-
try {
|
|
63
|
-
return localStorage.getItem(STORAGE_PREFIX + channelId) === '1';
|
|
64
|
-
} catch { return false; }
|
|
65
|
-
}
|
|
66
|
-
function writeExpanded(channelId: string | null, expanded: boolean): void {
|
|
67
|
-
if (!channelId) return;
|
|
68
|
-
try {
|
|
69
|
-
localStorage.setItem(STORAGE_PREFIX + channelId, expanded ? '1' : '0');
|
|
70
|
-
} catch { /* localStorage 写失败 (隐私模式), 静默 */ }
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// ---------------------------------------------------------------------------
|
|
74
|
-
// 工具: 摘要条 title
|
|
75
|
-
// ---------------------------------------------------------------------------
|
|
76
|
-
function computeTitle(steps: Step[]): string {
|
|
77
|
-
if (steps.length === 0) return '执行步骤';
|
|
78
|
-
// 优先 active, 其次最后一个 error
|
|
79
|
-
const activeIdx = steps.findIndex(s => s.status === 'active');
|
|
80
|
-
if (activeIdx >= 0) return `● 执行中 · ${steps[activeIdx].name}`;
|
|
81
|
-
const lastErrorIdx = (() => {
|
|
82
|
-
for (let i = steps.length - 1; i >= 0; i--) {
|
|
83
|
-
if (steps[i].status === 'error') return i;
|
|
84
|
-
}
|
|
85
|
-
return -1;
|
|
86
|
-
})();
|
|
87
|
-
if (lastErrorIdx >= 0) return `✗ 失败 · ${steps[lastErrorIdx].name}`;
|
|
88
|
-
return `✓ 已完成 · ${steps.length} 步`;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// ---------------------------------------------------------------------------
|
|
92
|
-
// 核心: 渲染 (摘要条 + 详情区, 共用 steps 状态)
|
|
93
|
-
// ---------------------------------------------------------------------------
|
|
94
|
-
function render(timelineEl: HTMLElement): void {
|
|
95
|
-
const state = stateMap.get(timelineEl);
|
|
96
|
-
if (!state) return;
|
|
97
|
-
const { steps, expanded, showAll } = state;
|
|
98
|
-
|
|
99
|
-
const titleEl = timelineEl.querySelector('[data-current-tool]') as HTMLElement | null;
|
|
100
|
-
if (titleEl) titleEl.textContent = computeTitle(steps);
|
|
101
|
-
|
|
102
|
-
// 摘要条 dots
|
|
103
|
-
const dotsEl = timelineEl.querySelector('[data-dots]') as HTMLElement | null;
|
|
104
|
-
if (dotsEl) {
|
|
105
|
-
// diff: 复用现有 dot, 多余 remove, 缺少 append
|
|
106
|
-
const existing = Array.from(dotsEl.children) as HTMLElement[];
|
|
107
|
-
for (let i = 0; i < steps.length; i++) {
|
|
108
|
-
const step = steps[i];
|
|
109
|
-
let dot = existing[i];
|
|
110
|
-
if (!dot) {
|
|
111
|
-
dot = document.createElement('span');
|
|
112
|
-
dot.className = 'step-dot';
|
|
113
|
-
dot.setAttribute('data-index', String(i));
|
|
114
|
-
dotsEl.appendChild(dot);
|
|
115
|
-
}
|
|
116
|
-
dot.setAttribute('data-status', step.status);
|
|
117
|
-
dot.setAttribute('title', `${step.name} · ${step.status}`);
|
|
118
|
-
}
|
|
119
|
-
while (dotsEl.children.length > steps.length) {
|
|
120
|
-
dotsEl.removeChild(dotsEl.lastChild!);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// 详情区 list
|
|
125
|
-
const listEl = timelineEl.querySelector('[data-list]') as HTMLElement | null;
|
|
126
|
-
if (listEl) {
|
|
127
|
-
const hiddenCount = Math.max(0, steps.length - MAX_VISIBLE_NODES);
|
|
128
|
-
const visibleSteps = showAll ? steps : steps.slice(-MAX_VISIBLE_NODES);
|
|
129
|
-
const existing = Array.from(listEl.children) as HTMLElement[];
|
|
130
|
-
|
|
131
|
-
let htmlIdx = 0;
|
|
132
|
-
// "+N 更多" 折叠行 (仅在 showAll=false 且有 hidden 时)
|
|
133
|
-
if (!showAll && hiddenCount > 0) {
|
|
134
|
-
let moreBtn = existing[htmlIdx] as HTMLElement | undefined;
|
|
135
|
-
if (!moreBtn || !moreBtn.classList.contains('step-timeline-more')) {
|
|
136
|
-
moreBtn = document.createElement('li');
|
|
137
|
-
moreBtn.className = 'step-timeline-more';
|
|
138
|
-
moreBtn.setAttribute('role', 'button');
|
|
139
|
-
moreBtn.textContent = `+ ${hiddenCount} 更多`;
|
|
140
|
-
moreBtn.onclick = () => {
|
|
141
|
-
state.showAll = true;
|
|
142
|
-
render(timelineEl);
|
|
143
|
-
};
|
|
144
|
-
if (existing[htmlIdx] && existing[htmlIdx] !== moreBtn) {
|
|
145
|
-
listEl.replaceChild(moreBtn, existing[htmlIdx]);
|
|
146
|
-
} else {
|
|
147
|
-
listEl.appendChild(moreBtn);
|
|
148
|
-
}
|
|
149
|
-
} else {
|
|
150
|
-
moreBtn.textContent = `+ ${hiddenCount} 更多`;
|
|
151
|
-
}
|
|
152
|
-
htmlIdx++;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
for (let i = 0; i < visibleSteps.length; i++) {
|
|
156
|
-
const step = visibleSteps[i];
|
|
157
|
-
const realIndex = showAll ? i : (steps.length - visibleSteps.length + i);
|
|
158
|
-
let node = existing[htmlIdx];
|
|
159
|
-
if (!node || !node.classList.contains('step-timeline-node')) {
|
|
160
|
-
node = document.createElement('li');
|
|
161
|
-
node.className = 'step-timeline-node';
|
|
162
|
-
node.setAttribute('data-index', String(realIndex));
|
|
163
|
-
const marker = document.createElement('span');
|
|
164
|
-
marker.className = 'step-timeline-marker';
|
|
165
|
-
const label = document.createElement('span');
|
|
166
|
-
label.className = 'step-timeline-label';
|
|
167
|
-
const args = document.createElement('span');
|
|
168
|
-
args.className = 'step-timeline-args';
|
|
169
|
-
node.appendChild(marker);
|
|
170
|
-
node.appendChild(label);
|
|
171
|
-
node.appendChild(args);
|
|
172
|
-
if (existing[htmlIdx] && existing[htmlIdx] !== node) {
|
|
173
|
-
listEl.replaceChild(node, existing[htmlIdx]);
|
|
174
|
-
} else {
|
|
175
|
-
listEl.appendChild(node);
|
|
176
|
-
}
|
|
177
|
-
} else {
|
|
178
|
-
node.setAttribute('data-index', String(realIndex));
|
|
179
|
-
}
|
|
180
|
-
node.setAttribute('data-status', step.status);
|
|
181
|
-
const label = node.querySelector('.step-timeline-label') as HTMLElement;
|
|
182
|
-
if (label) label.textContent = step.name;
|
|
183
|
-
const argsEl = node.querySelector('.step-timeline-args') as HTMLElement;
|
|
184
|
-
if (argsEl) {
|
|
185
|
-
const argStr = step.args && Object.keys(step.args).length > 0
|
|
186
|
-
? JSON.stringify(step.args).slice(0, 60)
|
|
187
|
-
: '';
|
|
188
|
-
argsEl.textContent = argStr;
|
|
189
|
-
argsEl.style.display = argStr ? '' : 'none';
|
|
190
|
-
}
|
|
191
|
-
htmlIdx++;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
// 清理多余 li
|
|
195
|
-
while (listEl.children.length > htmlIdx) {
|
|
196
|
-
listEl.removeChild(listEl.lastChild!);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
// 折叠态: 空状态显示占位, 有节点就保持
|
|
201
|
-
if (steps.length === 0) {
|
|
202
|
-
timelineEl.setAttribute('data-empty', 'true');
|
|
203
|
-
} else {
|
|
204
|
-
timelineEl.removeAttribute('data-empty');
|
|
205
|
-
}
|
|
206
|
-
// 折叠 class
|
|
207
|
-
const body = timelineEl.querySelector('[data-body]') as HTMLElement | null;
|
|
208
|
-
if (body) {
|
|
209
|
-
if (expanded) {
|
|
210
|
-
body.style.maxHeight = body.scrollHeight + 'px';
|
|
211
|
-
setTimeout(() => {
|
|
212
|
-
// 动画结束后清掉, 让内容自适应 (新 step 进来时能撑开)
|
|
213
|
-
if (state.expanded) body.style.maxHeight = '';
|
|
214
|
-
}, 300);
|
|
215
|
-
} else {
|
|
216
|
-
body.style.maxHeight = '0';
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
const arrow = timelineEl.querySelector('.step-timeline-arrow') as HTMLElement | null;
|
|
220
|
-
if (arrow) arrow.style.transform = expanded ? 'rotate(180deg)' : 'rotate(0deg)';
|
|
221
|
-
|
|
222
|
-
// 自动滚到底 (新节点进来时, 详情区跟到底)
|
|
223
|
-
if (expanded && listEl) {
|
|
224
|
-
listEl.scrollTop = listEl.scrollHeight;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
// ---------------------------------------------------------------------------
|
|
229
|
-
// 公共: 创建一个空 timeline (AI 消息创建时挂的占位)
|
|
230
|
-
// ---------------------------------------------------------------------------
|
|
231
|
-
export function createEmptyStepTimeline(channelId: string | null = null): HTMLElement {
|
|
232
|
-
const root = document.createElement('div');
|
|
233
|
-
root.className = 'step-timeline';
|
|
234
|
-
root.setAttribute('data-step-timeline', '');
|
|
235
|
-
root.setAttribute('data-empty', 'true');
|
|
236
|
-
|
|
237
|
-
// 摘要条
|
|
238
|
-
const summary = document.createElement('div');
|
|
239
|
-
summary.className = 'step-timeline-summary';
|
|
240
|
-
summary.setAttribute('data-summary', '');
|
|
241
|
-
const titleSpan = document.createElement('span');
|
|
242
|
-
titleSpan.className = 'step-timeline-title';
|
|
243
|
-
const titleContent = document.createElement('span');
|
|
244
|
-
titleContent.setAttribute('data-current-tool', '');
|
|
245
|
-
titleContent.textContent = '执行步骤';
|
|
246
|
-
titleSpan.appendChild(titleContent);
|
|
247
|
-
const dots = document.createElement('div');
|
|
248
|
-
dots.className = 'step-timeline-dots';
|
|
249
|
-
dots.setAttribute('data-dots', '');
|
|
250
|
-
const arrow = document.createElement('span');
|
|
251
|
-
arrow.className = 'step-timeline-arrow';
|
|
252
|
-
arrow.textContent = '▾';
|
|
253
|
-
summary.appendChild(titleSpan);
|
|
254
|
-
summary.appendChild(dots);
|
|
255
|
-
summary.appendChild(arrow);
|
|
256
|
-
summary.onclick = () => {
|
|
257
|
-
const state = stateMap.get(root);
|
|
258
|
-
if (!state) return;
|
|
259
|
-
state.expanded = !state.expanded;
|
|
260
|
-
writeExpanded(state.channelId, state.expanded);
|
|
261
|
-
render(root);
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
// 详情区
|
|
265
|
-
const body = document.createElement('div');
|
|
266
|
-
body.className = 'step-timeline-body';
|
|
267
|
-
body.setAttribute('data-body', '');
|
|
268
|
-
const list = document.createElement('ul');
|
|
269
|
-
list.className = 'step-timeline-list';
|
|
270
|
-
list.setAttribute('data-list', '');
|
|
271
|
-
body.appendChild(list);
|
|
272
|
-
|
|
273
|
-
root.appendChild(summary);
|
|
274
|
-
root.appendChild(body);
|
|
275
|
-
|
|
276
|
-
// 初始折叠态
|
|
277
|
-
const initialExpanded = readExpanded(channelId);
|
|
278
|
-
stateMap.set(root, {
|
|
279
|
-
steps: [],
|
|
280
|
-
currentIndex: -1,
|
|
281
|
-
expanded: initialExpanded,
|
|
282
|
-
channelId: channelId || null,
|
|
283
|
-
showAll: false,
|
|
284
|
-
});
|
|
285
|
-
render(root);
|
|
286
|
-
return root;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
// ---------------------------------------------------------------------------
|
|
290
|
-
// 公共: 把 timeline 挂到 message 上 (初始化或补挂)
|
|
291
|
-
// ---------------------------------------------------------------------------
|
|
292
|
-
export function mountStepTimeline(messageEl: HTMLElement, channelId: string | null): HTMLElement {
|
|
293
|
-
// 已经挂过 → 复用
|
|
294
|
-
const existing = messageEl.querySelector('[data-step-timeline]') as HTMLElement | null;
|
|
295
|
-
if (existing) {
|
|
296
|
-
const state = stateMap.get(existing);
|
|
297
|
-
if (state && channelId && !state.channelId) state.channelId = channelId;
|
|
298
|
-
return existing;
|
|
299
|
-
}
|
|
300
|
-
// 找插入点: 在 .bubble 之后, .message-actions 之前
|
|
301
|
-
const bubble = messageEl.querySelector('.bubble');
|
|
302
|
-
const actions = messageEl.querySelector('.message-actions');
|
|
303
|
-
const timeline = createEmptyStepTimeline(channelId);
|
|
304
|
-
if (actions && actions.parentNode === messageEl) {
|
|
305
|
-
messageEl.insertBefore(timeline, actions);
|
|
306
|
-
} else if (bubble && bubble.parentNode === messageEl) {
|
|
307
|
-
bubble.parentNode.insertBefore(timeline, bubble.nextSibling);
|
|
308
|
-
} else {
|
|
309
|
-
messageEl.appendChild(timeline);
|
|
310
|
-
}
|
|
311
|
-
return timeline;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
// ---------------------------------------------------------------------------
|
|
315
|
-
// 公共: 推一个 step 事件 (start/done/error)
|
|
316
|
-
// ---------------------------------------------------------------------------
|
|
317
|
-
export function pushStepToTimeline(
|
|
318
|
-
timelineEl: HTMLElement,
|
|
319
|
-
eventType: 'step_start' | 'step_done' | 'step_error',
|
|
320
|
-
data: { tool: string; args?: Record<string, unknown>; success?: boolean; output?: string; error?: string }
|
|
321
|
-
): void {
|
|
322
|
-
const state = stateMap.get(timelineEl);
|
|
323
|
-
if (!state) return;
|
|
324
|
-
const { steps } = state;
|
|
325
|
-
|
|
326
|
-
if (eventType === 'step_start') {
|
|
327
|
-
state.currentIndex = steps.length;
|
|
328
|
-
steps.push({
|
|
329
|
-
name: data.tool,
|
|
330
|
-
status: 'active',
|
|
331
|
-
args: data.args,
|
|
332
|
-
eventType,
|
|
333
|
-
});
|
|
334
|
-
} else {
|
|
335
|
-
// step_done / step_error — 找当前 active 节点关闭
|
|
336
|
-
// 优先匹配 currentIndex, 其次回退到最后一个 active
|
|
337
|
-
let targetIdx = state.currentIndex;
|
|
338
|
-
if (targetIdx < 0 || !steps[targetIdx] || steps[targetIdx].name !== data.tool) {
|
|
339
|
-
// 兜底: 找最后一个同名 active
|
|
340
|
-
for (let i = steps.length - 1; i >= 0; i--) {
|
|
341
|
-
if (steps[i].name === data.tool && steps[i].status === 'active') {
|
|
342
|
-
targetIdx = i;
|
|
343
|
-
break;
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
if (targetIdx < 0) {
|
|
348
|
-
// 没有 active 节点匹配, 当作新 error 节点
|
|
349
|
-
targetIdx = steps.length;
|
|
350
|
-
steps.push({ name: data.tool, status: 'error', eventType });
|
|
351
|
-
}
|
|
352
|
-
if (eventType === 'step_done') {
|
|
353
|
-
steps[targetIdx].status = data.success === false ? 'error' : 'done';
|
|
354
|
-
if (data.output) steps[targetIdx].output = data.output;
|
|
355
|
-
if (data.error) steps[targetIdx].error = data.error;
|
|
356
|
-
} else {
|
|
357
|
-
steps[targetIdx].status = 'error';
|
|
358
|
-
if (data.error) steps[targetIdx].error = data.error;
|
|
359
|
-
}
|
|
360
|
-
steps[targetIdx].eventType = eventType;
|
|
361
|
-
state.currentIndex = -1;
|
|
362
|
-
}
|
|
363
|
-
render(timelineEl);
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
// ---------------------------------------------------------------------------
|
|
367
|
-
// 公共: finalize 时把 timeline 元素从 from 搬到 to (避免重渲)
|
|
368
|
-
// 接受 timelineEl 本身或 fromEl 内部的 timeline
|
|
369
|
-
// ---------------------------------------------------------------------------
|
|
370
|
-
export function migrateStepTimeline(fromEl: HTMLElement, toEl: HTMLElement): void {
|
|
371
|
-
const fromTimeline = fromEl.querySelector('[data-step-timeline]') as HTMLElement | null;
|
|
372
|
-
const toTimeline = toEl.querySelector('[data-step-timeline]') as HTMLElement | null;
|
|
373
|
-
if (!fromTimeline) return;
|
|
374
|
-
// 移除 toEl 的占位, 搬 fromEl 的过来
|
|
375
|
-
if (toTimeline && toTimeline !== fromTimeline) {
|
|
376
|
-
toTimeline.remove();
|
|
377
|
-
}
|
|
378
|
-
if (toTimeline !== fromTimeline) {
|
|
379
|
-
toEl.appendChild(fromTimeline);
|
|
380
|
-
}
|
|
381
|
-
// 重渲一次 (channelId 注入)
|
|
382
|
-
const state = stateMap.get(fromTimeline);
|
|
383
|
-
if (state) {
|
|
384
|
-
render(fromTimeline);
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
// ---------------------------------------------------------------------------
|
|
389
|
-
// 公共: 拿到一个 message 内的 timeline (无则返回 null)
|
|
390
|
-
// ---------------------------------------------------------------------------
|
|
391
|
-
export function getStepTimeline(messageEl: HTMLElement | null): HTMLElement | null {
|
|
392
|
-
if (!messageEl) return null;
|
|
393
|
-
return messageEl.querySelector('[data-step-timeline]') as HTMLElement | null;
|
|
394
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
diff --git a/src/utils/_e2e-clean.ts b/src/utils/_e2e-clean.ts
|
|
2
|
-
new file mode 100644
|
|
3
|
-
index 0000000..314f5a1
|
|
4
|
-
--- /dev/null
|
|
5
|
-
+++ b/src/utils/_e2e-clean.ts
|
|
6
|
-
@@ -0,0 +1,8 @@
|
|
7
|
-
+/**
|
|
8
|
-
+ * _e2e-clean.ts — 干净的 LLM 改动示例
|
|
9
|
-
+ */
|
|
10
|
-
+export function formatBytes(n: number): string {
|
|
11
|
-
+ if (n < 1024) return `${n} B`;
|
|
12
|
-
+ if (n < 1024 * 1024) return `${(n / 1024).toFixed(1)} KB`;
|
|
13
|
-
+ return `${(n / 1024 / 1024).toFixed(1)} MB`;
|
|
14
|
-
+}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
e2e-001
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
diff --git a/src/utils/_e2e-real.ts b/src/utils/_e2e-real.ts
|
|
2
|
-
new file mode 100644
|
|
3
|
-
index 0000000..abcaa65
|
|
4
|
-
--- /dev/null
|
|
5
|
-
+++ b/src/utils/_e2e-real.ts
|
|
6
|
-
@@ -0,0 +1,5 @@
|
|
7
|
-
+export function processInput(input: any): any {
|
|
8
|
-
+ const result: any = JSON.parse(input);
|
|
9
|
-
+ console.log('processing', result);
|
|
10
|
-
+ return result;
|
|
11
|
-
+}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
diff --git a/src/utils/foo.ts b/src/utils/foo.ts
|
|
2
|
-
new file mode 100644
|
|
3
|
-
index 0000000..abc
|
|
4
|
-
--- /dev/null
|
|
5
|
-
+++ b/src/utils/foo.ts
|
|
6
|
-
@@ -0,0 +1,5 @@
|
|
7
|
-
+export function parseInput(input: string): any {
|
|
8
|
-
+ const x: any = JSON.parse(input);
|
|
9
|
-
+ console.log('parsed', x);
|
|
10
|
-
+ return x;
|
|
11
|
-
+}
|