opencode-swarm 6.33.7 → 6.33.8
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/dist/index.js +39 -20
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -65258,7 +65258,8 @@ var OpenCodeSwarm = async (ctx) => {
|
|
|
65258
65258
|
},
|
|
65259
65259
|
"experimental.chat.messages.transform": composeHandlers(...[
|
|
65260
65260
|
(input, _output) => {
|
|
65261
|
-
|
|
65261
|
+
if (process.env.DEBUG_SWARM)
|
|
65262
|
+
console.error(`[DIAG] messagesTransform START`);
|
|
65262
65263
|
const p = input;
|
|
65263
65264
|
if (p.sessionID) {
|
|
65264
65265
|
const archAgent = swarmState.activeAgent.get(p.sessionID);
|
|
@@ -65282,24 +65283,28 @@ var OpenCodeSwarm = async (ctx) => {
|
|
|
65282
65283
|
if (output.messages) {
|
|
65283
65284
|
output.messages = consolidateSystemMessages(output.messages);
|
|
65284
65285
|
}
|
|
65285
|
-
|
|
65286
|
+
if (process.env.DEBUG_SWARM)
|
|
65287
|
+
console.error(`[DIAG] messagesTransform DONE`);
|
|
65286
65288
|
return Promise.resolve();
|
|
65287
65289
|
}
|
|
65288
65290
|
].filter((fn) => Boolean(fn))),
|
|
65289
65291
|
"experimental.chat.system.transform": composeHandlers(...[
|
|
65290
65292
|
async (input, output) => {
|
|
65291
|
-
|
|
65293
|
+
if (process.env.DEBUG_SWARM)
|
|
65294
|
+
console.error(`[DIAG] systemTransform START`);
|
|
65292
65295
|
},
|
|
65293
65296
|
systemEnhancerHook["experimental.chat.system.transform"],
|
|
65294
65297
|
async (_input, _output) => {
|
|
65295
|
-
|
|
65298
|
+
if (process.env.DEBUG_SWARM)
|
|
65299
|
+
console.error(`[DIAG] systemTransform enhancer DONE`);
|
|
65296
65300
|
},
|
|
65297
65301
|
automationConfig.capabilities?.phase_preflight === true && preflightTriggerManager ? createPhaseMonitorHook(ctx.directory, preflightTriggerManager) : knowledgeConfig.enabled ? createPhaseMonitorHook(ctx.directory) : undefined
|
|
65298
65302
|
].filter(Boolean)),
|
|
65299
65303
|
"experimental.session.compacting": compactionHook["experimental.session.compacting"],
|
|
65300
65304
|
"command.execute.before": safeHook(commandHandler),
|
|
65301
65305
|
"tool.execute.before": async (input, output) => {
|
|
65302
|
-
|
|
65306
|
+
if (process.env.DEBUG_SWARM)
|
|
65307
|
+
console.error(`[DIAG] toolBefore tool=${input.tool?.replace?.(/^[^:]+[:.]/, "") ?? input.tool} session=${input.sessionID}`);
|
|
65303
65308
|
if (!swarmState.activeAgent.has(input.sessionID)) {
|
|
65304
65309
|
swarmState.activeAgent.set(input.sessionID, ORCHESTRATOR_NAME);
|
|
65305
65310
|
}
|
|
@@ -65328,8 +65333,10 @@ var OpenCodeSwarm = async (ctx) => {
|
|
|
65328
65333
|
await safeHook(activityHooks.toolBefore)(input, output);
|
|
65329
65334
|
},
|
|
65330
65335
|
"tool.execute.after": async (input, output) => {
|
|
65336
|
+
const _dbg = !!process.env.DEBUG_SWARM;
|
|
65331
65337
|
const _toolName = input.tool?.replace?.(/^[^:]+[:.]/, "") ?? input.tool;
|
|
65332
|
-
|
|
65338
|
+
if (_dbg)
|
|
65339
|
+
console.error(`[DIAG] toolAfter START tool=${_toolName} session=${input.sessionID}`);
|
|
65333
65340
|
const normalizedTool = input.tool.replace(/^[^:]+[:.]/, "");
|
|
65334
65341
|
const isTaskTool = normalizedTool === "Task" || normalizedTool === "task";
|
|
65335
65342
|
if (isTaskTool) {
|
|
@@ -65341,34 +65348,43 @@ var OpenCodeSwarm = async (ctx) => {
|
|
|
65341
65348
|
taskSession.delegationActive = false;
|
|
65342
65349
|
taskSession.lastAgentEventTime = Date.now();
|
|
65343
65350
|
}
|
|
65344
|
-
|
|
65351
|
+
if (_dbg)
|
|
65352
|
+
console.error(`[DIAG] Task handoff DONE (early) session=${sessionId} activeAgent=${swarmState.activeAgent.get(sessionId)}`);
|
|
65345
65353
|
}
|
|
65346
65354
|
const HOOK_CHAIN_TIMEOUT_MS = 30000;
|
|
65347
65355
|
const hookChainStart = Date.now();
|
|
65348
65356
|
let hookChainTimedOut = false;
|
|
65349
65357
|
const hookChain = async () => {
|
|
65350
65358
|
await activityHooks.toolAfter(input, output);
|
|
65351
|
-
|
|
65359
|
+
if (_dbg)
|
|
65360
|
+
console.error(`[DIAG] toolAfter activity done tool=${_toolName}`);
|
|
65352
65361
|
await guardrailsHooks.toolAfter(input, output);
|
|
65353
|
-
|
|
65362
|
+
if (_dbg)
|
|
65363
|
+
console.error(`[DIAG] toolAfter guardrails done tool=${_toolName}`);
|
|
65354
65364
|
await safeHook(delegationLedgerHook.toolAfter)(input, output);
|
|
65355
|
-
|
|
65365
|
+
if (_dbg)
|
|
65366
|
+
console.error(`[DIAG] toolAfter ledger done tool=${_toolName}`);
|
|
65356
65367
|
await safeHook(selfReviewHook.toolAfter)(input, output);
|
|
65357
|
-
|
|
65368
|
+
if (_dbg)
|
|
65369
|
+
console.error(`[DIAG] toolAfter selfReview done tool=${_toolName}`);
|
|
65358
65370
|
await safeHook(delegationGateHooks.toolAfter)(input, output);
|
|
65359
|
-
|
|
65371
|
+
if (_dbg)
|
|
65372
|
+
console.error(`[DIAG] toolAfter delegationGate done tool=${_toolName}`);
|
|
65360
65373
|
if (knowledgeCuratorHook)
|
|
65361
65374
|
await safeHook(knowledgeCuratorHook)(input, output);
|
|
65362
65375
|
if (hivePromoterHook)
|
|
65363
65376
|
await safeHook(hivePromoterHook)(input, output);
|
|
65364
|
-
|
|
65377
|
+
if (_dbg)
|
|
65378
|
+
console.error(`[DIAG] toolAfter knowledge done tool=${_toolName}`);
|
|
65365
65379
|
await safeHook(steeringConsumedHook)(input, output);
|
|
65366
65380
|
await safeHook(coChangeSuggesterHook)(input, output);
|
|
65367
65381
|
await safeHook(darkMatterDetectorHook)(input, output);
|
|
65368
|
-
|
|
65382
|
+
if (_dbg)
|
|
65383
|
+
console.error(`[DIAG] toolAfter intelligence done tool=${_toolName}`);
|
|
65369
65384
|
await snapshotWriterHook(input, output);
|
|
65370
65385
|
await toolSummarizerHook?.(input, output);
|
|
65371
|
-
|
|
65386
|
+
if (_dbg)
|
|
65387
|
+
console.error(`[DIAG] toolAfter snapshot+summarizer done tool=${_toolName}`);
|
|
65372
65388
|
const execMode = config3.execution_mode ?? "balanced";
|
|
65373
65389
|
if (execMode === "strict") {
|
|
65374
65390
|
if (slopDetectorHook)
|
|
@@ -65409,21 +65425,24 @@ var OpenCodeSwarm = async (ctx) => {
|
|
|
65409
65425
|
});
|
|
65410
65426
|
await Promise.race([
|
|
65411
65427
|
hookChain().catch((err2) => {
|
|
65412
|
-
console.
|
|
65428
|
+
console.warn(`[swarm] toolAfter hook chain error tool=${_toolName}: ${err2 instanceof Error ? err2.message : String(err2)}`);
|
|
65413
65429
|
}),
|
|
65414
65430
|
timeout
|
|
65415
65431
|
]);
|
|
65416
65432
|
if (hookChainTimedOut) {
|
|
65417
65433
|
const elapsed = Date.now() - hookChainStart;
|
|
65418
|
-
console.
|
|
65434
|
+
console.warn(`[swarm] toolAfter TIMEOUT after ${elapsed}ms tool=${_toolName} session=${input.sessionID} \u2014 hooks abandoned to prevent session freeze`);
|
|
65419
65435
|
}
|
|
65420
65436
|
deleteStoredInputArgs(input.callID);
|
|
65421
|
-
|
|
65437
|
+
if (_dbg)
|
|
65438
|
+
console.error(`[DIAG] toolAfter COMPLETE tool=${_toolName}`);
|
|
65422
65439
|
},
|
|
65423
65440
|
"chat.message": safeHook(async (input, output) => {
|
|
65424
|
-
|
|
65441
|
+
if (process.env.DEBUG_SWARM)
|
|
65442
|
+
console.error(`[DIAG] chat.message agent=${input.agent ?? "none"} session=${input.sessionID}`);
|
|
65425
65443
|
await delegationHandler(input, output);
|
|
65426
|
-
|
|
65444
|
+
if (process.env.DEBUG_SWARM)
|
|
65445
|
+
console.error(`[DIAG] chat.message DONE agent=${input.agent ?? "none"}`);
|
|
65427
65446
|
}),
|
|
65428
65447
|
automation: automationManager
|
|
65429
65448
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "6.33.
|
|
3
|
+
"version": "6.33.8",
|
|
4
4
|
"description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|