negotium 0.1.13 → 0.1.14

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.
@@ -278,6 +278,7 @@ export type {
278
278
  export {
279
279
  acquireRuntimeProcessLease,
280
280
  getRuntimeProcessLease,
281
+ listRuntimeProcessLeases,
281
282
  PROCESS_LEASE_HEARTBEAT_MS,
282
283
  PROCESS_LEASE_STALE_MS,
283
284
  waitForRequiredRuntimeProcessLease,
@@ -102,6 +102,24 @@ export function getRuntimeProcessLease(
102
102
  return now - lease.heartbeatAt <= staleMs ? lease : null;
103
103
  }
104
104
 
105
+ /** List healthy process leases, optionally restricted to one role prefix. */
106
+ export function listRuntimeProcessLeases(
107
+ rolePrefix = "",
108
+ now = Date.now(),
109
+ staleMs = PROCESS_LEASE_STALE_MS,
110
+ ): RuntimeProcessLease[] {
111
+ const rows = rolePrefix
112
+ ? db
113
+ .query<RuntimeProcessLeaseRow, [string]>(
114
+ "SELECT * FROM runtime_process_leases WHERE role LIKE ? ORDER BY role",
115
+ )
116
+ .all(`${rolePrefix}%`)
117
+ : db
118
+ .query<RuntimeProcessLeaseRow, []>("SELECT * FROM runtime_process_leases ORDER BY role")
119
+ .all();
120
+ return rows.map(rowToLease).filter((lease) => now - lease.heartbeatAt <= staleMs);
121
+ }
122
+
105
123
  export function heartbeatRuntimeProcessLease(
106
124
  role: string,
107
125
  ownerId: string,
@@ -1 +1 @@
1
- export const NEGOTIUM_VERSION = "0.1.13";
1
+ export const NEGOTIUM_VERSION = "0.1.14";
@@ -1 +1 @@
1
- export declare const NEGOTIUM_VERSION = "0.1.13";
1
+ export declare const NEGOTIUM_VERSION = "0.1.14";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "negotium",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "type": "module",
5
5
  "description": "Install the Negotium multi-agent runtime and CLI with one package",
6
6
  "license": "Apache-2.0",