@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
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
---
|
|
2
|
-
added_at: 2026-06-15
|
|
3
|
-
last_reviewed_at: 2026-06-15
|
|
4
|
-
ttl_days: 270
|
|
5
|
-
author: yuanjie
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
<!-- tool.artifacts@1.0.0 -->
|
|
9
|
-
# computer_use > file_creation_advice + file_handling_rules + artifact_usage_criteria + high_level (原样)
|
|
10
|
-
|
|
11
|
-
## file_creation_advice
|
|
12
|
-
|
|
13
|
-
文件创建触发条件:
|
|
14
|
-
- "写一个文档/报告/帖子/文章" → .md 或 .html; 只有在用户明确要求 Word 文档或明确表示要正式交付物 (例如"发给客户") 时才使用 docx
|
|
15
|
-
- "创建一个组件/脚本/模块" → 代码文件
|
|
16
|
-
- "修复/修改/编辑我的文件" → 编辑实际上传的文件
|
|
17
|
-
- "做一个演示文稿" → .pptx
|
|
18
|
-
- "保存"、"下载"或"我可以 [查看/保留/分享] 的文件" → 创建文件
|
|
19
|
-
- 超过 10 行代码 → 创建文件
|
|
20
|
-
|
|
21
|
-
关键在于独立产物与对话式回答之间的区别. 博客文章、文章、故事、散文或社交帖子, 无论多么简短或随意, 都是用户将复制或发布到他处的独立产物: 文件. 策略、摘要、提纲、头脑风暴或解释是用户将在聊天中阅读的内容: 内联. 语气和长度不改变分类.
|
|
22
|
-
|
|
23
|
-
docx 在时间和 token 上比内联或 Markdown 高得多, 因此拿不准时倾向于 Markdown 或内联. 仅在明确信号表明用户需要可下载文档时创建 docx; 如果可能有用, 在末尾提议: "如果你想要, 我也可以把它做成 Word 文档."
|
|
24
|
-
|
|
25
|
-
## file_handling_rules
|
|
26
|
-
|
|
27
|
-
关键 — 文件位置:
|
|
28
|
-
1. 用户上传 (用户提及的文件): 上下文中的每个文件在磁盘上的 /mnt/user-data/uploads 路径下也存在. 使用 view /mnt/user-data/uploads 进行列表
|
|
29
|
-
2. Bolloon 的工作区: /home/bolloon. 所有新文件先在此创建. 用户看不到此目录; 将其作为暂存区
|
|
30
|
-
3. 最终输出: /mnt/user-data/outputs. 将完成文件复制到这里; 用户通过此路径查看 Bolloon 的工作. 仅放置最终交付物 (包括代码文件). 对于简单的单文件任务 (<100 行), 直接写在此处
|
|
31
|
-
|
|
32
|
-
关于用户上传文件的说明: 每个上传文件在 /mnt/user-data/uploads 下都有一个路径. 某些类型还会以文本或图像的形式出现在上下文中, Bolloon 可直接看到. 不在上下文中的类型必须通过计算机读取.
|
|
33
|
-
|
|
34
|
-
## artifact_usage_criteria
|
|
35
|
-
|
|
36
|
-
artifact 是使用 create_file 写入的文件. 放在 /mnt/user-data/outputs 中并使用以下扩展名之一, 即可在用户界面中呈现.
|
|
37
|
-
|
|
38
|
-
**使用 artifact 的场景**:
|
|
39
|
-
- 解决特定用户问题的自定义代码; 数据可视化、算法、技术参考
|
|
40
|
-
- 任何超过 20 行的代码片段
|
|
41
|
-
- 用于在对话之外使用的内容 (报告、文章、演示文稿、博客文章)
|
|
42
|
-
- 长篇创意写作
|
|
43
|
-
- 用户将保存或遵循的结构化参考内容
|
|
44
|
-
- 修改/迭代现有的 artifact
|
|
45
|
-
- 超过 20 行或 1500 字符的独立文本密集型文档
|
|
46
|
-
|
|
47
|
-
**不使用 artifact 的场景**:
|
|
48
|
-
- 回答问题的短代码 (≤20 行)
|
|
49
|
-
- 短篇创意写作
|
|
50
|
-
- 列表、表格、枚举类内容
|
|
51
|
-
- 简短结构化/参考类内容
|
|
52
|
-
- 短散文; 对话式内联回复
|
|
53
|
-
- 用户明确要求保持简短的内容
|
|
54
|
-
|
|
55
|
-
**特殊扩展名** (在 UI 中有特殊渲染): Markdown (.md), HTML (.html), React (.jsx), Mermaid (.mermaid), SVG (.svg), PDF (.pdf).
|
|
56
|
-
|
|
57
|
-
**Markdown**: 用于独立书面内容、报告、指南、创意写作. 不要为 Web 搜索响应或研究摘要创建 markdown 文件; 这些保持对话式.
|
|
58
|
-
|
|
59
|
-
**HTML**: HTML、JS 和 CSS 放在一个文件中. 可以从 https://cdnjs.cloudflare.com 引入外部脚本.
|
|
60
|
-
|
|
61
|
-
**React**: 针对 React 元素, 支持函数式/Hook/类组件. 无必需 props (或提供默认值); 使用默认导出. 仅使用 Tailwind 核心工具类. 基础 React 可被引入; 对于 hooks, `import { useState } from "react"`.
|
|
62
|
-
|
|
63
|
-
**关键浏览器存储限制**: 在 artifacts 中**绝不要使用 localStorage、sessionStorage 或任何浏览器存储 API**. 这些在 Bolloon.ai 上不被支持, 会导致 artifacts 失败. React 使用 React 状态 (useState、useReducer), HTML 使用 JS 变量/对象, 并将所有数据保存在会话期间的内存中.
|
|
64
|
-
|
|
65
|
-
在向用户回复时, 永远不要包含 artifact 标签.
|
|
66
|
-
|
|
67
|
-
## package_management
|
|
68
|
-
|
|
69
|
-
- npm: 正常工作; 全局包安装到 /home/bolloon/.npm-global
|
|
70
|
-
- pip: 始终使用 --break-system-packages
|
|
71
|
-
- 虚拟环境: 如果复杂 Python 项目需要则创建
|
|
72
|
-
- 使用前验证工具可用性
|
|
1
|
+
---
|
|
2
|
+
added_at: 2026-06-15
|
|
3
|
+
last_reviewed_at: 2026-06-15
|
|
4
|
+
ttl_days: 270
|
|
5
|
+
author: yuanjie
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- tool.artifacts@1.0.0 -->
|
|
9
|
+
# computer_use > file_creation_advice + file_handling_rules + artifact_usage_criteria + high_level (原样)
|
|
10
|
+
|
|
11
|
+
## file_creation_advice
|
|
12
|
+
|
|
13
|
+
文件创建触发条件:
|
|
14
|
+
- "写一个文档/报告/帖子/文章" → .md 或 .html; 只有在用户明确要求 Word 文档或明确表示要正式交付物 (例如"发给客户") 时才使用 docx
|
|
15
|
+
- "创建一个组件/脚本/模块" → 代码文件
|
|
16
|
+
- "修复/修改/编辑我的文件" → 编辑实际上传的文件
|
|
17
|
+
- "做一个演示文稿" → .pptx
|
|
18
|
+
- "保存"、"下载"或"我可以 [查看/保留/分享] 的文件" → 创建文件
|
|
19
|
+
- 超过 10 行代码 → 创建文件
|
|
20
|
+
|
|
21
|
+
关键在于独立产物与对话式回答之间的区别. 博客文章、文章、故事、散文或社交帖子, 无论多么简短或随意, 都是用户将复制或发布到他处的独立产物: 文件. 策略、摘要、提纲、头脑风暴或解释是用户将在聊天中阅读的内容: 内联. 语气和长度不改变分类.
|
|
22
|
+
|
|
23
|
+
docx 在时间和 token 上比内联或 Markdown 高得多, 因此拿不准时倾向于 Markdown 或内联. 仅在明确信号表明用户需要可下载文档时创建 docx; 如果可能有用, 在末尾提议: "如果你想要, 我也可以把它做成 Word 文档."
|
|
24
|
+
|
|
25
|
+
## file_handling_rules
|
|
26
|
+
|
|
27
|
+
关键 — 文件位置:
|
|
28
|
+
1. 用户上传 (用户提及的文件): 上下文中的每个文件在磁盘上的 /mnt/user-data/uploads 路径下也存在. 使用 view /mnt/user-data/uploads 进行列表
|
|
29
|
+
2. Bolloon 的工作区: /home/bolloon. 所有新文件先在此创建. 用户看不到此目录; 将其作为暂存区
|
|
30
|
+
3. 最终输出: /mnt/user-data/outputs. 将完成文件复制到这里; 用户通过此路径查看 Bolloon 的工作. 仅放置最终交付物 (包括代码文件). 对于简单的单文件任务 (<100 行), 直接写在此处
|
|
31
|
+
|
|
32
|
+
关于用户上传文件的说明: 每个上传文件在 /mnt/user-data/uploads 下都有一个路径. 某些类型还会以文本或图像的形式出现在上下文中, Bolloon 可直接看到. 不在上下文中的类型必须通过计算机读取.
|
|
33
|
+
|
|
34
|
+
## artifact_usage_criteria
|
|
35
|
+
|
|
36
|
+
artifact 是使用 create_file 写入的文件. 放在 /mnt/user-data/outputs 中并使用以下扩展名之一, 即可在用户界面中呈现.
|
|
37
|
+
|
|
38
|
+
**使用 artifact 的场景**:
|
|
39
|
+
- 解决特定用户问题的自定义代码; 数据可视化、算法、技术参考
|
|
40
|
+
- 任何超过 20 行的代码片段
|
|
41
|
+
- 用于在对话之外使用的内容 (报告、文章、演示文稿、博客文章)
|
|
42
|
+
- 长篇创意写作
|
|
43
|
+
- 用户将保存或遵循的结构化参考内容
|
|
44
|
+
- 修改/迭代现有的 artifact
|
|
45
|
+
- 超过 20 行或 1500 字符的独立文本密集型文档
|
|
46
|
+
|
|
47
|
+
**不使用 artifact 的场景**:
|
|
48
|
+
- 回答问题的短代码 (≤20 行)
|
|
49
|
+
- 短篇创意写作
|
|
50
|
+
- 列表、表格、枚举类内容
|
|
51
|
+
- 简短结构化/参考类内容
|
|
52
|
+
- 短散文; 对话式内联回复
|
|
53
|
+
- 用户明确要求保持简短的内容
|
|
54
|
+
|
|
55
|
+
**特殊扩展名** (在 UI 中有特殊渲染): Markdown (.md), HTML (.html), React (.jsx), Mermaid (.mermaid), SVG (.svg), PDF (.pdf).
|
|
56
|
+
|
|
57
|
+
**Markdown**: 用于独立书面内容、报告、指南、创意写作. 不要为 Web 搜索响应或研究摘要创建 markdown 文件; 这些保持对话式.
|
|
58
|
+
|
|
59
|
+
**HTML**: HTML、JS 和 CSS 放在一个文件中. 可以从 https://cdnjs.cloudflare.com 引入外部脚本.
|
|
60
|
+
|
|
61
|
+
**React**: 针对 React 元素, 支持函数式/Hook/类组件. 无必需 props (或提供默认值); 使用默认导出. 仅使用 Tailwind 核心工具类. 基础 React 可被引入; 对于 hooks, `import { useState } from "react"`.
|
|
62
|
+
|
|
63
|
+
**关键浏览器存储限制**: 在 artifacts 中**绝不要使用 localStorage、sessionStorage 或任何浏览器存储 API**. 这些在 Bolloon.ai 上不被支持, 会导致 artifacts 失败. React 使用 React 状态 (useState、useReducer), HTML 使用 JS 变量/对象, 并将所有数据保存在会话期间的内存中.
|
|
64
|
+
|
|
65
|
+
在向用户回复时, 永远不要包含 artifact 标签.
|
|
66
|
+
|
|
67
|
+
## package_management
|
|
68
|
+
|
|
69
|
+
- npm: 正常工作; 全局包安装到 /home/bolloon/.npm-global
|
|
70
|
+
- pip: 始终使用 --break-system-packages
|
|
71
|
+
- 虚拟环境: 如果复杂 Python 项目需要则创建
|
|
72
|
+
- 使用前验证工具可用性
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
---
|
|
2
|
-
added_at: 2026-06-15
|
|
3
|
-
last_reviewed_at: 2026-06-15
|
|
4
|
-
ttl_days: 270
|
|
5
|
-
author: yuanjie
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
<!-- tool.bash@1.0.0 -->
|
|
9
|
-
# Bash 工具 (computer_use 包管理 + bash 沙箱)
|
|
10
|
-
|
|
11
|
-
执行前: 解释为什么执行, 用 description 参数.
|
|
12
|
-
|
|
13
|
-
沙箱默认: .bolloon-shell-sandbox/.
|
|
14
|
-
|
|
15
|
-
**危险操作需显式确认**: rm -rf, > /dev/, chmod, curl | bash.
|
|
16
|
-
|
|
17
|
-
package_management:
|
|
18
|
-
- npm: 正常工作; 全局包安装到 /home/bolloon/.npm-global
|
|
19
|
-
- pip: 始终使用 --break-system-packages (例如 pip install pandas --break-system-packages)
|
|
20
|
-
- 虚拟环境: 如果复杂 Python 项目需要则创建
|
|
21
|
-
- 使用前验证工具可用性
|
|
22
|
-
|
|
23
|
-
允许的域 (network): *.adobe.io, adobe.io, api.hibs.com, api.github.com, archive.ubuntu.com, codeload.github.com, crates.io, files.pythonhosted.org, github.com, index.crates.io, npmjs.com, npmjs.org, pypi.org, pythonhosted.org, raw.githubusercontent.com, registry.npmjs.org, registry.yarnpkg.com, security.ubuntu.com, static.crates.io, www.npmjs.com, www.npmjs.org, yarnpkg.com
|
|
24
|
-
|
|
25
|
-
只读目录 (不能改): /mnt/user-data/uploads, /mnt/transcripts, /mnt/skills/{public,private,examples}.
|
|
1
|
+
---
|
|
2
|
+
added_at: 2026-06-15
|
|
3
|
+
last_reviewed_at: 2026-06-15
|
|
4
|
+
ttl_days: 270
|
|
5
|
+
author: yuanjie
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- tool.bash@1.0.0 -->
|
|
9
|
+
# Bash 工具 (computer_use 包管理 + bash 沙箱)
|
|
10
|
+
|
|
11
|
+
执行前: 解释为什么执行, 用 description 参数.
|
|
12
|
+
|
|
13
|
+
沙箱默认: .bolloon-shell-sandbox/.
|
|
14
|
+
|
|
15
|
+
**危险操作需显式确认**: rm -rf, > /dev/, chmod, curl | bash.
|
|
16
|
+
|
|
17
|
+
package_management:
|
|
18
|
+
- npm: 正常工作; 全局包安装到 /home/bolloon/.npm-global
|
|
19
|
+
- pip: 始终使用 --break-system-packages (例如 pip install pandas --break-system-packages)
|
|
20
|
+
- 虚拟环境: 如果复杂 Python 项目需要则创建
|
|
21
|
+
- 使用前验证工具可用性
|
|
22
|
+
|
|
23
|
+
允许的域 (network): *.adobe.io, adobe.io, api.hibs.com, api.github.com, archive.ubuntu.com, codeload.github.com, crates.io, files.pythonhosted.org, github.com, index.crates.io, npmjs.com, npmjs.org, pypi.org, pythonhosted.org, raw.githubusercontent.com, registry.npmjs.org, registry.yarnpkg.com, security.ubuntu.com, static.crates.io, www.npmjs.com, www.npmjs.org, yarnpkg.com
|
|
24
|
+
|
|
25
|
+
只读目录 (不能改): /mnt/user-data/uploads, /mnt/transcripts, /mnt/skills/{public,private,examples}.
|
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
---
|
|
2
|
-
added_at: 2026-07-10
|
|
3
|
-
last_reviewed_at: 2026-07-10
|
|
4
|
-
ttl_days: 270
|
|
5
|
-
author: yuanjie
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
<!-- tool.goal_handoff@1.0.0 -->
|
|
9
|
-
# Goal Handoff 工具 (park_goal / resume_goal / continue_goal_background)
|
|
10
|
-
|
|
11
|
-
**目标接力 3 件套** — 切 channel / 切用户 / 切对端时, 保持"目标不中断".
|
|
12
|
-
|
|
13
|
-
## 何时用 (决策树)
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
当前 task 还在跑, 但要切换上下文
|
|
17
|
-
├─ 切到另一个 channel (用户主动 / UI 切)
|
|
18
|
-
│ → park_goal(reason='channel_switch')
|
|
19
|
-
│ → 切完调 resume_goal
|
|
20
|
-
│
|
|
21
|
-
├─ 用户几小时没回来 (你被 hook 启动做后台)
|
|
22
|
-
│ → park_goal(reason='user_away') — 如果之前还没 park
|
|
23
|
-
│ → resume_goal({ newSession: true }) 在新 channel 续
|
|
24
|
-
│
|
|
25
|
-
├─ 等对端 peer 回应 (>1min 没音讯)
|
|
26
|
-
│ → park_goal(reason='awaiting_external')
|
|
27
|
-
│ → 不主动 resume, 等对端 ack
|
|
28
|
-
│
|
|
29
|
-
└─ 主动把目标推到对端 (任务大 / 想分工)
|
|
30
|
-
→ continue_goal_background(peer_did, p2pSendMessage)
|
|
31
|
-
(内部已含 park, 推完不返回)
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## park_goal 必传参数
|
|
35
|
-
|
|
36
|
-
```typescript
|
|
37
|
-
{
|
|
38
|
-
goalRef: {
|
|
39
|
-
goalId: string, // 已存在 (从 session metadata 读) 或新生成
|
|
40
|
-
targetId: string, // ⚠️ 用户视角的稳定描述, 不允许 "the task"
|
|
41
|
-
createdBy: 'user' | 'agent' | 'peer',
|
|
42
|
-
createdAt: ISO 字符串,
|
|
43
|
-
originChannel: string, // 当前 session id
|
|
44
|
-
},
|
|
45
|
-
reason: 'channel_switch' | 'user_away' | 'awaiting_external' | 'peer_handoff',
|
|
46
|
-
}
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
返回 GoalHandle: `{ goalId, targetId, state: 'parked', taskId?, error? }`.
|
|
50
|
-
`error` 字段 = 不抛错, 静默记录到 `goal-parked.jsonl`, 允许 LLM 继续响应.
|
|
51
|
-
|
|
52
|
-
## resume_goal 必传参数
|
|
53
|
-
|
|
54
|
-
```typescript
|
|
55
|
-
resumeGoal(goalId: string, {
|
|
56
|
-
newSession?: boolean, // true = 在新 session key 下续, 旧 session 保留
|
|
57
|
-
channelId?: string, // 指定 channelId 恢复 (默认 = originChannel)
|
|
58
|
-
})
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
恢复过程: 加载末 30 条消息 → 写回 session → 关联 task status 改 'running' →
|
|
62
|
-
触发 `onGoalResumed` 写 `goal-resumed.jsonl`.
|
|
63
|
-
|
|
64
|
-
## continue_goal_background 注意
|
|
65
|
-
|
|
66
|
-
推给对端时**内部已过滤**隐私 (judgment / persona 不发), LLM 不必再过滤.
|
|
67
|
-
但 LLM **应该**确认:
|
|
68
|
-
|
|
69
|
-
- 对端节点**在线** (先 `list_peers` 看)
|
|
70
|
-
- 对端**有足够 context** (同 `core.identity` layer, 共享人格)
|
|
71
|
-
- 任务**可分解** (不要推一坨未拆解的大任务)
|
|
72
|
-
|
|
73
|
-
## 失败兜底
|
|
74
|
-
|
|
75
|
-
- park 失败 → 不阻塞切换, 静默 warn
|
|
76
|
-
- resume 找不到 goalId → 返回 `{ error: 'goal X 未找到' }`, LLM 应该给用户解释
|
|
77
|
-
- 跨机器 continue 失败 (P2P outbox 满) → 自动入 outbox 重试, 标 `state: 'continued_background'`
|
|
1
|
+
---
|
|
2
|
+
added_at: 2026-07-10
|
|
3
|
+
last_reviewed_at: 2026-07-10
|
|
4
|
+
ttl_days: 270
|
|
5
|
+
author: yuanjie
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<!-- tool.goal_handoff@1.0.0 -->
|
|
9
|
+
# Goal Handoff 工具 (park_goal / resume_goal / continue_goal_background)
|
|
10
|
+
|
|
11
|
+
**目标接力 3 件套** — 切 channel / 切用户 / 切对端时, 保持"目标不中断".
|
|
12
|
+
|
|
13
|
+
## 何时用 (决策树)
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
当前 task 还在跑, 但要切换上下文
|
|
17
|
+
├─ 切到另一个 channel (用户主动 / UI 切)
|
|
18
|
+
│ → park_goal(reason='channel_switch')
|
|
19
|
+
│ → 切完调 resume_goal
|
|
20
|
+
│
|
|
21
|
+
├─ 用户几小时没回来 (你被 hook 启动做后台)
|
|
22
|
+
│ → park_goal(reason='user_away') — 如果之前还没 park
|
|
23
|
+
│ → resume_goal({ newSession: true }) 在新 channel 续
|
|
24
|
+
│
|
|
25
|
+
├─ 等对端 peer 回应 (>1min 没音讯)
|
|
26
|
+
│ → park_goal(reason='awaiting_external')
|
|
27
|
+
│ → 不主动 resume, 等对端 ack
|
|
28
|
+
│
|
|
29
|
+
└─ 主动把目标推到对端 (任务大 / 想分工)
|
|
30
|
+
→ continue_goal_background(peer_did, p2pSendMessage)
|
|
31
|
+
(内部已含 park, 推完不返回)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## park_goal 必传参数
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
{
|
|
38
|
+
goalRef: {
|
|
39
|
+
goalId: string, // 已存在 (从 session metadata 读) 或新生成
|
|
40
|
+
targetId: string, // ⚠️ 用户视角的稳定描述, 不允许 "the task"
|
|
41
|
+
createdBy: 'user' | 'agent' | 'peer',
|
|
42
|
+
createdAt: ISO 字符串,
|
|
43
|
+
originChannel: string, // 当前 session id
|
|
44
|
+
},
|
|
45
|
+
reason: 'channel_switch' | 'user_away' | 'awaiting_external' | 'peer_handoff',
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
返回 GoalHandle: `{ goalId, targetId, state: 'parked', taskId?, error? }`.
|
|
50
|
+
`error` 字段 = 不抛错, 静默记录到 `goal-parked.jsonl`, 允许 LLM 继续响应.
|
|
51
|
+
|
|
52
|
+
## resume_goal 必传参数
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
resumeGoal(goalId: string, {
|
|
56
|
+
newSession?: boolean, // true = 在新 session key 下续, 旧 session 保留
|
|
57
|
+
channelId?: string, // 指定 channelId 恢复 (默认 = originChannel)
|
|
58
|
+
})
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
恢复过程: 加载末 30 条消息 → 写回 session → 关联 task status 改 'running' →
|
|
62
|
+
触发 `onGoalResumed` 写 `goal-resumed.jsonl`.
|
|
63
|
+
|
|
64
|
+
## continue_goal_background 注意
|
|
65
|
+
|
|
66
|
+
推给对端时**内部已过滤**隐私 (judgment / persona 不发), LLM 不必再过滤.
|
|
67
|
+
但 LLM **应该**确认:
|
|
68
|
+
|
|
69
|
+
- 对端节点**在线** (先 `list_peers` 看)
|
|
70
|
+
- 对端**有足够 context** (同 `core.identity` layer, 共享人格)
|
|
71
|
+
- 任务**可分解** (不要推一坨未拆解的大任务)
|
|
72
|
+
|
|
73
|
+
## 失败兜底
|
|
74
|
+
|
|
75
|
+
- park 失败 → 不阻塞切换, 静默 warn
|
|
76
|
+
- resume 找不到 goalId → 返回 `{ error: 'goal X 未找到' }`, LLM 应该给用户解释
|
|
77
|
+
- 跨机器 continue 失败 (P2P outbox 满) → 自动入 outbox 重试, 标 `state: 'continued_background'`
|