@botbotgo/agent-harness 0.0.259 → 0.0.260

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.
@@ -1 +1 @@
1
- export declare const AGENT_HARNESS_VERSION = "0.0.258";
1
+ export declare const AGENT_HARNESS_VERSION = "0.0.259";
@@ -1 +1 @@
1
- export const AGENT_HARNESS_VERSION = "0.0.258";
1
+ export const AGENT_HARNESS_VERSION = "0.0.259";
@@ -24,6 +24,14 @@ const DEFAULT_HEALTH_CONFIG = {
24
24
  },
25
25
  },
26
26
  };
27
+ const ACTIVE_RUN_STATES = [
28
+ "queued",
29
+ "claimed",
30
+ "running",
31
+ "waiting_for_approval",
32
+ "resuming",
33
+ "cancelling",
34
+ ];
27
35
  function asObject(value) {
28
36
  return typeof value === "object" && value !== null && !Array.isArray(value) ? value : undefined;
29
37
  }
@@ -146,10 +154,10 @@ export class HealthMonitor {
146
154
  async evaluate(nowMs = Date.now()) {
147
155
  const updatedAt = new Date(nowMs).toISOString();
148
156
  const [runs, approvals] = await Promise.all([
149
- this.options.persistence.listRuns(),
150
- this.options.persistence.listApprovals(),
157
+ Promise.all(ACTIVE_RUN_STATES.map((state) => this.options.persistence.listRuns({ state }))).then((groups) => groups.flat()),
158
+ this.options.persistence.listApprovals({ status: "pending" }),
151
159
  ]);
152
- const pendingApprovals = approvals.filter((approval) => approval.status === "pending").length;
160
+ const pendingApprovals = approvals.length;
153
161
  const stuckRuns = this.countStuckRuns(runs, nowMs);
154
162
  const llmCheck = this.evaluateLlmCheck(updatedAt, nowMs);
155
163
  const workloadCheck = this.evaluateWorkloadCheck(updatedAt, pendingApprovals, stuckRuns);
@@ -43,6 +43,14 @@ import { normalizeProcessExecutablePath } from "./support/runtime-env.js";
43
43
  import { streamHarnessRun } from "./harness/run/stream-run.js";
44
44
  import { defaultRequestedAgentId, prepareRunStart } from "./harness/run/start-run.js";
45
45
  import { buildRequestInspectionRecord, buildSessionInspectionRecord, deleteSessionRecord, deleteThreadRecord, getPublicApproval, listPublicApprovals, } from "./harness/run/thread-records.js";
46
+ const ACTIVE_RUN_STATES = [
47
+ "queued",
48
+ "claimed",
49
+ "running",
50
+ "waiting_for_approval",
51
+ "resuming",
52
+ "cancelling",
53
+ ];
46
54
  function normalizeSessionListText(content, limit) {
47
55
  if (!content) {
48
56
  return undefined;
@@ -340,8 +348,8 @@ export class AgentHarnessRuntime {
340
348
  async getOperatorOverview(options) {
341
349
  const [health, runs, approvals] = await Promise.all([
342
350
  this.getHealth(),
343
- this.listRuns(),
344
- this.listApprovals(),
351
+ Promise.all(ACTIVE_RUN_STATES.map((state) => this.listRuns({ state }))).then((groups) => groups.flat()),
352
+ this.listApprovals({ status: "pending" }),
345
353
  ]);
346
354
  return projectOperatorOverview({
347
355
  health,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botbotgo/agent-harness",
3
- "version": "0.0.259",
3
+ "version": "0.0.260",
4
4
  "description": "Workspace runtime for multi-agent applications",
5
5
  "license": "MIT",
6
6
  "type": "module",