@adhdev/daemon-core 0.9.82-rc.224 → 0.9.82-rc.225
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 +28 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/commands/router.ts +23 -15
- package/src/mesh/mesh-events-coordinator.ts +2 -0
- package/src/providers/cli-provider-instance.ts +6 -1
package/package.json
CHANGED
package/src/commands/router.ts
CHANGED
|
@@ -6142,26 +6142,34 @@ export class DaemonCommandRouter {
|
|
|
6142
6142
|
const emitBootstrapEvent = (eventStatus: 'bootstrap_complete' | 'bootstrap_failed', bootstrapState: WorktreeBootstrapState, startedAtMs: number, extraPayload?: Record<string, unknown>): void => {
|
|
6143
6143
|
try {
|
|
6144
6144
|
const durationMs = Date.now() - startedAtMs;
|
|
6145
|
-
const
|
|
6146
|
-
|
|
6145
|
+
const event = `worktree_${eventStatus}` as const;
|
|
6146
|
+
const metadataEvent = {
|
|
6147
|
+
source: 'clone_mesh_node_bootstrap',
|
|
6148
|
+
nodeId: node.id,
|
|
6149
|
+
status: eventStatus,
|
|
6150
|
+
worktreePath: result.worktreePath,
|
|
6151
|
+
durationMs,
|
|
6152
|
+
bootstrapStatus: bootstrapState.status,
|
|
6153
|
+
...(bootstrapState.error ? { error: bootstrapState.error } : {}),
|
|
6154
|
+
...(bootstrapState.exitCode !== undefined ? { exitCode: bootstrapState.exitCode } : {}),
|
|
6155
|
+
...(extraPayload || {}),
|
|
6156
|
+
};
|
|
6157
|
+
if (typeof this.deps.instanceManager?.getByCategory === 'function') {
|
|
6158
|
+
const forwarded = handleMeshForwardEvent(
|
|
6159
|
+
{ instanceManager: this.deps.instanceManager } as any,
|
|
6160
|
+
{ event, meshId, nodeId: node.id, workspace: result.worktreePath, metadataEvent },
|
|
6161
|
+
);
|
|
6162
|
+
if (forwarded?.success === true) return;
|
|
6163
|
+
}
|
|
6164
|
+
queuePendingMeshCoordinatorEvent({
|
|
6165
|
+
event,
|
|
6147
6166
|
meshId,
|
|
6148
6167
|
nodeLabel: node.id,
|
|
6149
6168
|
nodeId: node.id,
|
|
6150
6169
|
workspace: result.worktreePath,
|
|
6151
|
-
metadataEvent
|
|
6152
|
-
source: 'clone_mesh_node_bootstrap',
|
|
6153
|
-
nodeId: node.id,
|
|
6154
|
-
status: eventStatus,
|
|
6155
|
-
worktreePath: result.worktreePath,
|
|
6156
|
-
durationMs,
|
|
6157
|
-
bootstrapStatus: bootstrapState.status,
|
|
6158
|
-
...(bootstrapState.error ? { error: bootstrapState.error } : {}),
|
|
6159
|
-
...(bootstrapState.exitCode !== undefined ? { exitCode: bootstrapState.exitCode } : {}),
|
|
6160
|
-
...(extraPayload || {}),
|
|
6161
|
-
},
|
|
6170
|
+
metadataEvent,
|
|
6162
6171
|
queuedAt: Date.now(),
|
|
6163
|
-
};
|
|
6164
|
-
queuePendingMeshCoordinatorEvent(eventPayload);
|
|
6172
|
+
});
|
|
6165
6173
|
} catch { /* event emission is best-effort */ }
|
|
6166
6174
|
};
|
|
6167
6175
|
|
|
@@ -870,6 +870,8 @@ const MESH_COORDINATOR_EVENTS = new Set([
|
|
|
870
870
|
'refine:accepted',
|
|
871
871
|
'refine:completed',
|
|
872
872
|
'refine:failed',
|
|
873
|
+
'worktree_bootstrap_complete',
|
|
874
|
+
'worktree_bootstrap_failed',
|
|
873
875
|
]);
|
|
874
876
|
|
|
875
877
|
const EVENT_TO_LEDGER_KIND: Record<string, MeshLedgerKind> = {
|
|
@@ -1483,9 +1483,14 @@ export class CliProviderInstance implements ProviderInstance {
|
|
|
1483
1483
|
const rawStatus = adapterStatus.status;
|
|
1484
1484
|
const autoApproveActive = this.maybeAutoApproveStatus(adapterStatus, now);
|
|
1485
1485
|
const externalNativeFinal = this.getExternalNativeFinalReconciliation(undefined, adapterStatus);
|
|
1486
|
+
// During the autoApproveBusy window (2s after firing approval key), the PTY
|
|
1487
|
+
// can briefly report 'idle' before the next generating phase starts. Treat that
|
|
1488
|
+
// transient idle as 'generating' to suppress a spurious agent:generating_completed
|
|
1489
|
+
// push notification. externalNativeFinal still wins to allow hard-stop overrides.
|
|
1490
|
+
const autoApproveHoldIdle = this.autoApproveBusy && rawStatus === 'idle';
|
|
1486
1491
|
const newStatus = externalNativeFinal && isCliGeneratingLikeStatus(rawStatus)
|
|
1487
1492
|
? 'idle'
|
|
1488
|
-
: (autoApproveActive ? 'generating' : rawStatus);
|
|
1493
|
+
: (autoApproveActive || autoApproveHoldIdle ? 'generating' : rawStatus);
|
|
1489
1494
|
const dirName = this.workingDir.split('/').filter(Boolean).pop() || 'session';
|
|
1490
1495
|
const chatTitle = `${this.provider.name} · ${dirName}`;
|
|
1491
1496
|
const partial = this.adapter.getPartialResponse();
|