@bolloon/bolloon-agent 0.4.14 → 0.4.15
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/README.md +127 -127
- package/bin/bolloon-cli.cjs +183 -183
- package/bin/bolloon-daemon.sh +207 -0
- package/bin/bolloon.cjs +0 -0
- package/dist/agents/constraint-layer.js +19 -19
- package/dist/agents/judgment-protocol.js +14 -14
- package/dist/agents/pi-sdk-types.js +12 -12
- package/dist/agents/pi-sdk.js +101 -101
- package/dist/agents/skill-organizer.js +19 -19
- package/dist/agents/workflow-pivot-loop.js +2 -2
- package/dist/agents/x402/x402Pay.js +4 -0
- package/dist/bollharness/src/scripts/deploy-guard.js +8 -8
- package/dist/bollharness-integration/context-router-judgment.js +4 -4
- package/dist/bollharness-integration/context-router.js +292 -292
- package/dist/bollharness-integration/gate-state-machine.js +13 -13
- package/dist/bollharness-integration/llm-judgment-engine.js +134 -134
- package/dist/bollharness-integration/skill-adapter.js +21 -21
- package/dist/bootstrap/chat-archiver.js +14 -14
- package/dist/bootstrap/context-os.js +24 -24
- package/dist/bootstrap/memory-compressor.js +13 -13
- package/dist/cli-entry.js +36 -36
- package/dist/constraint-runtime/reference_data/archive_surface_snapshot.json +63 -0
- package/dist/constraint-runtime/reference_data/commands_snapshot.json +1037 -0
- package/dist/constraint-runtime/reference_data/subsystems/assistant.json +8 -0
- package/dist/constraint-runtime/reference_data/subsystems/bootstrap.json +8 -0
- package/dist/constraint-runtime/reference_data/subsystems/bridge.json +32 -0
- package/dist/constraint-runtime/reference_data/subsystems/buddy.json +13 -0
- package/dist/constraint-runtime/reference_data/subsystems/cli.json +26 -0
- package/dist/constraint-runtime/reference_data/subsystems/components.json +32 -0
- package/dist/constraint-runtime/reference_data/subsystems/constants.json +28 -0
- package/dist/constraint-runtime/reference_data/subsystems/coordinator.json +8 -0
- package/dist/constraint-runtime/reference_data/subsystems/entrypoints.json +15 -0
- package/dist/constraint-runtime/reference_data/subsystems/hooks.json +32 -0
- package/dist/constraint-runtime/reference_data/subsystems/keybindings.json +21 -0
- package/dist/constraint-runtime/reference_data/subsystems/memdir.json +15 -0
- package/dist/constraint-runtime/reference_data/subsystems/migrations.json +18 -0
- package/dist/constraint-runtime/reference_data/subsystems/moreright.json +8 -0
- package/dist/constraint-runtime/reference_data/subsystems/native_ts.json +11 -0
- package/dist/constraint-runtime/reference_data/subsystems/outputStyles.json +8 -0
- package/dist/constraint-runtime/reference_data/subsystems/plugins.json +9 -0
- package/dist/constraint-runtime/reference_data/subsystems/remote.json +11 -0
- package/dist/constraint-runtime/reference_data/subsystems/schemas.json +8 -0
- package/dist/constraint-runtime/reference_data/subsystems/screens.json +10 -0
- package/dist/constraint-runtime/reference_data/subsystems/server.json +10 -0
- package/dist/constraint-runtime/reference_data/subsystems/services.json +32 -0
- package/dist/constraint-runtime/reference_data/subsystems/skills.json +27 -0
- package/dist/constraint-runtime/reference_data/subsystems/state.json +13 -0
- package/dist/constraint-runtime/reference_data/subsystems/types.json +18 -0
- package/dist/constraint-runtime/reference_data/subsystems/upstreamproxy.json +9 -0
- package/dist/constraint-runtime/reference_data/subsystems/utils.json +32 -0
- package/dist/constraint-runtime/reference_data/subsystems/vim.json +12 -0
- package/dist/constraint-runtime/reference_data/subsystems/voice.json +8 -0
- package/dist/constraint-runtime/reference_data/tools_snapshot.json +922 -0
- package/dist/context-compaction/auto-compact.js +7 -7
- package/dist/electron/config.js.map +1 -0
- package/dist/electron/dialogs.js.map +1 -0
- package/dist/electron/first-run.js +54 -54
- package/dist/electron/first-run.js.map +1 -0
- package/dist/electron/ipc.js.map +1 -0
- package/dist/electron/logger.js.map +1 -0
- package/dist/electron/main.js.map +1 -0
- package/dist/electron/menu.js.map +1 -0
- package/dist/electron/paths.js.map +1 -0
- package/dist/electron/server.js.map +1 -0
- package/dist/electron/tray.js.map +1 -0
- package/dist/electron/window.js.map +1 -0
- package/dist/electron-build/electron/first-run.js +54 -54
- package/dist/electron-preload.js.map +1 -1
- package/dist/electron.js.map +1 -1
- package/dist/index.js +112 -112
- package/dist/llm/llm-judgment-client.js +102 -102
- package/dist/llm/pi-ai.js +48 -48
- package/dist/llm/system-prompt/layers/channel/human-async.md +41 -41
- package/dist/llm/system-prompt/layers/channel/local.md +14 -14
- package/dist/llm/system-prompt/layers/channel/p2p-agent.md +18 -18
- package/dist/llm/system-prompt/layers/channel/p2p-peer-sync.md +51 -51
- package/dist/llm/system-prompt/layers/channel/p2p-proactive.md +43 -43
- package/dist/llm/system-prompt/layers/channel/p2p-visitor.md +19 -19
- package/dist/llm/system-prompt/layers/channel/session-handoff.md +61 -61
- package/dist/llm/system-prompt/layers/core/artifacts_storage.md +89 -89
- package/dist/llm/system-prompt/layers/core/evenhandedness.md +21 -21
- package/dist/llm/system-prompt/layers/core/external-engagement.md +73 -73
- package/dist/llm/system-prompt/layers/core/hibs_reminders.md +15 -15
- package/dist/llm/system-prompt/layers/core/identity.md +48 -48
- package/dist/llm/system-prompt/layers/core/knowledge.md +17 -17
- package/dist/llm/system-prompt/layers/core/memory_system.md +12 -12
- package/dist/llm/system-prompt/layers/core/network_filesystem.md +28 -28
- package/dist/llm/system-prompt/layers/core/refusal.md +37 -37
- package/dist/llm/system-prompt/layers/core/tone.md +31 -31
- package/dist/llm/system-prompt/layers/core/tools.thin.md +13 -13
- package/dist/llm/system-prompt/layers/core/wellbeing.md +41 -41
- package/dist/llm/system-prompt/layers/role/architect.md +20 -20
- package/dist/llm/system-prompt/layers/role/expert.md +19 -19
- package/dist/llm/system-prompt/layers/role/implementer.md +15 -15
- package/dist/llm/system-prompt/layers/role/security.md +15 -15
- package/dist/llm/system-prompt/layers/tool/artifacts.md +72 -72
- package/dist/llm/system-prompt/layers/tool/bash.md +25 -25
- package/dist/llm/system-prompt/layers/tool/goal_handoff.md +77 -77
- package/dist/llm/system-prompt/layers/tool/hibs_api.md +171 -171
- package/dist/llm/system-prompt/layers/tool/image_search.md +70 -70
- package/dist/llm/system-prompt/layers/tool/manifest.md +89 -89
- package/dist/llm/system-prompt/layers/tool/mcp_apps.md +53 -53
- package/dist/llm/system-prompt/layers/tool/p2p_request.md +61 -61
- package/dist/llm/system-prompt/layers/tool/web_search.md +83 -83
- package/dist/llm/tool-manifest/ask_user_input.js +1 -1
- package/dist/llm/tool-manifest/bash.js +3 -3
- package/dist/llm/tool-manifest/create_file.js +4 -4
- package/dist/llm/tool-manifest/fetch_sports_data.js +3 -3
- package/dist/llm/tool-manifest/image_search.js +2 -2
- package/dist/llm/tool-manifest/index.js +59 -0
- package/dist/llm/tool-manifest/mcp.js +2 -2
- package/dist/llm/tool-manifest/message_compose.js +3 -3
- package/dist/llm/tool-manifest/places.js +2 -2
- package/dist/llm/tool-manifest/present_files.js +1 -1
- package/dist/llm/tool-manifest/recipe.js +2 -2
- package/dist/llm/tool-manifest/str_replace.js +5 -5
- package/dist/llm/tool-manifest/view.js +3 -3
- package/dist/llm/tool-manifest/weather.js +4 -4
- package/dist/llm/tool-manifest/web.js +4 -4
- package/dist/network/p2p.js +78 -4
- package/dist/pi-ecosystem-judgment/causal-judge.js +51 -51
- package/dist/pi-ecosystem-judgment/distill-prompt.js +42 -42
- package/dist/pi-ecosystem-judgment/distillation.js +14 -14
- package/dist/pi-ecosystem-judgment/index.js +1 -1
- package/dist/pi-ecosystem-judgment/monitor-gate.js +28 -28
- package/dist/pi-ecosystem-judgment/value-injection.js +102 -102
- package/dist/security/context-router-tool.js +15 -15
- package/dist/utils/auto-update.js.map +1 -0
- package/dist/web/a2ui-client.js +1594 -223
- package/dist/web/api-config.html +779 -779
- package/dist/web/client-hearth.js +10 -10
- package/dist/web/client.js.map +7 -0
- package/dist/web/components/wallet-viem.mjs +118 -118
- package/dist/web/index.html +502 -502
- package/dist/web/manifest.json +20 -20
- package/dist/web/mobile-agent.js +397 -0
- package/dist/web/mobile-core.js +86235 -0
- package/dist/web/mobile-data.js +346 -0
- package/dist/web/mobile-http-api.js +71 -0
- package/dist/web/mobile-p2p.js +250 -0
- package/dist/web/mobile-payments.js +80 -0
- package/dist/web/mobile-wallet.js +226 -0
- package/dist/web/mobile.css +483 -6
- package/dist/web/mobile.html +99 -50
- package/dist/web/mobile.js +1040 -187
- package/dist/web/server.js +13 -13
- package/dist/web/style.css +4946 -4946
- package/package.json +201 -198
- package/scripts/build-cli.js +215 -215
- package/scripts/build-web.ts +162 -149
- package/scripts/postinstall.js +152 -152
- package/bin/bolloon.js +0 -157
- package/dist/agents/python-exec.js +0 -115
- package/dist/pi-ecosystem-colony/index.js +0 -365
- package/dist/social/ant-colony/AdaptiveHeartbeat.js +0 -101
- package/dist/social/ant-colony/PheromoneEngine.js +0 -227
- package/dist/social/ant-colony/index.js +0 -6
- package/dist/social/ant-colony/types.js +0 -24
- package/dist/storage/trajectory.js +0 -101
- package/dist/test/ai-judgment-test.js +0 -80
- package/dist/test/bollharness-integration.test.js +0 -318
- package/dist/test/channel-agent-multi-dialogue.js +0 -205
- package/dist/test/channel-heartbeat-agent-test.js +0 -201
- package/dist/test/constraint-layer.test.js +0 -164
- package/dist/test/diap-identity-test.js +0 -172
- package/dist/test/diap-quick-test.js +0 -62
- package/dist/test/global-shared-context.test.js +0 -315
- package/dist/test/harness-judgment-injection.test.js +0 -246
- package/dist/test/harness-workflow-integrator-test.js +0 -228
- package/dist/test/human-value-store.test.js +0 -243
- package/dist/test/hybrid-integration-test.js +0 -118
- package/dist/test/hybrid-messenger-verify.js +0 -55
- package/dist/test/iroh-bistream-debug.js +0 -38
- package/dist/test/iroh-communication.test.js +0 -66
- package/dist/test/iroh-debug-test.js +0 -57
- package/dist/test/iroh-diap-test.js +0 -71
- package/dist/test/iroh-direct-connect.js +0 -55
- package/dist/test/iroh-e2e-fixed.js +0 -89
- package/dist/test/iroh-e2e-same-process.js +0 -63
- package/dist/test/iroh-e2e.js +0 -66
- package/dist/test/iroh-final-e2e.js +0 -72
- package/dist/test/iroh-relay-test.js +0 -37
- package/dist/test/iroh-simple-test.js +0 -41
- package/dist/test/iroh-transport-verify.js +0 -54
- package/dist/test/iroh-transport.test.js +0 -37
- package/dist/test/iroh-two-nodes.js +0 -70
- package/dist/test/iroh-verify.js +0 -44
- package/dist/test/judgment-decision.test.js +0 -219
- package/dist/test/llm-judgment-integration.test.js +0 -220
- package/dist/test/p2p-agent-complex-dialogue.js +0 -385
- package/dist/test/p2p-agent-dialogue.js +0 -341
- package/dist/test/p2p-agent-full-bidirectional.js +0 -510
- package/dist/test/p2p-agent-harness-flow.js +0 -437
- package/dist/test/p2p-agent-harness-single.js +0 -143
- package/dist/test/p2p-ai-dialogue-test.js +0 -318
- package/dist/test/p2p-cid-connect-test.js +0 -195
- package/dist/test/p2p-connect-receiver.js +0 -69
- package/dist/test/p2p-doc-transfer.js +0 -110
- package/dist/test/p2p-identity-page-test.js +0 -77
- package/dist/test/p2p-iroh-test.js +0 -171
- package/dist/test/p2p-minimal-test.js +0 -241
- package/dist/test/p2p-node-1.js +0 -148
- package/dist/test/p2p-node-2.js +0 -148
- package/dist/test/p2p-server.js +0 -281
- package/dist/test/p2p-two-nodes-test.js +0 -438
- package/dist/test/pi-sdk.test.js +0 -44
- package/dist/test/set-persona.js +0 -40
- package/dist/test/simple.test.js +0 -9
- package/dist/test/storage-integration.test.js +0 -150
- package/dist/test/subagent-manager.test.js +0 -276
- package/dist/test/test-gate-flow.test.js +0 -81
- package/dist/test/workflow-engine.test.js +0 -87
- package/dist/test/workflow-pivot-loop.test.js +0 -246
|
@@ -19,101 +19,101 @@ import { getPiSDKConfig } from '../llm/config-store.js';
|
|
|
19
19
|
/**
|
|
20
20
|
* 判断用的 Prompt 模板(可以从 YAML 加载)
|
|
21
21
|
*/
|
|
22
|
-
export const JUDGMENT_PROMPT_TEMPLATE = `你是一个专业的 AI 任务分析专家。你的职责是深入理解用户的问题,并给出精准的判断。
|
|
23
|
-
|
|
24
|
-
【输入】
|
|
25
|
-
{user_input}
|
|
26
|
-
|
|
27
|
-
【历史上下文】
|
|
28
|
-
{history_context}
|
|
29
|
-
|
|
30
|
-
请分析以上输入,回答以下问题:
|
|
31
|
-
|
|
32
|
-
## 1. 问题理解
|
|
33
|
-
|
|
34
|
-
**问题本质**:用户真正想要什么?这是什么类型的问题?
|
|
35
|
-
- how-to: 寻求操作指导
|
|
36
|
-
- why: 寻求解释
|
|
37
|
-
- what: 寻求定义
|
|
38
|
-
- should: 寻求建议
|
|
39
|
-
- feasibility: 寻求可行性评估
|
|
40
|
-
|
|
41
|
-
**核心需求**:用户最想要的结果是什么?
|
|
42
|
-
|
|
43
|
-
**隐含信息**:有什么用户没有明确说但需要考虑的因素?
|
|
44
|
-
- 时间压力?
|
|
45
|
-
- 质量要求?
|
|
46
|
-
- 风险限制?
|
|
47
|
-
- 团队协作?
|
|
48
|
-
|
|
49
|
-
## 2. 复杂性评估
|
|
50
|
-
|
|
51
|
-
**复杂性等级**:这个问题有多复杂?
|
|
52
|
-
- simple: 简单任务,直接可答
|
|
53
|
-
- moderate: 中等复杂,需要一定思考
|
|
54
|
-
- complex: 复杂问题,需要深入分析
|
|
55
|
-
- profound: 深刻问题,需要本质性思考
|
|
56
|
-
|
|
57
|
-
**评估理由**:为什么认为这是这个复杂性等级?
|
|
58
|
-
|
|
59
|
-
**深度**:需要多深的理解?
|
|
60
|
-
- surface: 表面理解即可
|
|
61
|
-
- deeper: 需要分析
|
|
62
|
-
- fundamental: 需要本质性思考
|
|
63
|
-
|
|
64
|
-
## 3. 处理决策
|
|
65
|
-
|
|
66
|
-
**推荐方式**:
|
|
67
|
-
- answer: 直接回答
|
|
68
|
-
- analyze: 深入分析
|
|
69
|
-
- design: 设计方案
|
|
70
|
-
- implement: 实现代码
|
|
71
|
-
- coordinate: 协调多智能体
|
|
72
|
-
|
|
73
|
-
**决策理由**:为什么推荐这个处理方式?
|
|
74
|
-
|
|
75
|
-
## 4. 路由决策
|
|
76
|
-
|
|
77
|
-
**应该调用的 Skills**(可选多个):
|
|
78
|
-
- arch: 架构设计
|
|
79
|
-
- harness-dev: 开发实现
|
|
80
|
-
- guardian-fixer: 代码审查
|
|
81
|
-
- harness-eng: 工程协调
|
|
82
|
-
- harness-eng-test: 测试工程
|
|
83
|
-
- task-arch: 任务分解
|
|
84
|
-
- crystal-learn: 反思学习
|
|
85
|
-
|
|
86
|
-
**参与智能体**(可选):
|
|
87
|
-
- architect: 架构师
|
|
88
|
-
- developer: 开发者
|
|
89
|
-
- reviewer: 审查员
|
|
90
|
-
- coordinator: 协调者
|
|
91
|
-
|
|
92
|
-
**协作模式**:
|
|
93
|
-
- solo: 单独处理
|
|
94
|
-
- pair: 配对协作
|
|
95
|
-
- team: 团队协作
|
|
96
|
-
|
|
97
|
-
## 5. 产出要求
|
|
98
|
-
|
|
99
|
-
**需要的产物**:
|
|
100
|
-
- 问题分析
|
|
101
|
-
- 方案设计
|
|
102
|
-
- 代码实现
|
|
103
|
-
- 测试用例
|
|
104
|
-
- 其他
|
|
105
|
-
|
|
106
|
-
**Gate 建议**(如果有):
|
|
107
|
-
- Gate 0: 问题锁定
|
|
108
|
-
- Gate 1: 架构设计
|
|
109
|
-
- Gate 2: 架构审查
|
|
110
|
-
- Gate 3: 计划制定
|
|
111
|
-
- Gate 4: 计划审查
|
|
112
|
-
- Gate 5: 任务分解
|
|
113
|
-
- Gate 6: 任务审查
|
|
114
|
-
- Gate 7: 代码实现
|
|
115
|
-
- Gate 8: 测试验证
|
|
116
|
-
|
|
22
|
+
export const JUDGMENT_PROMPT_TEMPLATE = `你是一个专业的 AI 任务分析专家。你的职责是深入理解用户的问题,并给出精准的判断。
|
|
23
|
+
|
|
24
|
+
【输入】
|
|
25
|
+
{user_input}
|
|
26
|
+
|
|
27
|
+
【历史上下文】
|
|
28
|
+
{history_context}
|
|
29
|
+
|
|
30
|
+
请分析以上输入,回答以下问题:
|
|
31
|
+
|
|
32
|
+
## 1. 问题理解
|
|
33
|
+
|
|
34
|
+
**问题本质**:用户真正想要什么?这是什么类型的问题?
|
|
35
|
+
- how-to: 寻求操作指导
|
|
36
|
+
- why: 寻求解释
|
|
37
|
+
- what: 寻求定义
|
|
38
|
+
- should: 寻求建议
|
|
39
|
+
- feasibility: 寻求可行性评估
|
|
40
|
+
|
|
41
|
+
**核心需求**:用户最想要的结果是什么?
|
|
42
|
+
|
|
43
|
+
**隐含信息**:有什么用户没有明确说但需要考虑的因素?
|
|
44
|
+
- 时间压力?
|
|
45
|
+
- 质量要求?
|
|
46
|
+
- 风险限制?
|
|
47
|
+
- 团队协作?
|
|
48
|
+
|
|
49
|
+
## 2. 复杂性评估
|
|
50
|
+
|
|
51
|
+
**复杂性等级**:这个问题有多复杂?
|
|
52
|
+
- simple: 简单任务,直接可答
|
|
53
|
+
- moderate: 中等复杂,需要一定思考
|
|
54
|
+
- complex: 复杂问题,需要深入分析
|
|
55
|
+
- profound: 深刻问题,需要本质性思考
|
|
56
|
+
|
|
57
|
+
**评估理由**:为什么认为这是这个复杂性等级?
|
|
58
|
+
|
|
59
|
+
**深度**:需要多深的理解?
|
|
60
|
+
- surface: 表面理解即可
|
|
61
|
+
- deeper: 需要分析
|
|
62
|
+
- fundamental: 需要本质性思考
|
|
63
|
+
|
|
64
|
+
## 3. 处理决策
|
|
65
|
+
|
|
66
|
+
**推荐方式**:
|
|
67
|
+
- answer: 直接回答
|
|
68
|
+
- analyze: 深入分析
|
|
69
|
+
- design: 设计方案
|
|
70
|
+
- implement: 实现代码
|
|
71
|
+
- coordinate: 协调多智能体
|
|
72
|
+
|
|
73
|
+
**决策理由**:为什么推荐这个处理方式?
|
|
74
|
+
|
|
75
|
+
## 4. 路由决策
|
|
76
|
+
|
|
77
|
+
**应该调用的 Skills**(可选多个):
|
|
78
|
+
- arch: 架构设计
|
|
79
|
+
- harness-dev: 开发实现
|
|
80
|
+
- guardian-fixer: 代码审查
|
|
81
|
+
- harness-eng: 工程协调
|
|
82
|
+
- harness-eng-test: 测试工程
|
|
83
|
+
- task-arch: 任务分解
|
|
84
|
+
- crystal-learn: 反思学习
|
|
85
|
+
|
|
86
|
+
**参与智能体**(可选):
|
|
87
|
+
- architect: 架构师
|
|
88
|
+
- developer: 开发者
|
|
89
|
+
- reviewer: 审查员
|
|
90
|
+
- coordinator: 协调者
|
|
91
|
+
|
|
92
|
+
**协作模式**:
|
|
93
|
+
- solo: 单独处理
|
|
94
|
+
- pair: 配对协作
|
|
95
|
+
- team: 团队协作
|
|
96
|
+
|
|
97
|
+
## 5. 产出要求
|
|
98
|
+
|
|
99
|
+
**需要的产物**:
|
|
100
|
+
- 问题分析
|
|
101
|
+
- 方案设计
|
|
102
|
+
- 代码实现
|
|
103
|
+
- 测试用例
|
|
104
|
+
- 其他
|
|
105
|
+
|
|
106
|
+
**Gate 建议**(如果有):
|
|
107
|
+
- Gate 0: 问题锁定
|
|
108
|
+
- Gate 1: 架构设计
|
|
109
|
+
- Gate 2: 架构审查
|
|
110
|
+
- Gate 3: 计划制定
|
|
111
|
+
- Gate 4: 计划审查
|
|
112
|
+
- Gate 5: 任务分解
|
|
113
|
+
- Gate 6: 任务审查
|
|
114
|
+
- Gate 7: 代码实现
|
|
115
|
+
- Gate 8: 测试验证
|
|
116
|
+
|
|
117
117
|
请用 JSON 格式输出分析结果。`;
|
|
118
118
|
/**
|
|
119
119
|
* LLM-native Judgment Engine
|
|
@@ -434,20 +434,20 @@ export const SKILL_PROMPTS = {
|
|
|
434
434
|
arch: {
|
|
435
435
|
name: 'arch',
|
|
436
436
|
description: '架构设计专家',
|
|
437
|
-
systemPrompt: `你是一个经验丰富的系统架构师。你擅长:
|
|
438
|
-
- 从需求中提取本质问题
|
|
439
|
-
- 设计可扩展的系统架构
|
|
440
|
-
- 权衡技术方案
|
|
441
|
-
- 识别架构风险
|
|
442
|
-
|
|
443
|
-
你相信:
|
|
444
|
-
- 本质和实现必须分离
|
|
445
|
-
- 好的架构从简单规则中生长
|
|
437
|
+
systemPrompt: `你是一个经验丰富的系统架构师。你擅长:
|
|
438
|
+
- 从需求中提取本质问题
|
|
439
|
+
- 设计可扩展的系统架构
|
|
440
|
+
- 权衡技术方案
|
|
441
|
+
- 识别架构风险
|
|
442
|
+
|
|
443
|
+
你相信:
|
|
444
|
+
- 本质和实现必须分离
|
|
445
|
+
- 好的架构从简单规则中生长
|
|
446
446
|
- 复杂性应该被控制而非消除`,
|
|
447
|
-
userPromptTemplate: `用户需求:{user_input}
|
|
448
|
-
|
|
449
|
-
{context}
|
|
450
|
-
|
|
447
|
+
userPromptTemplate: `用户需求:{user_input}
|
|
448
|
+
|
|
449
|
+
{context}
|
|
450
|
+
|
|
451
451
|
请进行架构分析:`,
|
|
452
452
|
examples: [
|
|
453
453
|
{
|
|
@@ -460,40 +460,40 @@ export const SKILL_PROMPTS = {
|
|
|
460
460
|
'harness-dev': {
|
|
461
461
|
name: 'harness-dev',
|
|
462
462
|
description: '开发实现专家',
|
|
463
|
-
systemPrompt: `你是一个高效的代码实现专家。你擅长:
|
|
464
|
-
- 快速理解和实现需求
|
|
465
|
-
- 编写清晰、可维护的代码
|
|
466
|
-
- 遵循最佳实践
|
|
467
|
-
- 处理边界情况
|
|
468
|
-
|
|
469
|
-
你相信:
|
|
470
|
-
- 代码即文档
|
|
471
|
-
- 测试是代码的一部分
|
|
463
|
+
systemPrompt: `你是一个高效的代码实现专家。你擅长:
|
|
464
|
+
- 快速理解和实现需求
|
|
465
|
+
- 编写清晰、可维护的代码
|
|
466
|
+
- 遵循最佳实践
|
|
467
|
+
- 处理边界情况
|
|
468
|
+
|
|
469
|
+
你相信:
|
|
470
|
+
- 代码即文档
|
|
471
|
+
- 测试是代码的一部分
|
|
472
472
|
- 简单优于复杂`,
|
|
473
|
-
userPromptTemplate: `任务:{user_input}
|
|
474
|
-
|
|
475
|
-
技术栈:{tech_stack}
|
|
476
|
-
|
|
473
|
+
userPromptTemplate: `任务:{user_input}
|
|
474
|
+
|
|
475
|
+
技术栈:{tech_stack}
|
|
476
|
+
|
|
477
477
|
请实现代码:`,
|
|
478
478
|
outputFormat: 'code'
|
|
479
479
|
},
|
|
480
480
|
'guardian-fixer': {
|
|
481
481
|
name: 'guardian-fixer',
|
|
482
482
|
description: '代码审查专家',
|
|
483
|
-
systemPrompt: `你是一个严格的代码审查专家。你擅长:
|
|
484
|
-
- 发现潜在问题
|
|
485
|
-
- 提出改进建议
|
|
486
|
-
- 确保代码质量
|
|
487
|
-
- 平衡效率和安全性
|
|
488
|
-
|
|
489
|
-
你相信:
|
|
490
|
-
- 细节决定成败
|
|
491
|
-
- 代码审查是质量保障的最后防线
|
|
483
|
+
systemPrompt: `你是一个严格的代码审查专家。你擅长:
|
|
484
|
+
- 发现潜在问题
|
|
485
|
+
- 提出改进建议
|
|
486
|
+
- 确保代码质量
|
|
487
|
+
- 平衡效率和安全性
|
|
488
|
+
|
|
489
|
+
你相信:
|
|
490
|
+
- 细节决定成败
|
|
491
|
+
- 代码审查是质量保障的最后防线
|
|
492
492
|
- 建设性批评比否定更有价值`,
|
|
493
|
-
userPromptTemplate: `代码:\n{code}
|
|
494
|
-
|
|
495
|
-
审查范围:{scope}
|
|
496
|
-
|
|
493
|
+
userPromptTemplate: `代码:\n{code}
|
|
494
|
+
|
|
495
|
+
审查范围:{scope}
|
|
496
|
+
|
|
497
497
|
请进行审查:`,
|
|
498
498
|
outputFormat: 'structured'
|
|
499
499
|
}
|
|
@@ -377,16 +377,16 @@ export class PeerSyncSkill extends BaseSkill {
|
|
|
377
377
|
}
|
|
378
378
|
this.log(`peer-sync 启动: target_id=${targetId}`);
|
|
379
379
|
// 选 peer 的策略由 LLM 决定 (根据 list_peers 输出 + expertise tag)
|
|
380
|
-
return this.callLm(`You are a peer-selection specialist for the bolloon P2P network.
|
|
381
|
-
Given a target_id and task description, output structured JSON with:
|
|
382
|
-
- selectedPeer: DID of the best peer (or null if none suitable)
|
|
383
|
-
- channelName: human-readable name for the new channel
|
|
384
|
-
- initialMessage: first message to send (≤ 200 chars, brief + asks for acceptance)
|
|
385
|
-
- estimatedRounds: expected back-and-forth count (1-10)
|
|
386
|
-
|
|
387
|
-
Rules:
|
|
388
|
-
- Prefer peers with matching expertise tag
|
|
389
|
-
- If no peer matches, return selectedPeer: null
|
|
380
|
+
return this.callLm(`You are a peer-selection specialist for the bolloon P2P network.
|
|
381
|
+
Given a target_id and task description, output structured JSON with:
|
|
382
|
+
- selectedPeer: DID of the best peer (or null if none suitable)
|
|
383
|
+
- channelName: human-readable name for the new channel
|
|
384
|
+
- initialMessage: first message to send (≤ 200 chars, brief + asks for acceptance)
|
|
385
|
+
- estimatedRounds: expected back-and-forth count (1-10)
|
|
386
|
+
|
|
387
|
+
Rules:
|
|
388
|
+
- Prefer peers with matching expertise tag
|
|
389
|
+
- If no peer matches, return selectedPeer: null
|
|
390
390
|
- Don't over-explain — peer agent has same identity layer as you`, `target_id: ${targetId}\ntask: ${task}`);
|
|
391
391
|
}
|
|
392
392
|
}
|
|
@@ -412,17 +412,17 @@ export class HabitDistillSkill extends BaseSkill {
|
|
|
412
412
|
}
|
|
413
413
|
this.log(`habit-distill 启动: session=${sessionKey}`);
|
|
414
414
|
// 抽取习性的 prompt — 让 LLM 输出结构化 JSON
|
|
415
|
-
return this.callLm(`You are a habit-extraction specialist.
|
|
416
|
-
Given a summary of user-assistant interaction, output JSON with:
|
|
417
|
-
- habits: [{ content: string, tags: string[], weight: 'low'|'medium'|'high' }]
|
|
418
|
-
- content: 一个用户偏好/习性的简短描述 (≤ 100 字)
|
|
419
|
-
- tags: 标签如 ['input-style', 'terminology', 'recurring-topic', 'correction']
|
|
420
|
-
- weight: 影响判断力注入门时的优先级
|
|
421
|
-
- skipReason: 若不该蒸馏 (用户拒绝/任务太简单/judgment 库饱和), 填理由
|
|
422
|
-
|
|
423
|
-
Rules:
|
|
424
|
-
- 习性必须是"用户可观察到的稳定模式", 不是单次偏好
|
|
425
|
-
- 隐私相关打 tags 含 'private', 注入门自动过滤
|
|
415
|
+
return this.callLm(`You are a habit-extraction specialist.
|
|
416
|
+
Given a summary of user-assistant interaction, output JSON with:
|
|
417
|
+
- habits: [{ content: string, tags: string[], weight: 'low'|'medium'|'high' }]
|
|
418
|
+
- content: 一个用户偏好/习性的简短描述 (≤ 100 字)
|
|
419
|
+
- tags: 标签如 ['input-style', 'terminology', 'recurring-topic', 'correction']
|
|
420
|
+
- weight: 影响判断力注入门时的优先级
|
|
421
|
+
- skipReason: 若不该蒸馏 (用户拒绝/任务太简单/judgment 库饱和), 填理由
|
|
422
|
+
|
|
423
|
+
Rules:
|
|
424
|
+
- 习性必须是"用户可观察到的稳定模式", 不是单次偏好
|
|
425
|
+
- 隐私相关打 tags 含 'private', 注入门自动过滤
|
|
426
426
|
- 不要重复已有 judgment (调用方负责查重)`, `Session: ${sessionKey}\nMessages summary: ${recentMessagesSummary || '(caller should pass loadMessages output)'}`);
|
|
427
427
|
}
|
|
428
428
|
}
|
|
@@ -117,20 +117,20 @@ function templateMonthlySummary(opts) {
|
|
|
117
117
|
const channelSet = new Set(opts.entries.map(e => e.channelName).filter(Boolean));
|
|
118
118
|
const sampleUser = user.slice(0, 5).map(e => ` - [${e.ts}] ${e.text.slice(0, 80)}`).join('\n');
|
|
119
119
|
const sampleAi = ai.slice(0, 5).map(e => ` - [${e.ts}] ${e.text.slice(0, 80)}`).join('\n');
|
|
120
|
-
return `# 月度对话摘要 — ${opts.yearMonth} (peer ${opts.publicKey.slice(0, 12)}…)
|
|
121
|
-
|
|
122
|
-
时间: ${opts.timestamp}
|
|
123
|
-
对话轮次: ${opts.entries.length} (user=${user.length}, ai=${ai.length})
|
|
124
|
-
涉及 channel: ${Array.from(channelSet).slice(0, 10).join(', ') || '(无)'}
|
|
125
|
-
|
|
126
|
-
## 用户关键提问
|
|
127
|
-
${sampleUser || ' (无)'}
|
|
128
|
-
|
|
129
|
-
## AI 关键回答
|
|
130
|
-
${sampleAi || ' (无)'}
|
|
131
|
-
|
|
132
|
-
## 备注
|
|
133
|
-
- 此摘要由模板生成 (LLM 调用失败 fallback)
|
|
120
|
+
return `# 月度对话摘要 — ${opts.yearMonth} (peer ${opts.publicKey.slice(0, 12)}…)
|
|
121
|
+
|
|
122
|
+
时间: ${opts.timestamp}
|
|
123
|
+
对话轮次: ${opts.entries.length} (user=${user.length}, ai=${ai.length})
|
|
124
|
+
涉及 channel: ${Array.from(channelSet).slice(0, 10).join(', ') || '(无)'}
|
|
125
|
+
|
|
126
|
+
## 用户关键提问
|
|
127
|
+
${sampleUser || ' (无)'}
|
|
128
|
+
|
|
129
|
+
## AI 关键回答
|
|
130
|
+
${sampleAi || ' (无)'}
|
|
131
|
+
|
|
132
|
+
## 备注
|
|
133
|
+
- 此摘要由模板生成 (LLM 调用失败 fallback)
|
|
134
134
|
`;
|
|
135
135
|
}
|
|
136
136
|
/**
|
|
@@ -77,30 +77,30 @@ function layerReadme(l) {
|
|
|
77
77
|
work: '工作成果层 — 有明确生命周期, 交付/定型后归档',
|
|
78
78
|
scratch: '一次性层 — 定期 prune, 不承诺保留',
|
|
79
79
|
}[l.kind];
|
|
80
|
-
return `# ${l.key} — ${l.name}
|
|
81
|
-
|
|
82
|
-
## 工作区类别 (workspace kind)
|
|
83
|
-
${kindNote}
|
|
84
|
-
|
|
85
|
-
## 这一层回答的问题
|
|
86
|
-
${l.name}
|
|
87
|
-
|
|
88
|
-
## 存什么
|
|
89
|
-
${l.store}
|
|
90
|
-
|
|
91
|
-
## 不该存什么
|
|
92
|
-
${l.notStore}
|
|
93
|
-
|
|
94
|
-
## 典型用途
|
|
95
|
-
${l.usage}
|
|
96
|
-
|
|
97
|
-
## 价值判断标准 (Context OS §5)
|
|
98
|
-
写入前先回答: **未来哪个具体场景会用到它?**
|
|
99
|
-
回答不出 = 噪音, 留在 tmp/, 不进正式层.
|
|
100
|
-
|
|
101
|
-
## 价值生命周期
|
|
102
|
-
阶段0 临时价值点 (对话中刚出现, 未验证) → 阶段1 验证 (被使用/确认)
|
|
103
|
-
→ 阶段2 固化 (本层唯一位置) → 阶段3 索引化 (高频引用) → 阶段4 归档/删除.
|
|
80
|
+
return `# ${l.key} — ${l.name}
|
|
81
|
+
|
|
82
|
+
## 工作区类别 (workspace kind)
|
|
83
|
+
${kindNote}
|
|
84
|
+
|
|
85
|
+
## 这一层回答的问题
|
|
86
|
+
${l.name}
|
|
87
|
+
|
|
88
|
+
## 存什么
|
|
89
|
+
${l.store}
|
|
90
|
+
|
|
91
|
+
## 不该存什么
|
|
92
|
+
${l.notStore}
|
|
93
|
+
|
|
94
|
+
## 典型用途
|
|
95
|
+
${l.usage}
|
|
96
|
+
|
|
97
|
+
## 价值判断标准 (Context OS §5)
|
|
98
|
+
写入前先回答: **未来哪个具体场景会用到它?**
|
|
99
|
+
回答不出 = 噪音, 留在 tmp/, 不进正式层.
|
|
100
|
+
|
|
101
|
+
## 价值生命周期
|
|
102
|
+
阶段0 临时价值点 (对话中刚出现, 未验证) → 阶段1 验证 (被使用/确认)
|
|
103
|
+
→ 阶段2 固化 (本层唯一位置) → 阶段3 索引化 (高频引用) → 阶段4 归档/删除.
|
|
104
104
|
`;
|
|
105
105
|
}
|
|
106
106
|
export async function ensureContextOsDirs(home, agentId) {
|
|
@@ -94,19 +94,19 @@ function templateSummary(opts) {
|
|
|
94
94
|
const aiMsgs = opts.newMessages.filter(m => m.type === 'ai');
|
|
95
95
|
const userSnippet = userMsgs.slice(0, 3).map(m => ` - ${m.content.slice(0, 80)}`).join('\n');
|
|
96
96
|
const aiSnippet = aiMsgs.slice(0, 3).map(m => ` - ${m.content.slice(0, 80)}`).join('\n');
|
|
97
|
-
return `# Session 摘要 — ${opts.channelId} / ${opts.sessionId}
|
|
98
|
-
|
|
99
|
-
时间: ${opts.timestamp}
|
|
100
|
-
新增消息数: ${opts.newMessages.length} (user=${userMsgs.length}, ai=${aiMsgs.length})
|
|
101
|
-
|
|
102
|
-
## 用户关键提问
|
|
103
|
-
${userSnippet || ' (无)'}
|
|
104
|
-
|
|
105
|
-
## AI 关键回答
|
|
106
|
-
${aiSnippet || ' (无)'}
|
|
107
|
-
|
|
108
|
-
## 备注
|
|
109
|
-
- 此摘要由模板生成 (LLM 调用失败 fallback)
|
|
97
|
+
return `# Session 摘要 — ${opts.channelId} / ${opts.sessionId}
|
|
98
|
+
|
|
99
|
+
时间: ${opts.timestamp}
|
|
100
|
+
新增消息数: ${opts.newMessages.length} (user=${userMsgs.length}, ai=${aiMsgs.length})
|
|
101
|
+
|
|
102
|
+
## 用户关键提问
|
|
103
|
+
${userSnippet || ' (无)'}
|
|
104
|
+
|
|
105
|
+
## AI 关键回答
|
|
106
|
+
${aiSnippet || ' (无)'}
|
|
107
|
+
|
|
108
|
+
## 备注
|
|
109
|
+
- 此摘要由模板生成 (LLM 调用失败 fallback)
|
|
110
110
|
`;
|
|
111
111
|
}
|
|
112
112
|
/**
|
package/dist/cli-entry.js
CHANGED
|
@@ -50,42 +50,42 @@ function printBannerCli() {
|
|
|
50
50
|
printBanner(VERSION);
|
|
51
51
|
}
|
|
52
52
|
function printHelp() {
|
|
53
|
-
console.log(`
|
|
54
|
-
${BOLD}用法:${RESET}
|
|
55
|
-
bolloon [选项] [命令] [参数]
|
|
56
|
-
|
|
57
|
-
${BOLD}选项:${RESET}
|
|
58
|
-
--gui, -g 启动图形界面 (Electron)
|
|
59
|
-
--web, -w 启动 Web UI (浏览器)
|
|
60
|
-
--cli, -c 启动命令行界面
|
|
61
|
-
--version, -v 显示版本信息
|
|
62
|
-
--help, -h 显示帮助信息
|
|
63
|
-
|
|
64
|
-
${BOLD}命令:${RESET}
|
|
65
|
-
bolloon update [--now] 检查更新 / 立即更新 (bolloon update --now)
|
|
66
|
-
bolloon model [name] [model] 列出 / 切换模型供应商 (如: bolloon model deepseek deepseek-v4-flash)
|
|
67
|
-
bolloon read <file> 读取文档
|
|
68
|
-
bolloon summarize <file> 总结文档
|
|
69
|
-
bolloon improve <file> <req> 改进文档
|
|
70
|
-
bolloon engine list 列出外部编码智能体
|
|
71
|
-
bolloon engine run <prompt> 委派任务给智能体
|
|
72
|
-
bolloon x402 fetch <url> x402 自动支付 HTTP 请求
|
|
73
|
-
bolloon x402 balance <address> 查询 x402 钱包余额
|
|
74
|
-
|
|
75
|
-
${BOLD}示例:${RESET}
|
|
76
|
-
bolloon # 启动图形界面
|
|
77
|
-
bolloon --web # 启动 Web UI
|
|
78
|
-
bolloon --cli # 命令行模式
|
|
79
|
-
bolloon model # 查看当前模型供应商
|
|
80
|
-
bolloon model minimax # 切换到 MiniMax
|
|
81
|
-
bolloon update # 检查更新
|
|
82
|
-
bolloon update --now # 立即更新
|
|
83
|
-
|
|
84
|
-
${BOLD}环境变量:${RESET}
|
|
85
|
-
MINIMAX_API_KEY MiniMax API 密钥
|
|
86
|
-
OPENAI_API_KEY OpenAI API 密钥
|
|
87
|
-
ANTHROPIC_API_KEY Anthropic API 密钥
|
|
88
|
-
PORT Web 服务端口 (默认 54188)
|
|
53
|
+
console.log(`
|
|
54
|
+
${BOLD}用法:${RESET}
|
|
55
|
+
bolloon [选项] [命令] [参数]
|
|
56
|
+
|
|
57
|
+
${BOLD}选项:${RESET}
|
|
58
|
+
--gui, -g 启动图形界面 (Electron)
|
|
59
|
+
--web, -w 启动 Web UI (浏览器)
|
|
60
|
+
--cli, -c 启动命令行界面
|
|
61
|
+
--version, -v 显示版本信息
|
|
62
|
+
--help, -h 显示帮助信息
|
|
63
|
+
|
|
64
|
+
${BOLD}命令:${RESET}
|
|
65
|
+
bolloon update [--now] 检查更新 / 立即更新 (bolloon update --now)
|
|
66
|
+
bolloon model [name] [model] 列出 / 切换模型供应商 (如: bolloon model deepseek deepseek-v4-flash)
|
|
67
|
+
bolloon read <file> 读取文档
|
|
68
|
+
bolloon summarize <file> 总结文档
|
|
69
|
+
bolloon improve <file> <req> 改进文档
|
|
70
|
+
bolloon engine list 列出外部编码智能体
|
|
71
|
+
bolloon engine run <prompt> 委派任务给智能体
|
|
72
|
+
bolloon x402 fetch <url> x402 自动支付 HTTP 请求
|
|
73
|
+
bolloon x402 balance <address> 查询 x402 钱包余额
|
|
74
|
+
|
|
75
|
+
${BOLD}示例:${RESET}
|
|
76
|
+
bolloon # 启动图形界面
|
|
77
|
+
bolloon --web # 启动 Web UI
|
|
78
|
+
bolloon --cli # 命令行模式
|
|
79
|
+
bolloon model # 查看当前模型供应商
|
|
80
|
+
bolloon model minimax # 切换到 MiniMax
|
|
81
|
+
bolloon update # 检查更新
|
|
82
|
+
bolloon update --now # 立即更新
|
|
83
|
+
|
|
84
|
+
${BOLD}环境变量:${RESET}
|
|
85
|
+
MINIMAX_API_KEY MiniMax API 密钥
|
|
86
|
+
OPENAI_API_KEY OpenAI API 密钥
|
|
87
|
+
ANTHROPIC_API_KEY Anthropic API 密钥
|
|
88
|
+
PORT Web 服务端口 (默认 54188)
|
|
89
89
|
`);
|
|
90
90
|
}
|
|
91
91
|
function getDistDir() {
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"archive_root": "archive/claude_code_ts_snapshot/src",
|
|
3
|
+
"root_files": [
|
|
4
|
+
"QueryEngine.ts",
|
|
5
|
+
"Task.ts",
|
|
6
|
+
"Tool.ts",
|
|
7
|
+
"commands.ts",
|
|
8
|
+
"context.ts",
|
|
9
|
+
"cost-tracker.ts",
|
|
10
|
+
"costHook.ts",
|
|
11
|
+
"dialogLaunchers.tsx",
|
|
12
|
+
"history.ts",
|
|
13
|
+
"ink.ts",
|
|
14
|
+
"interactiveHelpers.tsx",
|
|
15
|
+
"main.tsx",
|
|
16
|
+
"projectOnboardingState.ts",
|
|
17
|
+
"query.ts",
|
|
18
|
+
"replLauncher.tsx",
|
|
19
|
+
"setup.ts",
|
|
20
|
+
"tasks.ts",
|
|
21
|
+
"tools.ts"
|
|
22
|
+
],
|
|
23
|
+
"root_dirs": [
|
|
24
|
+
"assistant",
|
|
25
|
+
"bootstrap",
|
|
26
|
+
"bridge",
|
|
27
|
+
"buddy",
|
|
28
|
+
"cli",
|
|
29
|
+
"commands",
|
|
30
|
+
"components",
|
|
31
|
+
"constants",
|
|
32
|
+
"context",
|
|
33
|
+
"coordinator",
|
|
34
|
+
"entrypoints",
|
|
35
|
+
"hooks",
|
|
36
|
+
"ink",
|
|
37
|
+
"keybindings",
|
|
38
|
+
"memdir",
|
|
39
|
+
"migrations",
|
|
40
|
+
"moreright",
|
|
41
|
+
"native-ts",
|
|
42
|
+
"outputStyles",
|
|
43
|
+
"plugins",
|
|
44
|
+
"query",
|
|
45
|
+
"remote",
|
|
46
|
+
"schemas",
|
|
47
|
+
"screens",
|
|
48
|
+
"server",
|
|
49
|
+
"services",
|
|
50
|
+
"skills",
|
|
51
|
+
"state",
|
|
52
|
+
"tasks",
|
|
53
|
+
"tools",
|
|
54
|
+
"types",
|
|
55
|
+
"upstreamproxy",
|
|
56
|
+
"utils",
|
|
57
|
+
"vim",
|
|
58
|
+
"voice"
|
|
59
|
+
],
|
|
60
|
+
"total_ts_like_files": 1902,
|
|
61
|
+
"command_entry_count": 207,
|
|
62
|
+
"tool_entry_count": 184
|
|
63
|
+
}
|