@adhdev/daemon-core 0.9.82-rc.262 → 0.9.82-rc.264
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/build-info.d.ts +37 -0
- package/dist/git/git-status.d.ts +7 -0
- package/dist/git/git-types.d.ts +29 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.js +589 -66
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +585 -66
- package/dist/index.mjs.map +1 -1
- package/dist/mesh/mesh-active-work.d.ts +18 -0
- package/dist/mesh/mesh-fast-forward.d.ts +41 -1
- package/dist/mesh/mesh-ledger.d.ts +1 -1
- package/dist/mesh/mesh-runtime-store.d.ts +6 -0
- package/dist/mesh/mesh-work-queue.d.ts +6 -0
- package/package.json +1 -1
- package/src/build-info.ts +73 -0
- package/src/commands/router.ts +123 -4
- package/src/git/git-status.ts +163 -1
- package/src/git/git-types.ts +30 -0
- package/src/index.ts +5 -2
- package/src/mesh/mesh-active-work.ts +31 -0
- package/src/mesh/mesh-fast-forward.ts +418 -17
- package/src/mesh/mesh-ledger.ts +1 -0
- package/src/mesh/mesh-runtime-store.ts +19 -0
- package/src/mesh/mesh-work-queue.ts +13 -0
|
@@ -676,6 +676,25 @@ export class MeshRuntimeStore {
|
|
|
676
676
|
this.db.prepare(`DELETE FROM mesh_direct_dispatches WHERE mesh_id = ?`).run(meshId);
|
|
677
677
|
}
|
|
678
678
|
|
|
679
|
+
/**
|
|
680
|
+
* Delete specific direct dispatch rows by taskId for a mesh. Used by the staleDirect prune
|
|
681
|
+
* path to remove orphaned/terminal dispatch records whose node/session is no longer in the
|
|
682
|
+
* live mesh. Returns the number of rows actually deleted. No-op for an empty taskId list.
|
|
683
|
+
*/
|
|
684
|
+
deleteDirectDispatchesByTaskId(meshId: string, taskIds: string[]): number {
|
|
685
|
+
const ids = (taskIds || []).map(id => typeof id === 'string' ? id.trim() : '').filter(Boolean);
|
|
686
|
+
if (!ids.length) return 0;
|
|
687
|
+
const stmt = this.db.prepare(`DELETE FROM mesh_direct_dispatches WHERE mesh_id = ? AND task_id = ?`);
|
|
688
|
+
let deleted = 0;
|
|
689
|
+
const run = this.db.transaction((rows: string[]) => {
|
|
690
|
+
for (const taskId of rows) {
|
|
691
|
+
deleted += stmt.run(meshId, taskId).changes;
|
|
692
|
+
}
|
|
693
|
+
});
|
|
694
|
+
run(ids);
|
|
695
|
+
return deleted;
|
|
696
|
+
}
|
|
697
|
+
|
|
679
698
|
markStaleDirectDispatches(meshId: string, olderThanMs: number): void {
|
|
680
699
|
const cutoff = new Date(Date.now() - olderThanMs).toISOString();
|
|
681
700
|
const now = new Date().toISOString();
|
|
@@ -750,6 +750,19 @@ export function markStaleDirectDispatches(meshId: string, olderThanMs = 60 * 60_
|
|
|
750
750
|
} catch { /* best-effort */ }
|
|
751
751
|
}
|
|
752
752
|
|
|
753
|
+
/**
|
|
754
|
+
* Delete specific direct dispatch rows by taskId. Returns the number of rows deleted.
|
|
755
|
+
* Used by the staleDirect prune path to evict orphaned/terminal dispatch records from the
|
|
756
|
+
* active staleDirect surface while leaving the append-only mesh ledger (audit history) intact.
|
|
757
|
+
*/
|
|
758
|
+
export function deleteDirectDispatchesByTaskId(meshId: string, taskIds: string[]): number {
|
|
759
|
+
try {
|
|
760
|
+
return MeshRuntimeStore.getInstance().deleteDirectDispatchesByTaskId(meshId, taskIds);
|
|
761
|
+
} catch {
|
|
762
|
+
return 0;
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
|
|
753
766
|
export type MeshToolCallRateResult = { rateLimitExceeded: boolean; callsInWindow: number; advisory: string | null };
|
|
754
767
|
|
|
755
768
|
/**
|