chatroom-cli 1.117.2 → 1.117.4

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/index.js CHANGED
@@ -44369,9 +44369,9 @@ function runNativeInjectionEffect(task, initialHarnessSessionId, deps) {
44369
44369
  var init_native_task_injector = __esm(() => {
44370
44370
  init_parse_session_augmentation();
44371
44371
  init_esm();
44372
+ init_native_cold_session_before_inject();
44372
44373
  init_convex_error();
44373
44374
  init_agent_lifecycle_fact();
44374
- init_native_cold_session_before_inject();
44375
44375
  init_native_task_injector_logic();
44376
44376
  });
44377
44377
 
@@ -47406,6 +47406,15 @@ var init_agent_process_contracts = __esm(() => {
47406
47406
  init_harness_activity_emitter();
47407
47407
  });
47408
47408
 
47409
+ // src/daemon/services/task-service/service/task-service-debug-state.ts
47410
+ function buildTaskServiceDebugState(input) {
47411
+ const allTasks = input.taskInboxState.listAll();
47412
+ return {
47413
+ tasks: allTasks.filter((task) => task.chatroomId === input.chatroomId),
47414
+ knownTaskCount: allTasks.length
47415
+ };
47416
+ }
47417
+
47409
47418
  // src/daemon/infrastructure/inbox/task-inbox-state.ts
47410
47419
  function taskKey(taskId, role) {
47411
47420
  return `${taskId}:${role.toLowerCase()}`;
@@ -47637,6 +47646,7 @@ function createTaskService(deps) {
47637
47646
  }),
47638
47647
  listTasksForRole: (chatroomId, role) => taskInboxState.listForRole(chatroomId, role),
47639
47648
  listAllTasks: () => taskInboxState.listAll(),
47649
+ debugState: (chatroomId) => buildTaskServiceDebugState({ taskInboxState, chatroomId }),
47640
47650
  taskInboxState,
47641
47651
  releaseTaskAfterTurnFailure: async (args2) => {
47642
47652
  const result = await gateway.releaseTaskAfterTurnFailure({
@@ -64225,6 +64235,7 @@ async function localFallbackDebugState(chatroomId, port, error51) {
64225
64235
  return {
64226
64236
  capturedAt: new Date().toISOString(),
64227
64237
  warning: `Could not connect to local daemon on port ${port}: ${error51 instanceof Error ? error51.message : String(error51)}`,
64238
+ chatroomId,
64228
64239
  process: { pidFile: getPidFilePath(), running: isDaemonRunning().running },
64229
64240
  daemon: {
64230
64241
  convexUrl: getConvexUrl(),
@@ -64232,8 +64243,10 @@ async function localFallbackDebugState(chatroomId, port, error51) {
64232
64243
  machineId,
64233
64244
  config: config3
64234
64245
  },
64235
- chatroomId,
64236
- persistedState: persisted
64246
+ localState: {
64247
+ persistedAgents: persisted
64248
+ },
64249
+ backendState: {}
64237
64250
  };
64238
64251
  }
64239
64252
  async function debugDaemon(options) {
@@ -134276,19 +134289,19 @@ async function startDaemon() {
134276
134289
  const debugState = async (chatroomId) => {
134277
134290
  const persisted = await loadDaemonState(init2.machineId);
134278
134291
  const persistedAgents = Object.fromEntries(Object.entries(persisted?.agents ?? {}).filter(([key]) => key.startsWith(`${chatroomId}/`)));
134279
- let inbox = [];
134280
- let inboxError;
134292
+ let backendState = {};
134281
134293
  try {
134282
- const rows = await init2.backend.query(api.daemon.machineCommandInbox.list, {
134294
+ backendState = await init2.backend.query(api.daemon.chatroom.debug, {
134283
134295
  sessionId: asConvexSessionId(init2.sessionId),
134284
- machineId: init2.machineId
134296
+ machineId: init2.machineId,
134297
+ chatroomId
134285
134298
  });
134286
- inbox = rows.filter((row) => row.command?.chatroomId === chatroomId);
134287
134299
  } catch (error51) {
134288
- inboxError = error51 instanceof Error ? error51.message : String(error51);
134300
+ backendState = { error: error51 instanceof Error ? error51.message : String(error51) };
134289
134301
  }
134290
134302
  return {
134291
134303
  capturedAt: new Date().toISOString(),
134304
+ chatroomId,
134292
134305
  process: {
134293
134306
  pid: process.pid,
134294
134307
  uptimeSeconds: process.uptime(),
@@ -134308,19 +134321,18 @@ async function startDaemon() {
134308
134321
  harnessVersions: init2.config.harnessVersions
134309
134322
  } : null
134310
134323
  },
134311
- chatroomId,
134312
- manager: init2.agentProcessManager.getDebugState(chatroomId),
134313
- service: init2.agentProcessManagerService.debugState?.() ?? null,
134314
- persistedState: {
134315
- version: persisted?.version ?? null,
134316
- updatedAt: persisted?.updatedAt ?? null,
134317
- lastSeenEventId: persisted?.lastSeenEventId ?? null,
134318
- agents: persistedAgents
134324
+ localState: {
134325
+ slots: init2.agentProcessManager.getDebugState(chatroomId),
134326
+ agentProcessService: init2.agentProcessManagerService.debugState?.() ?? null,
134327
+ taskInboxReadModel: init2.taskService.debugState(chatroomId),
134328
+ persistedAgents: {
134329
+ version: persisted?.version ?? null,
134330
+ updatedAt: persisted?.updatedAt ?? null,
134331
+ lastSeenEventId: persisted?.lastSeenEventId ?? null,
134332
+ agents: persistedAgents
134333
+ }
134319
134334
  },
134320
- convex: {
134321
- machineCommandInbox: inbox,
134322
- ...inboxError ? { machineCommandInboxError: inboxError } : {}
134323
- }
134335
+ backendState
134324
134336
  };
134325
134337
  };
134326
134338
  const localWeb = await startLocalWebServer({ host: "127.0.0.1", port: localWebPort }, {
@@ -135648,4 +135660,4 @@ program2.hook("preAction", async (_thisCommand, actionCommand) => {
135648
135660
  });
135649
135661
  program2.parse();
135650
135662
 
135651
- //# debugId=42740EE56237EA7F64756E2164756E21
135663
+ //# debugId=EB6599E1C5E83C1264756E2164756E21