@bolloon/bolloon-agent 0.1.1 → 0.1.3
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/bin/bolloon-cli.cjs +165 -0
- package/bin/bolloon-daemon.sh +207 -0
- package/bin/bolloon.cmd +11 -0
- package/dist/agents/constraint-layer.js +10 -15
- package/dist/agents/pi-sdk.js +433 -106
- package/dist/agents/protocol.js +82 -1
- package/dist/agents/subagent-manager.js +2 -2
- package/dist/agents/workflow-engine.js +15 -20
- package/dist/agents/workflow-pivot-loop.js +541 -0
- package/dist/bollharness/src/index.js +5 -0
- package/dist/bollharness/src/scripts/checks/check_adr_plan_numbering.js +6 -0
- package/dist/bollharness/src/scripts/checks/check_api_types.js +45 -0
- package/dist/bollharness/src/scripts/checks/check_artifact_link.js +146 -0
- package/dist/bollharness/src/scripts/checks/check_bridge_deps.js +6 -0
- package/dist/bollharness/src/scripts/checks/check_bugfix_binding.js +6 -0
- package/dist/bollharness/src/scripts/checks/check_bugfix_binding_ci.js +6 -0
- package/dist/bollharness/src/scripts/checks/check_doc_file_references.js +6 -0
- package/dist/bollharness/src/scripts/checks/check_doc_freshness.js +135 -0
- package/dist/bollharness/src/scripts/checks/check_doc_links.js +31 -0
- package/dist/bollharness/src/scripts/checks/check_file_existence_claims.js +6 -0
- package/dist/bollharness/src/scripts/checks/check_fragment_integrity.js +34 -0
- package/dist/bollharness/src/scripts/checks/check_hook_installed.js +63 -0
- package/dist/bollharness/src/scripts/checks/check_issue_closure.js +41 -0
- package/dist/bollharness/src/scripts/checks/check_mcp_parity.js +6 -0
- package/dist/bollharness/src/scripts/checks/check_security.js +48 -0
- package/dist/bollharness/src/scripts/checks/check_skill_parity.js +6 -0
- package/dist/bollharness/src/scripts/checks/check_versions.js +6 -0
- package/dist/bollharness/src/scripts/checks/finding.js +13 -0
- package/dist/bollharness/src/scripts/checks/next_decision_number.js +20 -0
- package/dist/bollharness/src/scripts/checks/regenerate_magic_docs.js +6 -0
- package/dist/bollharness/src/scripts/ci/detect_rebaseline_triggers.js +8 -0
- package/dist/bollharness/src/scripts/ci/scan_subprocess_cfg.js +8 -0
- package/dist/bollharness/src/scripts/ci/scan_verify_artifacts.js +8 -0
- package/dist/bollharness/src/scripts/ci/scan_yaml_schema.js +8 -0
- package/dist/bollharness/src/scripts/context_router.js +67 -0
- package/dist/bollharness/src/scripts/deploy-guard.js +157 -0
- package/dist/bollharness/src/scripts/guard-feedback.js +192 -0
- package/dist/bollharness/src/scripts/guard_router.js +158 -0
- package/dist/bollharness/src/scripts/hooks/_hook_output.js +6 -0
- package/dist/bollharness/src/scripts/hooks/auto-python3.js +6 -0
- package/dist/bollharness/src/scripts/hooks/deploy-progress-on-session-end.js +6 -0
- package/dist/bollharness/src/scripts/hooks/failure-analyzer.js +6 -0
- package/dist/bollharness/src/scripts/hooks/gate-judgment-inject.js +92 -0
- package/dist/bollharness/src/scripts/hooks/gate-transition-judgment.js +63 -0
- package/dist/bollharness/src/scripts/hooks/inbox-ack.js +6 -0
- package/dist/bollharness/src/scripts/hooks/inbox-inject-on-start.js +6 -0
- package/dist/bollharness/src/scripts/hooks/inbox-validate.js +6 -0
- package/dist/bollharness/src/scripts/hooks/inbox-write-ledger.js +6 -0
- package/dist/bollharness/src/scripts/hooks/initializer-agent.js +6 -0
- package/dist/bollharness/src/scripts/hooks/loop-detection.js +73 -0
- package/dist/bollharness/src/scripts/hooks/owner-guard.js +6 -0
- package/dist/bollharness/src/scripts/hooks/precompact.js +6 -0
- package/dist/bollharness/src/scripts/hooks/review-agent-gatekeeper.js +6 -0
- package/dist/bollharness/src/scripts/hooks/risk-tracker.js +108 -0
- package/dist/bollharness/src/scripts/hooks/sanitize-on-read.js +6 -0
- package/dist/bollharness/src/scripts/hooks/session-reflection.js +7 -0
- package/dist/bollharness/src/scripts/hooks/session-start-magic-docs.js +7 -0
- package/dist/bollharness/src/scripts/hooks/session-start-reset-risk.js +7 -0
- package/dist/bollharness/src/scripts/hooks/session-start-toolkit-reminder.js +7 -0
- package/dist/bollharness/src/scripts/hooks/stop-evaluator.js +157 -0
- package/dist/bollharness/src/scripts/hooks/tool-call-counter.js +6 -0
- package/dist/bollharness/src/scripts/hooks/trace-analyzer.js +10 -0
- package/dist/bollharness/src/scripts/install/install-trust-token.js +7 -0
- package/dist/bollharness/src/scripts/install/multi_project_registry.js +9 -0
- package/dist/bollharness/src/scripts/install/phase2_auto.js +21 -0
- package/dist/bollharness/src/scripts/install/pre_commit_installer.js +6 -0
- package/dist/bollharness/src/scripts/install/tier_selector.js +7 -0
- package/dist/bollharness/src/scripts/install/transcript_miner.js +7 -0
- package/dist/bollharness/src/scripts/lib/claim_patterns.js +10 -0
- package/dist/bollharness/src/scripts/lib/sanitize_patterns.js +12 -0
- package/dist/bollharness/src/scripts/sanitize.js +6 -0
- package/dist/bollharness-integration/channel-judgment-engine.js +530 -0
- package/dist/bollharness-integration/context-chain-router.js +383 -0
- package/dist/bollharness-integration/context-router-judgment.js +13 -21
- package/dist/bollharness-integration/context-router.js +22 -64
- package/dist/bollharness-integration/gate-state-machine.js +14 -19
- package/dist/bollharness-integration/gate-transition-hooks.js +16 -61
- package/dist/bollharness-integration/guard-checker.js +21 -68
- package/dist/bollharness-integration/index.js +14 -124
- package/dist/bollharness-integration/integration.js +13 -20
- package/dist/bollharness-integration/llm-judgment-engine.js +569 -0
- package/dist/bollharness-integration/skill-adapter.js +18 -64
- package/dist/cli-entry.js +261 -0
- package/dist/constraint-runtime/src/commands.js +17 -7
- package/dist/constraint-runtime/src/constraint/budget.js +1 -6
- package/dist/constraint-runtime/src/constraint/permission.js +1 -6
- package/dist/constraint-runtime/src/models.js +1 -3
- package/dist/constraint-runtime/src/tools.js +17 -7
- package/dist/constraints/index.js +1 -7
- package/dist/documents/reader.js +8 -49
- package/dist/heartbeat/DaemonManager.js +242 -0
- package/dist/heartbeat/HealthMonitor.js +285 -0
- package/dist/heartbeat/StartupVerifier.js +205 -0
- package/dist/heartbeat/Watchdog.js +168 -0
- package/dist/heartbeat/index.js +84 -0
- package/dist/heartbeat/types.js +5 -0
- package/dist/index.js +381 -28
- package/dist/llm/config-store.js +31 -57
- package/dist/llm/llm-judgment-client.js +389 -0
- package/dist/llm/pi-ai.js +9 -52
- package/dist/network/agent-network.js +46 -90
- package/dist/network/hybrid-messenger.js +125 -0
- package/dist/network/iroh-bootstrap.js +38 -0
- package/dist/network/iroh-discovery.js +145 -0
- package/dist/network/iroh-integration.js +9 -16
- package/dist/network/iroh-transport.js +10 -48
- package/dist/network/p2p.js +23 -62
- package/dist/network/storage/adapters/json-adapter.js +4 -42
- package/dist/network/storage/index.js +147 -0
- package/dist/network/storage/types.js +14 -0
- package/dist/pi-ecosystem/index.js +233 -0
- package/dist/pi-ecosystem-colony/index.js +29 -90
- package/dist/pi-ecosystem-goals/index.js +20 -74
- package/dist/pi-ecosystem-judgment/decision.js +29 -47
- package/dist/pi-ecosystem-judgment/distillation.js +16 -29
- package/dist/pi-ecosystem-judgment/human-value-store.js +13 -60
- package/dist/pi-ecosystem-judgment/index.js +21 -74
- package/dist/pi-ecosystem-judgment/value-injection.js +26 -72
- package/dist/pi-ecosystem-mcp/index.js +24 -78
- package/dist/pi-ecosystem-subagents/index.js +20 -69
- package/dist/social/ant-colony/AdaptiveHeartbeat.js +3 -8
- package/dist/social/ant-colony/PheromoneEngine.js +11 -49
- package/dist/social/ant-colony/index.js +6 -0
- package/dist/social/ant-colony/types.js +4 -8
- package/dist/social/channels/ChannelManager.js +8 -46
- package/dist/social/channels/DiapChannelBridge.js +9 -47
- package/dist/social/channels/InterestMatcher.js +2 -7
- package/dist/social/channels/channel-agent-session.js +309 -0
- package/dist/social/channels/channel-heartbeat-agent.js +494 -0
- package/dist/social/channels/diap-doc-parser.js +204 -0
- package/dist/social/channels/harness-workflow-integrator.js +446 -0
- package/dist/social/channels/index.js +9 -0
- package/dist/social/channels/types.js +3 -7
- package/dist/social/global-shared-context.js +6 -47
- package/dist/social/heartbeat.js +29 -72
- package/dist/social/persona/enhanced-persona.js +299 -0
- package/dist/web/client.js +302 -136
- package/dist/web/components/p2p/index.js +159 -9
- package/dist/web/components/p2p/p2p-connection.js +136 -0
- package/dist/web/components/p2p/p2p-manager.js +24 -0
- package/dist/web/components/p2p/p2p-store-memory.js +1 -1
- package/dist/web/components/p2p/types.js +7 -0
- package/dist/web/index.html +5 -0
- package/dist/web/style.css +118 -0
- package/package.json +12 -6
- package/scripts/build-cli.js +206 -0
- package/scripts/postinstall.js +153 -0
- package/src/agents/pi-sdk.ts +347 -28
- package/src/agents/protocol.ts +95 -1
- package/src/agents/workflow-pivot-loop.ts +674 -0
- package/src/bollharness/CLAUDE.md +73 -0
- package/src/bollharness/README.md +143 -0
- package/src/bollharness/README.zh-CN.md +131 -0
- package/src/bollharness/reference/boll-reference/scripts/hooks/stop-evaluator.md +57 -0
- package/src/bollharness/scripts/context-fragments/artifact-linkage.md +14 -0
- package/src/bollharness/scripts/context-fragments/auth-consumers.md +17 -0
- package/src/bollharness/scripts/context-fragments/bridge-constitution.md +13 -0
- package/src/bollharness/scripts/context-fragments/catalyst-distributed.md +18 -0
- package/src/bollharness/scripts/context-fragments/closure-checklist.md +13 -0
- package/src/bollharness/scripts/context-fragments/contract-consumers.md +15 -0
- package/src/bollharness/scripts/context-fragments/db-shared-structures.md +15 -0
- package/src/bollharness/scripts/context-fragments/fixed-three-layers.md +19 -0
- package/src/bollharness/scripts/context-fragments/general-dev-principles.md +11 -0
- package/src/bollharness/scripts/context-fragments/issue-first.md +8 -0
- package/src/bollharness/scripts/context-fragments/mcp-parity.md +16 -0
- package/src/bollharness/scripts/context-fragments/pi-agent-operations.md +108 -0
- package/src/bollharness/scripts/context-fragments/protocol-consumers.md +15 -0
- package/src/bollharness/scripts/context-fragments/run-events-consumers.md +15 -0
- package/src/bollharness/scripts/context-fragments/scene-fidelity.md +13 -0
- package/src/bollharness/scripts/context-fragments/truth-source-hierarchy.md +15 -0
- package/src/bollharness/scripts/context-fragments/two-language.md +15 -0
- package/src/bollharness/scripts/context-fragments/version-sources.md +14 -0
- package/src/bollharness/scripts/hooks/stop-evaluator.md +83 -0
- package/src/bollharness/templates/scaffold/CLAUDE.md +89 -0
- package/src/cli-entry.ts +304 -0
- package/src/heartbeat/DaemonManager.ts +283 -0
- package/src/heartbeat/HealthMonitor.ts +316 -0
- package/src/heartbeat/StartupVerifier.ts +223 -0
- package/src/heartbeat/Watchdog.ts +198 -0
- package/src/heartbeat/index.ts +108 -0
- package/src/heartbeat/types.ts +82 -0
- package/src/llm/config-store.ts +23 -5
- package/src/network/iroh-transport.ts +3 -3
- package/src/web/client.js +302 -136
- package/src/web/components/p2p/P2PModal.tsx +91 -3
- package/src/web/components/p2p/index.ts +171 -9
- package/src/web/components/p2p/p2p-connection.ts +153 -1
- package/src/web/components/p2p/p2p-manager.ts +39 -1
- package/src/web/components/p2p/p2p-store-memory.ts +1 -1
- package/src/web/components/p2p/p2p-tools.ts +315 -0
- package/src/web/components/p2p/types.ts +58 -0
- package/src/web/design.md +99 -0
- package/src/web/index.html +5 -0
- package/src/web/server.ts +353 -36
- package/src/web/style.css +118 -0
- package/tsconfig.cli.json +16 -0
- package/tsconfig.electron.json +1 -1
- package/tsconfig.json +1 -2
- package/dist/web/server.js +0 -1647
- package/dist/web/server.js.map +0 -1
package/dist/agents/protocol.js
CHANGED
|
@@ -198,11 +198,92 @@ export class AgentProtocol {
|
|
|
198
198
|
timestamp: Date.now()
|
|
199
199
|
};
|
|
200
200
|
const peers = p2pNetwork.getPeers();
|
|
201
|
+
const failedPeers = [];
|
|
201
202
|
for (const peer of peers) {
|
|
202
203
|
if (peer !== fromPeer) {
|
|
203
|
-
|
|
204
|
+
try {
|
|
205
|
+
await p2pNetwork.sendMessage(peer, 'report', JSON.stringify(reportMsg));
|
|
206
|
+
console.log(`[${this.identityName}] 汇报已发送至 ${peer}`);
|
|
207
|
+
}
|
|
208
|
+
catch (sendError) {
|
|
209
|
+
console.warn(`[${this.identityName}] 发送汇报至 ${peer} 失败: ${sendError}`);
|
|
210
|
+
failedPeers.push(peer);
|
|
211
|
+
}
|
|
204
212
|
}
|
|
205
213
|
}
|
|
214
|
+
// 重试失败的发送
|
|
215
|
+
if (failedPeers.length > 0) {
|
|
216
|
+
console.log(`[${this.identityName}] 尝试重新发送汇报至 ${failedPeers.length} 个失败节点`);
|
|
217
|
+
await this.retryFailedReports(reportMsg, failedPeers, 2);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
async retryFailedReports(reportMsg, failedPeers, maxRetries) {
|
|
221
|
+
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
222
|
+
if (failedPeers.length === 0)
|
|
223
|
+
break;
|
|
224
|
+
console.log(`[${this.identityName}] 重试第 ${attempt}/${maxRetries} 次`);
|
|
225
|
+
await this.sleep(1000 * attempt); // 指数退避
|
|
226
|
+
const stillFailed = [];
|
|
227
|
+
for (const peer of failedPeers) {
|
|
228
|
+
try {
|
|
229
|
+
await p2pNetwork.sendMessage(peer, 'report', JSON.stringify(reportMsg));
|
|
230
|
+
console.log(`[${this.identityName}] 重试成功: ${peer}`);
|
|
231
|
+
}
|
|
232
|
+
catch {
|
|
233
|
+
stillFailed.push(peer);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
failedPeers = stillFailed;
|
|
237
|
+
}
|
|
238
|
+
if (failedPeers.length > 0) {
|
|
239
|
+
console.log(`[${this.identityName}] 最终仍有 ${failedPeers.length} 个节点发送失败,将加入待重试队列`);
|
|
240
|
+
this.queueFailedReports(reportMsg, failedPeers);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
failedReportsQueue = [];
|
|
244
|
+
queueFailedReports(msg, peers) {
|
|
245
|
+
this.failedReportsQueue.push({
|
|
246
|
+
msg,
|
|
247
|
+
peers,
|
|
248
|
+
timestamp: Date.now()
|
|
249
|
+
});
|
|
250
|
+
// 限制队列大小
|
|
251
|
+
if (this.failedReportsQueue.length > 50) {
|
|
252
|
+
this.failedReportsQueue = this.failedReportsQueue.slice(-50);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
async processFailedReportsQueue() {
|
|
256
|
+
if (this.failedReportsQueue.length === 0)
|
|
257
|
+
return;
|
|
258
|
+
console.log(`[${this.identityName}] 处理待重试汇报队列 (${this.failedReportsQueue.length} 条)`);
|
|
259
|
+
const processed = [];
|
|
260
|
+
for (let i = 0; i < this.failedReportsQueue.length; i++) {
|
|
261
|
+
const item = this.failedReportsQueue[i];
|
|
262
|
+
const stillFailed = [];
|
|
263
|
+
for (const peer of item.peers) {
|
|
264
|
+
try {
|
|
265
|
+
await p2pNetwork.sendMessage(peer, 'report', JSON.stringify(item.msg));
|
|
266
|
+
console.log(`[${this.identityName}] 队列重试成功: ${peer}`);
|
|
267
|
+
}
|
|
268
|
+
catch {
|
|
269
|
+
stillFailed.push(peer);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
if (stillFailed.length === 0) {
|
|
273
|
+
processed.push(i);
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
item.peers = stillFailed;
|
|
277
|
+
item.timestamp = Date.now();
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
// 移除已成功的
|
|
281
|
+
for (let i = processed.length - 1; i >= 0; i--) {
|
|
282
|
+
this.failedReportsQueue.splice(processed[i], 1);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
sleep(ms) {
|
|
286
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
206
287
|
}
|
|
207
288
|
async submitImprovements(taskId, improvements) {
|
|
208
289
|
const feedbackMsg = {
|
|
@@ -75,7 +75,7 @@ export class SubAgentManager {
|
|
|
75
75
|
await this.initialize();
|
|
76
76
|
const newAgent = {
|
|
77
77
|
...agent,
|
|
78
|
-
id:
|
|
78
|
+
id: `agent_${Date.now()}_${Math.random().toString(36).substring(2, 8)}`,
|
|
79
79
|
status: 'creating',
|
|
80
80
|
createdAt: new Date().toISOString(),
|
|
81
81
|
lastActive: new Date().toISOString()
|
|
@@ -197,7 +197,7 @@ export class SubAgentManager {
|
|
|
197
197
|
async getActiveTasks() {
|
|
198
198
|
return Array.from(this.tasks.values()).filter(t => t.status === 'assigned' || t.status === 'in_progress');
|
|
199
199
|
}
|
|
200
|
-
async sendMessage(fromAgentId, toAgentId, content, type = '
|
|
200
|
+
async sendMessage(fromAgentId, toAgentId, content, type = 'notification', taskId, metadata) {
|
|
201
201
|
await this.initialize();
|
|
202
202
|
const message = {
|
|
203
203
|
id: `msg_${Date.now()}_${Math.random().toString(36).substring(2, 8)}`,
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* WorkflowEngine - Execution layer for document processing workflows
|
|
4
3
|
* Part of OpenClaw dual-layer architecture (Constraint Layer + Execution Layer)
|
|
5
4
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const p2p_js_1 = require("../network/p2p.js");
|
|
11
|
-
const constraint_layer_js_1 = require("./constraint-layer.js");
|
|
5
|
+
import { documentReader } from '../documents/reader.js';
|
|
6
|
+
import { getMinimax } from '../constraints/index.js';
|
|
7
|
+
import { p2pNetwork } from '../network/p2p.js';
|
|
8
|
+
import { ConstraintLayer } from './constraint-layer.js';
|
|
12
9
|
/**
|
|
13
10
|
* WorkflowEngine executes document processing workflows with retry logic and guardrails
|
|
14
11
|
* Implements the execution layer of the OpenClaw dual-layer architecture
|
|
15
12
|
*/
|
|
16
|
-
class WorkflowEngine {
|
|
13
|
+
export class WorkflowEngine {
|
|
17
14
|
constraintLayer;
|
|
18
15
|
constructor(constraintLayer) {
|
|
19
|
-
this.constraintLayer = constraintLayer || new
|
|
16
|
+
this.constraintLayer = constraintLayer || new ConstraintLayer();
|
|
20
17
|
}
|
|
21
18
|
/**
|
|
22
19
|
* Execute a complete workflow with all steps
|
|
@@ -29,7 +26,7 @@ class WorkflowEngine {
|
|
|
29
26
|
results: new Map()
|
|
30
27
|
};
|
|
31
28
|
const context = {
|
|
32
|
-
peers:
|
|
29
|
+
peers: p2pNetwork.getPeers(),
|
|
33
30
|
logs: [],
|
|
34
31
|
...initialContext
|
|
35
32
|
};
|
|
@@ -101,7 +98,7 @@ class WorkflowEngine {
|
|
|
101
98
|
const path = step.config?.path;
|
|
102
99
|
if (!path)
|
|
103
100
|
throw new Error('Read step requires path config');
|
|
104
|
-
const content = await
|
|
101
|
+
const content = await documentReader.read(path);
|
|
105
102
|
context.document = content;
|
|
106
103
|
return content;
|
|
107
104
|
}
|
|
@@ -109,7 +106,7 @@ class WorkflowEngine {
|
|
|
109
106
|
if (!context.document)
|
|
110
107
|
throw new Error('No document loaded');
|
|
111
108
|
const maxSize = step.config?.maxChunkSize || 4000;
|
|
112
|
-
return
|
|
109
|
+
return documentReader.chunk(context.document.text, maxSize);
|
|
113
110
|
}
|
|
114
111
|
case 'summarize': {
|
|
115
112
|
if (!context.document)
|
|
@@ -117,8 +114,8 @@ class WorkflowEngine {
|
|
|
117
114
|
if (!this.isMinimaxAvailable()) {
|
|
118
115
|
throw new Error('Minimax LLM not available');
|
|
119
116
|
}
|
|
120
|
-
const llm =
|
|
121
|
-
const chunks =
|
|
117
|
+
const llm = getMinimax();
|
|
118
|
+
const chunks = documentReader.chunk(context.document.text, step.config?.maxChunkSize || 4000);
|
|
122
119
|
const summaries = [];
|
|
123
120
|
let totalQuality = 0;
|
|
124
121
|
for (const chunk of chunks) {
|
|
@@ -136,7 +133,7 @@ class WorkflowEngine {
|
|
|
136
133
|
if (!this.isMinimaxAvailable()) {
|
|
137
134
|
throw new Error('Minimax LLM not available');
|
|
138
135
|
}
|
|
139
|
-
const llm =
|
|
136
|
+
const llm = getMinimax();
|
|
140
137
|
const improved = await llm.improveContent(context.document.text, step.config?.requirements || '', step.config?.context);
|
|
141
138
|
context.improved = improved;
|
|
142
139
|
return { improved };
|
|
@@ -159,13 +156,13 @@ class WorkflowEngine {
|
|
|
159
156
|
if (!checkResult.passed) {
|
|
160
157
|
throw new Error(`Guardrail blocked: ${checkResult.blocked?.name}`);
|
|
161
158
|
}
|
|
162
|
-
await
|
|
159
|
+
await p2pNetwork.sendMessage(peerId, 'message', message);
|
|
163
160
|
this.constraintLayer.log(`Sent message to ${peerId}`, { peerId, messageLength: message.length }, 'success');
|
|
164
161
|
return { sent: true, peerId };
|
|
165
162
|
}
|
|
166
163
|
case 'report': {
|
|
167
164
|
const content = step.config?.content || context.summary || '';
|
|
168
|
-
await
|
|
165
|
+
await p2pNetwork.broadcast('report', content);
|
|
169
166
|
this.constraintLayer.log('Broadcast report', { contentLength: content.length }, 'success');
|
|
170
167
|
return { broadcasted: true };
|
|
171
168
|
}
|
|
@@ -192,7 +189,7 @@ class WorkflowEngine {
|
|
|
192
189
|
*/
|
|
193
190
|
isMinimaxAvailable() {
|
|
194
191
|
try {
|
|
195
|
-
|
|
192
|
+
getMinimax();
|
|
196
193
|
return true;
|
|
197
194
|
}
|
|
198
195
|
catch {
|
|
@@ -218,5 +215,3 @@ class WorkflowEngine {
|
|
|
218
215
|
this.constraintLayer = layer;
|
|
219
216
|
}
|
|
220
217
|
}
|
|
221
|
-
exports.WorkflowEngine = WorkflowEngine;
|
|
222
|
-
//# sourceMappingURL=workflow-engine.js.map
|