@bolloon/bolloon-agent 0.4.5 → 0.4.7

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.
Files changed (208) hide show
  1. package/README.md +135 -135
  2. package/bin/bolloon-cli.cjs +183 -183
  3. package/bin/bolloon.cjs +0 -0
  4. package/bin/bolloon.js +157 -0
  5. package/dist/agents/constraint-layer.js +19 -19
  6. package/dist/agents/judgment-protocol.js +14 -14
  7. package/dist/agents/pi-sdk-tools.js +128 -46
  8. package/dist/agents/pi-sdk-types.js +12 -12
  9. package/dist/agents/pi-sdk.js +103 -90
  10. package/dist/agents/process-runner.js +105 -0
  11. package/dist/agents/skill-organizer.js +19 -19
  12. package/dist/agents/skill-writer.js +15 -3
  13. package/dist/agents/workflow-pivot-loop.js +13 -3
  14. package/dist/agents/write-staging.js +85 -0
  15. package/dist/bollharness/src/scripts/deploy-guard.js +8 -8
  16. package/dist/bollharness-integration/context-router-judgment.js +4 -4
  17. package/dist/bollharness-integration/context-router.js +292 -292
  18. package/dist/bollharness-integration/gate-state-machine.js +13 -13
  19. package/dist/bollharness-integration/llm-judgment-engine.js +134 -134
  20. package/dist/bollharness-integration/skill-adapter.js +21 -21
  21. package/dist/bootstrap/chat-archiver.js +14 -14
  22. package/dist/bootstrap/context-os.js +24 -24
  23. package/dist/bootstrap/memory-compressor.js +14 -14
  24. package/dist/cli/ink-app.js +18 -0
  25. package/dist/cli-entry.js +36 -36
  26. package/dist/context-compaction/auto-compact.js +7 -7
  27. package/dist/electron/first-run.js +54 -54
  28. package/dist/electron-build/electron/first-run.js +54 -54
  29. package/dist/electron-preload.js.map +1 -1
  30. package/dist/electron.js.map +1 -1
  31. package/dist/index.js +230 -137
  32. package/dist/llm/llm-judgment-client.js +102 -102
  33. package/dist/llm/pi-ai.js +48 -48
  34. package/dist/llm/system-prompt/layers/channel/human-async.md +41 -41
  35. package/dist/llm/system-prompt/layers/channel/local.md +14 -14
  36. package/dist/llm/system-prompt/layers/channel/p2p-agent.md +18 -18
  37. package/dist/llm/system-prompt/layers/channel/p2p-peer-sync.md +51 -51
  38. package/dist/llm/system-prompt/layers/channel/p2p-proactive.md +43 -43
  39. package/dist/llm/system-prompt/layers/channel/p2p-visitor.md +19 -19
  40. package/dist/llm/system-prompt/layers/channel/session-handoff.md +61 -61
  41. package/dist/llm/system-prompt/layers/core/artifacts_storage.md +89 -89
  42. package/dist/llm/system-prompt/layers/core/evenhandedness.md +21 -21
  43. package/dist/llm/system-prompt/layers/core/external-engagement.md +73 -73
  44. package/dist/llm/system-prompt/layers/core/hibs_reminders.md +15 -15
  45. package/dist/llm/system-prompt/layers/core/identity.md +48 -48
  46. package/dist/llm/system-prompt/layers/core/knowledge.md +17 -17
  47. package/dist/llm/system-prompt/layers/core/memory_system.md +12 -12
  48. package/dist/llm/system-prompt/layers/core/network_filesystem.md +28 -28
  49. package/dist/llm/system-prompt/layers/core/refusal.md +37 -37
  50. package/dist/llm/system-prompt/layers/core/tone.md +31 -31
  51. package/dist/llm/system-prompt/layers/core/tools.thin.md +13 -13
  52. package/dist/llm/system-prompt/layers/core/wellbeing.md +41 -41
  53. package/dist/llm/system-prompt/layers/role/architect.md +20 -20
  54. package/dist/llm/system-prompt/layers/role/expert.md +19 -19
  55. package/dist/llm/system-prompt/layers/role/implementer.md +15 -15
  56. package/dist/llm/system-prompt/layers/role/security.md +15 -15
  57. package/dist/llm/system-prompt/layers/tool/artifacts.md +72 -72
  58. package/dist/llm/system-prompt/layers/tool/bash.md +25 -25
  59. package/dist/llm/system-prompt/layers/tool/goal_handoff.md +77 -77
  60. package/dist/llm/system-prompt/layers/tool/hibs_api.md +171 -171
  61. package/dist/llm/system-prompt/layers/tool/image_search.md +70 -70
  62. package/dist/llm/system-prompt/layers/tool/manifest.md +89 -89
  63. package/dist/llm/system-prompt/layers/tool/mcp_apps.md +53 -53
  64. package/dist/llm/system-prompt/layers/tool/p2p_request.md +61 -61
  65. package/dist/llm/system-prompt/layers/tool/web_search.md +83 -83
  66. package/dist/llm/tool-manifest/ask_user_input.js +1 -1
  67. package/dist/llm/tool-manifest/bash.js +3 -3
  68. package/dist/llm/tool-manifest/create_file.js +4 -4
  69. package/dist/llm/tool-manifest/fetch_sports_data.js +3 -3
  70. package/dist/llm/tool-manifest/image_search.js +2 -2
  71. package/dist/llm/tool-manifest/index.js +0 -59
  72. package/dist/llm/tool-manifest/mcp.js +2 -2
  73. package/dist/llm/tool-manifest/message_compose.js +3 -3
  74. package/dist/llm/tool-manifest/places.js +2 -2
  75. package/dist/llm/tool-manifest/present_files.js +1 -1
  76. package/dist/llm/tool-manifest/recipe.js +2 -2
  77. package/dist/llm/tool-manifest/str_replace.js +5 -5
  78. package/dist/llm/tool-manifest/view.js +3 -3
  79. package/dist/llm/tool-manifest/weather.js +4 -4
  80. package/dist/llm/tool-manifest/web.js +4 -4
  81. package/dist/orbitdb/agent-tools.js +139 -0
  82. package/dist/orbitdb/kanban-store.js +259 -0
  83. package/dist/orbitdb/task-store.js +112 -0
  84. package/dist/pi-ecosystem-colony/index.js +365 -0
  85. package/dist/pi-ecosystem-judgment/causal-judge.js +51 -51
  86. package/dist/pi-ecosystem-judgment/distill-prompt.js +42 -42
  87. package/dist/pi-ecosystem-judgment/distillation.js +14 -14
  88. package/dist/pi-ecosystem-judgment/monitor-gate.js +28 -28
  89. package/dist/pi-ecosystem-judgment/value-injection.js +102 -102
  90. package/dist/security/context-router-tool.js +15 -15
  91. package/dist/security/tool-gate.js +2 -0
  92. package/dist/social/ant-colony/AdaptiveHeartbeat.js +101 -0
  93. package/dist/social/ant-colony/PheromoneEngine.js +227 -0
  94. package/dist/social/ant-colony/index.js +6 -0
  95. package/dist/social/ant-colony/types.js +24 -0
  96. package/dist/storage/trajectory.js +101 -0
  97. package/dist/test/ai-judgment-test.js +80 -0
  98. package/dist/test/bollharness-integration.test.js +318 -0
  99. package/dist/test/channel-agent-multi-dialogue.js +205 -0
  100. package/dist/test/channel-heartbeat-agent-test.js +201 -0
  101. package/dist/test/constraint-layer.test.js +164 -0
  102. package/dist/test/diap-identity-test.js +172 -0
  103. package/dist/test/diap-quick-test.js +62 -0
  104. package/dist/test/global-shared-context.test.js +315 -0
  105. package/dist/test/harness-judgment-injection.test.js +246 -0
  106. package/dist/test/harness-workflow-integrator-test.js +228 -0
  107. package/dist/test/human-value-store.test.js +243 -0
  108. package/dist/test/hybrid-integration-test.js +118 -0
  109. package/dist/test/hybrid-messenger-verify.js +55 -0
  110. package/dist/test/iroh-bistream-debug.js +38 -0
  111. package/dist/test/iroh-communication.test.js +66 -0
  112. package/dist/test/iroh-debug-test.js +57 -0
  113. package/dist/test/iroh-diap-test.js +71 -0
  114. package/dist/test/iroh-direct-connect.js +55 -0
  115. package/dist/test/iroh-e2e-fixed.js +89 -0
  116. package/dist/test/iroh-e2e-same-process.js +63 -0
  117. package/dist/test/iroh-e2e.js +66 -0
  118. package/dist/test/iroh-final-e2e.js +72 -0
  119. package/dist/test/iroh-relay-test.js +37 -0
  120. package/dist/test/iroh-simple-test.js +41 -0
  121. package/dist/test/iroh-transport-verify.js +54 -0
  122. package/dist/test/iroh-transport.test.js +37 -0
  123. package/dist/test/iroh-two-nodes.js +70 -0
  124. package/dist/test/iroh-verify.js +44 -0
  125. package/dist/test/judgment-decision.test.js +219 -0
  126. package/dist/test/llm-judgment-integration.test.js +220 -0
  127. package/dist/test/p2p-agent-complex-dialogue.js +385 -0
  128. package/dist/test/p2p-agent-dialogue.js +341 -0
  129. package/dist/test/p2p-agent-full-bidirectional.js +510 -0
  130. package/dist/test/p2p-agent-harness-flow.js +437 -0
  131. package/dist/test/p2p-agent-harness-single.js +143 -0
  132. package/dist/test/p2p-ai-dialogue-test.js +318 -0
  133. package/dist/test/p2p-cid-connect-test.js +195 -0
  134. package/dist/test/p2p-connect-receiver.js +69 -0
  135. package/dist/test/p2p-doc-transfer.js +110 -0
  136. package/dist/test/p2p-identity-page-test.js +77 -0
  137. package/dist/test/p2p-iroh-test.js +171 -0
  138. package/dist/test/p2p-minimal-test.js +241 -0
  139. package/dist/test/p2p-node-1.js +148 -0
  140. package/dist/test/p2p-node-2.js +148 -0
  141. package/dist/test/p2p-server.js +281 -0
  142. package/dist/test/p2p-two-nodes-test.js +438 -0
  143. package/dist/test/pi-sdk.test.js +44 -0
  144. package/dist/test/set-persona.js +40 -0
  145. package/dist/test/simple.test.js +9 -0
  146. package/dist/test/storage-integration.test.js +150 -0
  147. package/dist/test/subagent-manager.test.js +276 -0
  148. package/dist/test/test-gate-flow.test.js +81 -0
  149. package/dist/test/workflow-engine.test.js +87 -0
  150. package/dist/test/workflow-pivot-loop.test.js +246 -0
  151. package/dist/web/api-config.html +779 -779
  152. package/dist/web/client-hearth.js +10 -10
  153. package/dist/web/components/wallet-viem.mjs +118 -118
  154. package/dist/web/index.html +472 -472
  155. package/dist/web/manifest.json +20 -20
  156. package/dist/web/server-storage.js +29 -0
  157. package/dist/web/server.js +30 -14
  158. package/dist/web/style.css +4946 -4946
  159. package/package.json +195 -195
  160. package/scripts/build-cli.js +215 -215
  161. package/scripts/build-web.ts +130 -130
  162. package/scripts/postinstall.js +152 -152
  163. package/bin/bolloon-daemon.sh +0 -207
  164. package/dist/constraint-runtime/reference_data/archive_surface_snapshot.json +0 -63
  165. package/dist/constraint-runtime/reference_data/commands_snapshot.json +0 -1037
  166. package/dist/constraint-runtime/reference_data/subsystems/assistant.json +0 -8
  167. package/dist/constraint-runtime/reference_data/subsystems/bootstrap.json +0 -8
  168. package/dist/constraint-runtime/reference_data/subsystems/bridge.json +0 -32
  169. package/dist/constraint-runtime/reference_data/subsystems/buddy.json +0 -13
  170. package/dist/constraint-runtime/reference_data/subsystems/cli.json +0 -26
  171. package/dist/constraint-runtime/reference_data/subsystems/components.json +0 -32
  172. package/dist/constraint-runtime/reference_data/subsystems/constants.json +0 -28
  173. package/dist/constraint-runtime/reference_data/subsystems/coordinator.json +0 -8
  174. package/dist/constraint-runtime/reference_data/subsystems/entrypoints.json +0 -15
  175. package/dist/constraint-runtime/reference_data/subsystems/hooks.json +0 -32
  176. package/dist/constraint-runtime/reference_data/subsystems/keybindings.json +0 -21
  177. package/dist/constraint-runtime/reference_data/subsystems/memdir.json +0 -15
  178. package/dist/constraint-runtime/reference_data/subsystems/migrations.json +0 -18
  179. package/dist/constraint-runtime/reference_data/subsystems/moreright.json +0 -8
  180. package/dist/constraint-runtime/reference_data/subsystems/native_ts.json +0 -11
  181. package/dist/constraint-runtime/reference_data/subsystems/outputStyles.json +0 -8
  182. package/dist/constraint-runtime/reference_data/subsystems/plugins.json +0 -9
  183. package/dist/constraint-runtime/reference_data/subsystems/remote.json +0 -11
  184. package/dist/constraint-runtime/reference_data/subsystems/schemas.json +0 -8
  185. package/dist/constraint-runtime/reference_data/subsystems/screens.json +0 -10
  186. package/dist/constraint-runtime/reference_data/subsystems/server.json +0 -10
  187. package/dist/constraint-runtime/reference_data/subsystems/services.json +0 -32
  188. package/dist/constraint-runtime/reference_data/subsystems/skills.json +0 -27
  189. package/dist/constraint-runtime/reference_data/subsystems/state.json +0 -13
  190. package/dist/constraint-runtime/reference_data/subsystems/types.json +0 -18
  191. package/dist/constraint-runtime/reference_data/subsystems/upstreamproxy.json +0 -9
  192. package/dist/constraint-runtime/reference_data/subsystems/utils.json +0 -32
  193. package/dist/constraint-runtime/reference_data/subsystems/vim.json +0 -12
  194. package/dist/constraint-runtime/reference_data/subsystems/voice.json +0 -8
  195. package/dist/constraint-runtime/reference_data/tools_snapshot.json +0 -922
  196. package/dist/electron/config.js.map +0 -1
  197. package/dist/electron/dialogs.js.map +0 -1
  198. package/dist/electron/first-run.js.map +0 -1
  199. package/dist/electron/ipc.js.map +0 -1
  200. package/dist/electron/logger.js.map +0 -1
  201. package/dist/electron/main.js.map +0 -1
  202. package/dist/electron/menu.js.map +0 -1
  203. package/dist/electron/paths.js.map +0 -1
  204. package/dist/electron/server.js.map +0 -1
  205. package/dist/electron/tray.js.map +0 -1
  206. package/dist/electron/window.js.map +0 -1
  207. package/dist/utils/auto-update.js.map +0 -1
  208. package/dist/web/client.js.map +0 -7
