@bolloon/bolloon-agent 0.4.5 → 0.4.6
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 +135 -135
- package/bin/bolloon-cli.cjs +183 -183
- package/bin/bolloon.cjs +0 -0
- package/bin/bolloon.js +157 -0
- package/dist/agents/constraint-layer.js +19 -19
- package/dist/agents/judgment-protocol.js +14 -14
- package/dist/agents/pi-sdk-tools.js +62 -45
- package/dist/agents/pi-sdk-types.js +12 -12
- package/dist/agents/pi-sdk.js +103 -90
- package/dist/agents/skill-organizer.js +19 -19
- package/dist/agents/skill-writer.js +15 -3
- package/dist/agents/workflow-pivot-loop.js +13 -3
- 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 +14 -14
- package/dist/cli/ink-app.js +18 -0
- package/dist/cli-entry.js +36 -36
- package/dist/context-compaction/auto-compact.js +7 -7
- package/dist/electron/first-run.js +54 -54
- 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 +222 -138
- 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 +0 -59
- 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/orbitdb/agent-tools.js +139 -0
- package/dist/orbitdb/kanban-store.js +259 -0
- package/dist/orbitdb/task-store.js +112 -0
- package/dist/pi-ecosystem-colony/index.js +365 -0
- 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/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/security/tool-gate.js +2 -0
- package/dist/social/ant-colony/AdaptiveHeartbeat.js +101 -0
- package/dist/social/ant-colony/PheromoneEngine.js +227 -0
- package/dist/social/ant-colony/index.js +6 -0
- package/dist/social/ant-colony/types.js +24 -0
- package/dist/storage/trajectory.js +101 -0
- package/dist/test/ai-judgment-test.js +80 -0
- package/dist/test/bollharness-integration.test.js +318 -0
- package/dist/test/channel-agent-multi-dialogue.js +205 -0
- package/dist/test/channel-heartbeat-agent-test.js +201 -0
- package/dist/test/constraint-layer.test.js +164 -0
- package/dist/test/diap-identity-test.js +172 -0
- package/dist/test/diap-quick-test.js +62 -0
- package/dist/test/global-shared-context.test.js +315 -0
- package/dist/test/harness-judgment-injection.test.js +246 -0
- package/dist/test/harness-workflow-integrator-test.js +228 -0
- package/dist/test/human-value-store.test.js +243 -0
- package/dist/test/hybrid-integration-test.js +118 -0
- package/dist/test/hybrid-messenger-verify.js +55 -0
- package/dist/test/iroh-bistream-debug.js +38 -0
- package/dist/test/iroh-communication.test.js +66 -0
- package/dist/test/iroh-debug-test.js +57 -0
- package/dist/test/iroh-diap-test.js +71 -0
- package/dist/test/iroh-direct-connect.js +55 -0
- package/dist/test/iroh-e2e-fixed.js +89 -0
- package/dist/test/iroh-e2e-same-process.js +63 -0
- package/dist/test/iroh-e2e.js +66 -0
- package/dist/test/iroh-final-e2e.js +72 -0
- package/dist/test/iroh-relay-test.js +37 -0
- package/dist/test/iroh-simple-test.js +41 -0
- package/dist/test/iroh-transport-verify.js +54 -0
- package/dist/test/iroh-transport.test.js +37 -0
- package/dist/test/iroh-two-nodes.js +70 -0
- package/dist/test/iroh-verify.js +44 -0
- package/dist/test/judgment-decision.test.js +219 -0
- package/dist/test/llm-judgment-integration.test.js +220 -0
- package/dist/test/p2p-agent-complex-dialogue.js +385 -0
- package/dist/test/p2p-agent-dialogue.js +341 -0
- package/dist/test/p2p-agent-full-bidirectional.js +510 -0
- package/dist/test/p2p-agent-harness-flow.js +437 -0
- package/dist/test/p2p-agent-harness-single.js +143 -0
- package/dist/test/p2p-ai-dialogue-test.js +318 -0
- package/dist/test/p2p-cid-connect-test.js +195 -0
- package/dist/test/p2p-connect-receiver.js +69 -0
- package/dist/test/p2p-doc-transfer.js +110 -0
- package/dist/test/p2p-identity-page-test.js +77 -0
- package/dist/test/p2p-iroh-test.js +171 -0
- package/dist/test/p2p-minimal-test.js +241 -0
- package/dist/test/p2p-node-1.js +148 -0
- package/dist/test/p2p-node-2.js +148 -0
- package/dist/test/p2p-server.js +281 -0
- package/dist/test/p2p-two-nodes-test.js +438 -0
- package/dist/test/pi-sdk.test.js +44 -0
- package/dist/test/set-persona.js +40 -0
- package/dist/test/simple.test.js +9 -0
- package/dist/test/storage-integration.test.js +150 -0
- package/dist/test/subagent-manager.test.js +276 -0
- package/dist/test/test-gate-flow.test.js +81 -0
- package/dist/test/workflow-engine.test.js +87 -0
- package/dist/test/workflow-pivot-loop.test.js +246 -0
- package/dist/web/api-config.html +779 -779
- package/dist/web/client-hearth.js +10 -10
- package/dist/web/components/wallet-viem.mjs +118 -118
- package/dist/web/index.html +472 -472
- package/dist/web/manifest.json +20 -20
- package/dist/web/server-storage.js +29 -0
- package/dist/web/server.js +30 -14
- package/dist/web/style.css +4946 -4946
- package/package.json +195 -195
- package/scripts/build-cli.js +215 -215
- package/scripts/build-web.ts +130 -130
- package/scripts/postinstall.js +152 -152
- package/bin/bolloon-daemon.sh +0 -207
- package/dist/constraint-runtime/reference_data/archive_surface_snapshot.json +0 -63
- package/dist/constraint-runtime/reference_data/commands_snapshot.json +0 -1037
- package/dist/constraint-runtime/reference_data/subsystems/assistant.json +0 -8
- package/dist/constraint-runtime/reference_data/subsystems/bootstrap.json +0 -8
- package/dist/constraint-runtime/reference_data/subsystems/bridge.json +0 -32
- package/dist/constraint-runtime/reference_data/subsystems/buddy.json +0 -13
- package/dist/constraint-runtime/reference_data/subsystems/cli.json +0 -26
- package/dist/constraint-runtime/reference_data/subsystems/components.json +0 -32
- package/dist/constraint-runtime/reference_data/subsystems/constants.json +0 -28
- package/dist/constraint-runtime/reference_data/subsystems/coordinator.json +0 -8
- package/dist/constraint-runtime/reference_data/subsystems/entrypoints.json +0 -15
- package/dist/constraint-runtime/reference_data/subsystems/hooks.json +0 -32
- package/dist/constraint-runtime/reference_data/subsystems/keybindings.json +0 -21
- package/dist/constraint-runtime/reference_data/subsystems/memdir.json +0 -15
- package/dist/constraint-runtime/reference_data/subsystems/migrations.json +0 -18
- package/dist/constraint-runtime/reference_data/subsystems/moreright.json +0 -8
- package/dist/constraint-runtime/reference_data/subsystems/native_ts.json +0 -11
- package/dist/constraint-runtime/reference_data/subsystems/outputStyles.json +0 -8
- package/dist/constraint-runtime/reference_data/subsystems/plugins.json +0 -9
- package/dist/constraint-runtime/reference_data/subsystems/remote.json +0 -11
- package/dist/constraint-runtime/reference_data/subsystems/schemas.json +0 -8
- package/dist/constraint-runtime/reference_data/subsystems/screens.json +0 -10
- package/dist/constraint-runtime/reference_data/subsystems/server.json +0 -10
- package/dist/constraint-runtime/reference_data/subsystems/services.json +0 -32
- package/dist/constraint-runtime/reference_data/subsystems/skills.json +0 -27
- package/dist/constraint-runtime/reference_data/subsystems/state.json +0 -13
- package/dist/constraint-runtime/reference_data/subsystems/types.json +0 -18
- package/dist/constraint-runtime/reference_data/subsystems/upstreamproxy.json +0 -9
- package/dist/constraint-runtime/reference_data/subsystems/utils.json +0 -32
- package/dist/constraint-runtime/reference_data/subsystems/vim.json +0 -12
- package/dist/constraint-runtime/reference_data/subsystems/voice.json +0 -8
- package/dist/constraint-runtime/reference_data/tools_snapshot.json +0 -922
- package/dist/electron/config.js.map +0 -1
- package/dist/electron/dialogs.js.map +0 -1
- package/dist/electron/first-run.js.map +0 -1
- package/dist/electron/ipc.js.map +0 -1
- package/dist/electron/logger.js.map +0 -1
- package/dist/electron/main.js.map +0 -1
- package/dist/electron/menu.js.map +0 -1
- package/dist/electron/paths.js.map +0 -1
- package/dist/electron/server.js.map +0 -1
- package/dist/electron/tray.js.map +0 -1
- package/dist/electron/window.js.map +0 -1
- package/dist/utils/auto-update.js.map +0 -1
- package/dist/web/client.js.map +0 -7
package/dist/web/manifest.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "Bolloon Agent",
|
|
3
|
-
"short_name": "Bolloon",
|
|
4
|
-
"description": "AI Agent with Claude API integration",
|
|
5
|
-
"start_url": "/",
|
|
6
|
-
"display": "standalone",
|
|
7
|
-
"background_color": "#1a1a2e",
|
|
8
|
-
"theme_color": "#1a1a2e",
|
|
9
|
-
"icons": [
|
|
10
|
-
{
|
|
11
|
-
"src": "/icons/favicon-192x192.png",
|
|
12
|
-
"sizes": "192x192",
|
|
13
|
-
"type": "image/png"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"src": "/icons/favicon-512x512.png",
|
|
17
|
-
"sizes": "512x512",
|
|
18
|
-
"type": "image/png"
|
|
19
|
-
}
|
|
20
|
-
]
|
|
1
|
+
{
|
|
2
|
+
"name": "Bolloon Agent",
|
|
3
|
+
"short_name": "Bolloon",
|
|
4
|
+
"description": "AI Agent with Claude API integration",
|
|
5
|
+
"start_url": "/",
|
|
6
|
+
"display": "standalone",
|
|
7
|
+
"background_color": "#1a1a2e",
|
|
8
|
+
"theme_color": "#1a1a2e",
|
|
9
|
+
"icons": [
|
|
10
|
+
{
|
|
11
|
+
"src": "/icons/favicon-192x192.png",
|
|
12
|
+
"sizes": "192x192",
|
|
13
|
+
"type": "image/png"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"src": "/icons/favicon-512x512.png",
|
|
17
|
+
"sizes": "512x512",
|
|
18
|
+
"type": "image/png"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
21
|
}
|
|
@@ -168,7 +168,27 @@ export function isTaskExecuting() {
|
|
|
168
168
|
export function getExecutingTaskId() {
|
|
169
169
|
return executionTaskId;
|
|
170
170
|
}
|
|
171
|
+
// ==================== 任务队列 ====================
|
|
172
|
+
// 2026-08-12 (Task6): 任务队列以 OrbitDB 为主存储 (去中心化/跨设备同步), 本地文件作 fallback.
|
|
173
|
+
// orbit 由 server 启动时 warmTaskOrbitStore() 预热成功后调 markTaskOrbitReady() 置位;
|
|
174
|
+
// 未置位 (测试/离线) 自动回退本地文件.
|
|
175
|
+
let _taskOrbitReady = false;
|
|
176
|
+
/** server 启动 warm 成功后调用, 启用 orbitdb 主存储 (测试可调用 disableTaskOrbitStore 关闭) */
|
|
177
|
+
export function markTaskOrbitReady() { _taskOrbitReady = true; }
|
|
178
|
+
/** 禁用 orbitdb 任务存储 (测试隔离用) */
|
|
179
|
+
export function disableTaskOrbitStore() { _taskOrbitReady = false; }
|
|
180
|
+
function taskOrbitReady() { return _taskOrbitReady; }
|
|
171
181
|
export async function loadTaskQueue() {
|
|
182
|
+
// OrbitDB 主存储优先
|
|
183
|
+
if (taskOrbitReady()) {
|
|
184
|
+
try {
|
|
185
|
+
const { getTaskOrbitStore } = await import('../orbitdb/task-store.js');
|
|
186
|
+
const tasks = await getTaskOrbitStore().loadTasks();
|
|
187
|
+
if (Array.isArray(tasks))
|
|
188
|
+
return tasks;
|
|
189
|
+
}
|
|
190
|
+
catch { /* orbit 读失败 → fallback 本地 */ }
|
|
191
|
+
}
|
|
172
192
|
try {
|
|
173
193
|
const data = await fs.readFile(TASK_QUEUE_PATH, 'utf-8');
|
|
174
194
|
return JSON.parse(data);
|
|
@@ -178,7 +198,16 @@ export async function loadTaskQueue() {
|
|
|
178
198
|
}
|
|
179
199
|
}
|
|
180
200
|
export async function saveTaskQueue(tasks) {
|
|
201
|
+
// 本地双写 (备份 + fallback 源)
|
|
181
202
|
await fs.writeFile(TASK_QUEUE_PATH, JSON.stringify(tasks, null, 2));
|
|
203
|
+
// OrbitDB 主存储同步 (尽力而为)
|
|
204
|
+
if (taskOrbitReady()) {
|
|
205
|
+
try {
|
|
206
|
+
const { getTaskOrbitStore } = await import('../orbitdb/task-store.js');
|
|
207
|
+
await getTaskOrbitStore().saveTasks(tasks);
|
|
208
|
+
}
|
|
209
|
+
catch { /* orbit 写失败静默, 本地已备份 */ }
|
|
210
|
+
}
|
|
182
211
|
}
|
|
183
212
|
// ==================== 任务认领 CAS (2026-08-11, Hermes kanban 模式) ====================
|
|
184
213
|
// kanban_db.py: "WAL + BEGIN IMMEDIATE + compare-and-swap on tasks.status/claim_lock —
|
package/dist/web/server.js
CHANGED
|
@@ -1698,6 +1698,18 @@ export async function createWebServer(port = 3000, options = {}) {
|
|
|
1698
1698
|
const rep = await startDidCatalogReplication(identity.did, { intervalMs: 30_000 });
|
|
1699
1699
|
console.log(`[did-catalog] OrbitDB 自动复制已启动: store=${rep.storeName} address=${String(rep.storeAddress).slice(0, 48)}...`);
|
|
1700
1700
|
globalThis.__didCatalogReplication = rep;
|
|
1701
|
+
// 2026-08-12 (Task6): 预热任务 OrbitDB 存储 (task 队列去中心化主存储). warm 成功才启用.
|
|
1702
|
+
try {
|
|
1703
|
+
const { warmTaskOrbitStore, taskStoreName } = await import('../orbitdb/task-store.js');
|
|
1704
|
+
const { markTaskOrbitReady } = await import('./server-storage.js');
|
|
1705
|
+
const ok = await warmTaskOrbitStore(identity.did);
|
|
1706
|
+
if (ok)
|
|
1707
|
+
markTaskOrbitReady();
|
|
1708
|
+
console.log(`[task-store] OrbitDB 任务存储 ${ok ? '已启用' : '未启用 (回退本地)'} (store=${taskStoreName(identity.did)})`);
|
|
1709
|
+
}
|
|
1710
|
+
catch (e) {
|
|
1711
|
+
console.warn('[task-store] 任务 OrbitDB 预热失败 (非致命):', e?.message?.slice(0, 120));
|
|
1712
|
+
}
|
|
1701
1713
|
}
|
|
1702
1714
|
catch (e) {
|
|
1703
1715
|
console.warn('[did-catalog] OrbitDB 复制启动失败 (非致命, 稍后可用 API 重试):', e?.message?.slice(0, 120));
|
|
@@ -1733,7 +1745,11 @@ export async function createWebServer(port = 3000, options = {}) {
|
|
|
1733
1745
|
if (!cid || knownIds.has(cid))
|
|
1734
1746
|
continue;
|
|
1735
1747
|
// 有 session 文件才算可恢复 (说明确实创建过)
|
|
1736
|
-
|
|
1748
|
+
// 2026-08-12 fix: SessionStore 保存到 cache/<channelId>__default.json (冒号被 filenameEscape 成 __),
|
|
1749
|
+
// 之前用 `${sessionsDir}/${cid}:default.json` (未 escape + 硬拼冒号) 查不到 → 会话已存在也被判为
|
|
1750
|
+
// "无 session" 永不恢复, 即 session/channel 路径与创建智能体 channel 的路径不一致 (bug 修复)
|
|
1751
|
+
const { getSessionCacheFile } = await import('../bootstrap/memory-compressor.js');
|
|
1752
|
+
const hasSession = existsSync(getSessionCacheFile(cid, 'default')) || existsSync(`${sessionsDir}/${cid}.json`);
|
|
1737
1753
|
if (!hasSession)
|
|
1738
1754
|
continue;
|
|
1739
1755
|
const restored = {
|
|
@@ -2397,19 +2413,19 @@ export async function createWebServer(port = 3000, options = {}) {
|
|
|
2397
2413
|
.map((p) => `- ${p.name || p.publicKey.slice(0, 8)} (pk=${p.publicKey.slice(0, 12)}…): 渠道[${p.channels.map((c) => c.name).join(', ') || '无'}]`)
|
|
2398
2414
|
.join('\n');
|
|
2399
2415
|
const goalDesc = ctx.goal ? `当前目标: ${ctx.goal.description} (已发起 ${ctx.goal.initiationsUsed}/${ctx.goal.maxInitiations}, 有效回复 ${ctx.goal.effectfulReplies}/${ctx.goal.effectThreshold})` : '当前无明确目标';
|
|
2400
|
-
const prompt = `你是智能体「${ctx.self.name || '本地智能体'}」。你通过 P2P 网络认识以下其他智能体:
|
|
2401
|
-
${peerLines}
|
|
2402
|
-
|
|
2403
|
-
${goalDesc}
|
|
2404
|
-
|
|
2405
|
-
规则:
|
|
2406
|
-
1. 社交是为了达成上述目标, 不是闲聊。只在你有真正有价值的信息要分享/询问、且能推进目标时才主动发起。
|
|
2407
|
-
2. 不要重复最近已经聊过的话题, 不要每条心跳都发消息, 保持克制。
|
|
2408
|
-
3. 如果目标已经通过已有交流达成 (或你认为无需再聊), 输出 {"initiate": false, "goalAchieved": true}。
|
|
2409
|
-
4. 如果决定发起, 选一个最合适的目标渠道 (用对方渠道的真实 id)。
|
|
2410
|
-
|
|
2411
|
-
现在是否要主动联系其中某个智能体? 只输出一个 JSON 对象, 不要任何其他文字:
|
|
2412
|
-
{"initiate": true 或 false, "goalAchieved": true 或 false, "targetPeerPublicKey": "对方 pk", "targetChannelId": "对方渠道 id", "message": "你要说的话"}
|
|
2416
|
+
const prompt = `你是智能体「${ctx.self.name || '本地智能体'}」。你通过 P2P 网络认识以下其他智能体:
|
|
2417
|
+
${peerLines}
|
|
2418
|
+
|
|
2419
|
+
${goalDesc}
|
|
2420
|
+
|
|
2421
|
+
规则:
|
|
2422
|
+
1. 社交是为了达成上述目标, 不是闲聊。只在你有真正有价值的信息要分享/询问、且能推进目标时才主动发起。
|
|
2423
|
+
2. 不要重复最近已经聊过的话题, 不要每条心跳都发消息, 保持克制。
|
|
2424
|
+
3. 如果目标已经通过已有交流达成 (或你认为无需再聊), 输出 {"initiate": false, "goalAchieved": true}。
|
|
2425
|
+
4. 如果决定发起, 选一个最合适的目标渠道 (用对方渠道的真实 id)。
|
|
2426
|
+
|
|
2427
|
+
现在是否要主动联系其中某个智能体? 只输出一个 JSON 对象, 不要任何其他文字:
|
|
2428
|
+
{"initiate": true 或 false, "goalAchieved": true 或 false, "targetPeerPublicKey": "对方 pk", "targetChannelId": "对方渠道 id", "message": "你要说的话"}
|
|
2413
2429
|
若不想发起, 输出 {"initiate": false}。`;
|
|
2414
2430
|
const raw = await agent.promptStream(prompt, () => { }, undefined, local.id);
|
|
2415
2431
|
const m = raw.match(/\{[\s\S]*\}/);
|