@matthugh1/conductor-cli 0.2.3 → 0.2.5

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/agent.js CHANGED
@@ -803,7 +803,7 @@ async function main() {
803
803
  });
804
804
  break;
805
805
  case "daemon": {
806
- const { cmdDaemon, cmdDaemonCancel } = await import("./daemon-ZJDZIP3R.js");
806
+ const { cmdDaemon, cmdDaemonCancel } = await import("./daemon-HAIV5MEA.js");
807
807
  if (parsed.subcommand === "cancel") {
808
808
  exitCode = await cmdDaemonCancel(
809
809
  parsed.projectRoot,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matthugh1/conductor-cli",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "Conductor CLI — session management, health checks, and autonomous runner for the Conductor pipeline",
5
5
  "type": "module",
6
6
  "bin": {
@@ -219,27 +219,6 @@ async function cmdDaemon(opts) {
219
219
  );
220
220
  break;
221
221
  }
222
- const freeSlots = daemonConfig.maxConcurrent - activeTasks.size;
223
- if (freeSlots > 0) {
224
- const todayCount = await client.getQuota(projectId);
225
- if (todayCount >= daemonConfig.maxPerDay) {
226
- log(
227
- `Daily quota reached (${todayCount}/${daemonConfig.maxPerDay}). Waiting...`
228
- );
229
- } else {
230
- await fillSlots(freeSlots, todayCount);
231
- }
232
- }
233
- const firstActive = activeTasks.values().next().value;
234
- await client.upsertHeartbeat({
235
- projectId,
236
- pid: process.pid,
237
- state: activeTasks.size > 0 ? "executing" : "idle",
238
- currentDeliverableId: firstActive?.deliverableId ?? void 0,
239
- currentRunId: firstActive?.runId,
240
- config: daemonConfig,
241
- stats: { completedToday, failedToday, activeCount: activeTasks.size }
242
- });
243
222
  try {
244
223
  const ingested = await client.ingestAutonomousDeliverables(
245
224
  projectId,
@@ -269,6 +248,27 @@ async function cmdDaemon(opts) {
269
248
  const msg = err instanceof Error ? err.message : String(err);
270
249
  log(`Warning: daemon task routing failed: ${msg}`);
271
250
  }
251
+ const freeSlots = daemonConfig.maxConcurrent - activeTasks.size;
252
+ if (freeSlots > 0) {
253
+ const todayCount = await client.getQuota(projectId);
254
+ if (todayCount >= daemonConfig.maxPerDay) {
255
+ log(
256
+ `Daily quota reached (${todayCount}/${daemonConfig.maxPerDay}). Waiting...`
257
+ );
258
+ } else {
259
+ await fillSlots(freeSlots, todayCount);
260
+ }
261
+ }
262
+ const firstActive = activeTasks.values().next().value;
263
+ await client.upsertHeartbeat({
264
+ projectId,
265
+ pid: process.pid,
266
+ state: activeTasks.size > 0 ? "executing" : "idle",
267
+ currentDeliverableId: firstActive?.deliverableId ?? void 0,
268
+ currentRunId: firstActive?.runId,
269
+ config: daemonConfig,
270
+ stats: { completedToday, failedToday, activeCount: activeTasks.size }
271
+ });
272
272
  if (activeTasks.size > 0) {
273
273
  const taggedPromises = [...activeTasks.entries()].map(
274
274
  ([id, task]) => task.promise.then((result) => ({ id, result }))