@@ -1,207 +0,0 @@
1
- #!/bin/bash
2
- # Bolloon Daemon - 守护进程启动脚本
3
- # 支持自动重启、日志轮转、PID 管理
4
-
5
- set -e
6
-
7
- APP_NAME="bolloon"
8
- APP_DIR="$(cd "$(dirname "$0")/.." && pwd)"
9
- PID_FILE="$HOME/.bolloon/daemon.pid"
10
- LOG_FILE="$HOME/.bolloon/daemon.log"
11
- MAX_RESTARTS=5
12
- RESTART_DELAY=5
13
-
14
- # 颜色输出
15
- RED='\033[0;31m'
16
- GREEN='\033[0;32m'
17
- YELLOW='\033[1;33m'
18
- NC='\033[0m' # No Color
19
-
20
- log() {
21
- echo -e "${GREEN}[$(date '+%Y-%m-%d %H:%M:%S')]${NC} $1"
22
- }
23
-
24
- warn() {
25
- echo -e "${YELLOW}[$(date '+%Y-%m-%d %H:%M:%S')] WARN:${NC} $1"
26
- }
27
-
28
- error() {
29
- echo -e "${RED}[$(date '+%Y-%m-%d %H:%M:%S')] ERROR:${NC} $1"
30
- }
31
-
32
- # 获取 PID
33
- get_pid() {
34
- if [ -f "$PID_FILE" ]; then
35
- cat "$PID_FILE"
36
- fi
37
- }
38
-
39
- # 检查进程是否运行
40
- is_running() {
41
- local pid=$(get_pid)
42
- if [ -n "$pid" ] && kill -0 "$pid" 2>/dev/null; then
43
- return 0
44
- fi
45
- return 1
46
- }
47
-
48
- # 启动守护进程
49
- start() {
50
- if is_running; then
51
- log "Bolloon 已在运行 (PID: $(get_pid))"
52
- return 0
53
- fi
54
-
55
- log "启动 Bolloon 守护进程..."
56
-
57
- # 确保日志目录存在
58
- mkdir -p "$(dirname "$LOG_FILE")"
59
-
60
- # 启动进程
61
- cd "$APP_DIR"
62
- nohup npx tsx src/index.ts >> "$LOG_FILE" 2>&1 &
63
- local pid=$!
64
-
65
- # 保存 PID
66
- echo "$pid" > "$PID_FILE"
67
- log "Bolloon 已启动 (PID: $pid)"
68
- log "日志文件: $LOG_FILE"
69
- }
70
-
71
- # 停止守护进程
72
- stop() {
73
- local pid=$(get_pid)
74
-
75
- if [ -z "$pid" ]; then
76
- warn "Bolloon 未运行"
77
- return 0
78
- fi
79
-
80
- log "停止 Bolloon (PID: $pid)..."
81
-
82
- # 发送 SIGTERM
83
- kill -TERM "$pid" 2>/dev/null || true
84
-
85
- # 等待进程退出
86
- local count=0
87
- while kill -0 "$pid" 2>/dev/null && [ $count -lt 10 ]; do
88
- sleep 1
89
- count=$((count + 1))
90
- done
91
-
92
- # 如果还在运行,强制终止
93
- if kill -0 "$pid" 2>/dev/null; then
94
- warn "进程未响应,发送 SIGKILL..."
95
- kill -KILL "$pid" 2>/dev/null || true
96
- fi
97
-
98
- # 清理 PID 文件
99
- rm -f "$PID_FILE"
100
- log "Bolloon 已停止"
101
- }
102
-
103
- # 重启守护进程
104
- restart() {
105
- log "重启 Bolloon..."
106
- stop
107
- sleep 2
108
- start
109
- }
110
-
111
- # 查看状态
112
- status() {
113
- if is_running; then
114
- log "Bolloon 运行中 (PID: $(get_pid))"
115
- # 显示资源使用
116
- local pid=$(get_pid)
117
- if [ -n "$pid" ]; then
118
- ps -p "$pid" -o %cpu,%mem,etime 2>/dev/null | tail -1 || true
119
- fi
120
- else
121
- warn "Bolloon 未运行"
122
- fi
123
- }
124
-
125
- # 查看日志
126
- logs() {
127
- if [ -f "$LOG_FILE" ]; then
128
- tail -100 "$LOG_FILE"
129
- else
130
- warn "日志文件不存在: $LOG_FILE"
131
- fi
132
- }
133
-
134
- # 健康检查
135
- health() {
136
- local port=${PORT:-54188}
137
- local response=$(curl -s -o /dev/null -w "%{http_code}" "http://localhost:$port/api/health" 2>/dev/null || echo "000")
138
-
139
- if [ "$response" = "200" ]; then
140
- log "健康检查通过"
141
- curl -s "http://localhost:$port/api/health" 2>/dev/null | head -5
142
- else
143
- error "健康检查失败 (HTTP $response)"
144
- return 1
145
- fi
146
- }
147
-
148
- # 清理日志
149
- clean_logs() {
150
- if [ -f "$LOG_FILE" ]; then
151
- local size=$(du -h "$LOG_FILE" | cut -f1)
152
- log "当前日志大小: $size"
153
- > "$LOG_FILE"
154
- log "日志已清空"
155
- fi
156
- }
157
-
158
- # 显示帮助
159
- show_help() {
160
- echo "Bolloon Daemon 守护进程管理脚本"
161
- echo ""
162
- echo "用法: $0 [命令]"
163
- echo ""
164
- echo "命令:"
165
- echo " start 启动 Bolloon 守护进程"
166
- echo " stop 停止 Bolloon 守护进程"
167
- echo " restart 重启 Bolloon 守护进程"
168
- echo " status 查看运行状态"
169
- echo " logs 查看最近日志"
170
- echo " health 健康检查"
171
- echo " clean 清空日志"
172
- echo " help 显示帮助"
173
- echo ""
174
- }
175
-
176
- # 主逻辑
177
- case "${1:-help}" in
178
- start)
179
- start
180
- ;;
181
- stop)
182
- stop
183
- ;;
184
- restart)
185
- restart
186
- ;;
187
- status)
188
- status
189
- ;;
190
- logs)
191
- logs
192
- ;;
193
- health)
194
- health
195
- ;;
196
- clean)
197
- clean_logs
198
- ;;
199
- help|--help|-h)
200
- show_help
201
- ;;
202
- *)
203
- error "未知命令: $1"
204
- show_help
205
- exit 1
206
- ;;
207
- esac
@@ -1,63 +0,0 @@
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
- }