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.
- package/dist/cron.js +2 -2
- package/dist/cron.js.map +5 -5
- package/dist/hosted-agent.js +2 -2
- package/dist/hosted-agent.js.map +2 -2
- package/dist/main.js +831 -596
- package/dist/main.js.map +20 -17
- package/dist/runtime/src/index.ts +1 -0
- package/dist/runtime/src/storage/runtime-process-leases.ts +18 -0
- package/dist/runtime/src/version.ts +1 -1
- package/dist/types/packages/core/src/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -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.
|
|
1
|
+
export const NEGOTIUM_VERSION = "0.1.14";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const NEGOTIUM_VERSION = "0.1.
|
|
1
|
+
export declare const NEGOTIUM_VERSION = "0.1.14";
|