chatroom-cli 1.100.0 → 1.100.2

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
@@ -79814,8 +79814,8 @@ function getNativeEnhancerRequestTurnEndGuidance() {
79814
79814
  var init_command2 = __esm(() => {
79815
79815
  init_stdin_heredoc();
79816
79816
  });
79817
- // ../../services/backend/prompts/cli/history-retrieval/guidance.ts
79818
- var init_guidance = () => {};
79817
+ // ../../services/backend/prompts/sections/activated-skills.ts
79818
+ var init_activated_skills = () => {};
79819
79819
 
79820
79820
  // ../../services/backend/prompts/cli/backlog/command.ts
79821
79821
  var init_command3 = __esm(() => {
@@ -79891,10 +79891,14 @@ var init_glossary = __esm(() => {
79891
79891
  ];
79892
79892
  });
79893
79893
 
79894
+ // ../../services/backend/prompts/cli/history-retrieval/guidance.ts
79895
+ var init_guidance = () => {};
79896
+
79894
79897
  // ../../services/backend/prompts/sections/general-knowledge.ts
79895
79898
  var init_general_knowledge = __esm(() => {
79896
- init_guidance();
79899
+ init_activated_skills();
79897
79900
  init_glossary();
79901
+ init_guidance();
79898
79902
  init_utils3();
79899
79903
  });
79900
79904
 
@@ -80301,8 +80305,8 @@ var init_generator = __esm(() => {
80301
80305
  init_system_prompt();
80302
80306
  init_classification_guide();
80303
80307
  init_commands_reference();
80304
- init_getting_started();
80305
80308
  init_general_knowledge();
80309
+ init_getting_started();
80306
80310
  init_handoff_options();
80307
80311
  init_next_step();
80308
80312
  init_role_guidance();
@@ -84373,10 +84377,11 @@ async function logDaemonAuditEvent(logEvent, event) {
84373
84377
  }
84374
84378
 
84375
84379
  // ../../services/backend/config/reliability.ts
84376
- var HARNESS_SESSION_READY_TIMEOUT_MS = 5000, DAEMON_HEARTBEAT_INTERVAL_MS, DAEMON_HEARTBEAT_TTL_MS, AGENT_REQUEST_DEADLINE_MS = 120000, OBSERVED_FULL_PUSH_INTERVAL_MS, OBSERVED_SYNC_RECONCILE_MS, WORKSPACE_RECENCY_WINDOW_MS, WORKSPACE_LIST_RECONCILE_MS, CONNECTION_CLOSE_REQUEST_TTL_MS, ENHANCER_TERMINAL_JOB_RETENTION_MS;
84380
+ var HARNESS_SESSION_READY_TIMEOUT_MS = 5000, DAEMON_HEARTBEAT_INTERVAL_MS, DAEMON_HEARTBEAT_TTL_MS, AGENT_REQUEST_DEADLINE_MS = 120000, MACHINE_COMMAND_LEASE_RENEWAL_INTERVAL_MS = 20000, MACHINE_COMMAND_DAEMON_ROUTINE_TTL_MS, OBSERVED_FULL_PUSH_INTERVAL_MS, OBSERVED_SYNC_RECONCILE_MS, WORKSPACE_RECENCY_WINDOW_MS, WORKSPACE_LIST_RECONCILE_MS, CONNECTION_CLOSE_REQUEST_TTL_MS, ENHANCER_TERMINAL_JOB_RETENTION_MS;
84377
84381
  var init_reliability = __esm(() => {
84378
84382
  DAEMON_HEARTBEAT_INTERVAL_MS = 5 * 60000;
84379
84383
  DAEMON_HEARTBEAT_TTL_MS = 6 * DAEMON_HEARTBEAT_INTERVAL_MS;
84384
+ MACHINE_COMMAND_DAEMON_ROUTINE_TTL_MS = 5 * 60000;
84380
84385
  OBSERVED_FULL_PUSH_INTERVAL_MS = 5 * 60000;
84381
84386
  OBSERVED_SYNC_RECONCILE_MS = 15 * 60000;
84382
84387
  WORKSPACE_RECENCY_WINDOW_MS = 7 * 24 * 60 * 60 * 1000;
@@ -109115,20 +109120,27 @@ function handleRefreshCapabilitiesEffect(event, tracker) {
109115
109120
  })));
109116
109121
  });
109117
109122
  }
109118
- async function handleInboundCommandEvent(commandId, tracker, effectContext2, session2, commandEvent) {
109119
- let event;
109120
- if (commandEvent?._id.toString() === commandId) {
109121
- event = commandEvent;
109122
- } else {
109123
- const result = await session2.backend.query(api.machines.getCommandEvents, {
109123
+ async function handleInboundCommandEvent(commandId, tracker, effectContext2, session2, claimedCommand) {
109124
+ if (claimedCommand.commandId !== commandId)
109125
+ return;
109126
+ const renewTimer = setInterval(() => {
109127
+ session2.backend.mutation(api.daemon.machineCommandInbox.renewClaim, {
109124
109128
  sessionId: session2.sessionId,
109125
- machineId: session2.machineId
109129
+ commandId: claimedCommand.commandId
109130
+ }).catch(() => {
109131
+ return;
109132
+ });
109133
+ }, MACHINE_COMMAND_LEASE_RENEWAL_INTERVAL_MS);
109134
+ try {
109135
+ const { commandId: _id, machineId, deadline, timestamp, ...rest } = claimedCommand;
109136
+ await exports_Effect.runPromise(dispatchCommandEventEffect({ _id, machineId, deadline, timestamp, ...rest }, tracker).pipe(exports_Effect.provide(effectContext2)));
109137
+ await session2.backend.mutation(api.daemon.machineCommandInbox.acknowledge, {
109138
+ sessionId: session2.sessionId,
109139
+ commandId: claimedCommand.commandId
109126
109140
  });
109127
- event = result?.events?.find((e) => e._id.toString() === commandId);
109141
+ } finally {
109142
+ clearInterval(renewTimer);
109128
109143
  }
109129
- if (!event)
109130
- return;
109131
- await exports_Effect.runPromise(dispatchCommandEventEffect(event, tracker).pipe(exports_Effect.provide(effectContext2)));
109132
109144
  }
109133
109145
  var GIT_PUSH_ACTIONS, commandEventHandlers, dispatchCommandEventEffect = (event, tracker) => {
109134
109146
  if (!isDaemonCommandEventType(event.type))
@@ -117369,7 +117381,7 @@ Listening for commands...`);
117369
117381
  registerCommandInboundHandler(async (event) => {
117370
117382
  evictStaleDedupEntries(dedupTracker);
117371
117383
  if (event.type === "command.received") {
117372
- await handleInboundCommandEvent(event.commandId, dedupTracker, effectContext2, session2, event.commandEvent);
117384
+ await handleInboundCommandEvent(event.commandId, dedupTracker, effectContext2, session2, event.claimedCommand);
117373
117385
  } else {
117374
117386
  await drainActionableCommandRuns(session2, commandRunRuntime);
117375
117387
  }
@@ -118088,35 +118100,6 @@ var init_agentic_query_session = __esm(() => {
118088
118100
  init_api3();
118089
118101
  });
118090
118102
 
118091
- // src/daemon/infrastructure/convex/subscribers/command-events.ts
118092
- function startCommandEventsSubscriber(deps, onEvent) {
118093
- const seen = new Set;
118094
- const unsub = deps.wsClient.onUpdate(api.machines.getCommandEvents, { sessionId: deps.sessionId, machineId: deps.machineId }, (result) => {
118095
- if (!result?.events?.length)
118096
- return;
118097
- for (const event of result.events) {
118098
- if (seen.has(event._id))
118099
- continue;
118100
- seen.add(event._id);
118101
- onEvent({
118102
- type: "command.received",
118103
- commandId: event._id,
118104
- commandEvent: event
118105
- });
118106
- }
118107
- }, (err) => {
118108
- console.warn(`[daemon] command-events subscriber error: ${err instanceof Error ? err.message : String(err)}`);
118109
- });
118110
- return {
118111
- async stop() {
118112
- unsub();
118113
- }
118114
- };
118115
- }
118116
- var init_command_events = __esm(() => {
118117
- init_api3();
118118
- });
118119
-
118120
118103
  // src/daemon/infrastructure/convex/subscribers/command-run.ts
118121
118104
  function runId(run3) {
118122
118105
  return typeof run3._id === "string" ? run3._id : run3._id.toString();
@@ -118464,6 +118447,45 @@ var init_git_request = __esm(() => {
118464
118447
  init_api3();
118465
118448
  });
118466
118449
 
118450
+ // src/daemon/infrastructure/convex/subscribers/machine-command-inbox.ts
118451
+ function startMachineCommandInboxSubscriber(deps, onClaimed) {
118452
+ let draining = false;
118453
+ let queued = false;
118454
+ let stopped = false;
118455
+ const args2 = { sessionId: deps.sessionId, machineId: deps.machineId };
118456
+ const drain2 = async () => {
118457
+ if (stopped || draining) {
118458
+ queued = true;
118459
+ return;
118460
+ }
118461
+ draining = true;
118462
+ try {
118463
+ do {
118464
+ queued = false;
118465
+ let claimed;
118466
+ while (claimed = await deps.wsClient.mutation(api.daemon.machineCommandInbox.claimNext, args2))
118467
+ await onClaimed(claimed);
118468
+ } while (queued && !stopped);
118469
+ } finally {
118470
+ draining = false;
118471
+ }
118472
+ };
118473
+ const unsub = deps.wsClient.onUpdate(api.daemon.machineCommandInbox.watchNext, args2, (result) => {
118474
+ if (result?.commandId)
118475
+ drain2();
118476
+ }, (err) => console.warn(`[daemon] machine-command-inbox watch error: ${String(err)}`));
118477
+ drain2();
118478
+ return {
118479
+ async stop() {
118480
+ stopped = true;
118481
+ unsub();
118482
+ }
118483
+ };
118484
+ }
118485
+ var init_machine_command_inbox = __esm(() => {
118486
+ init_api3();
118487
+ });
118488
+
118467
118489
  // src/daemon/infrastructure/convex/subscribers/workspace-list.ts
118468
118490
  function startWorkspaceListSubscriber(deps, onEvent) {
118469
118491
  let lastSnapshotKey = "";
@@ -118502,7 +118524,13 @@ function startAllSubscribers(deps) {
118502
118524
  const session2 = startDirectHarnessSessionSubscriber(deps, onEvent);
118503
118525
  const prompt = startDirectHarnessPromptSubscriber(deps, onEvent);
118504
118526
  const directHarnessCommand = startDirectHarnessCommandSubscriber(deps, onEvent);
118505
- const commandEvents = startCommandEventsSubscriber(deps, onEvent);
118527
+ const machineCommands = startMachineCommandInboxSubscriber(deps, async (claimed) => {
118528
+ await dispatchCommandInboundEvent({
118529
+ type: "command.received",
118530
+ commandId: claimed.commandId,
118531
+ claimedCommand: claimed
118532
+ });
118533
+ });
118506
118534
  const commandRun = startCommandRunSubscriber(deps, onEvent);
118507
118535
  const workspaceList = startWorkspaceListSubscriber(deps, onEvent);
118508
118536
  const gitRequest = startGitRequestSubscriber(deps, onEvent);
@@ -118519,7 +118547,7 @@ function startAllSubscribers(deps) {
118519
118547
  session2.stop(),
118520
118548
  prompt.stop(),
118521
118549
  directHarnessCommand.stop(),
118522
- commandEvents.stop(),
118550
+ machineCommands.stop(),
118523
118551
  commandRun.stop(),
118524
118552
  workspaceList.stop(),
118525
118553
  gitRequest.stop(),
@@ -118538,7 +118566,6 @@ var init_subscriber_registry = __esm(() => {
118538
118566
  init_event_router();
118539
118567
  init_agentic_query_prompt();
118540
118568
  init_agentic_query_session();
118541
- init_command_events();
118542
118569
  init_command_run();
118543
118570
  init_direct_harness_command();
118544
118571
  init_direct_harness_prompt();
@@ -118549,6 +118576,7 @@ var init_subscriber_registry = __esm(() => {
118549
118576
  init_file_tree_request();
118550
118577
  init_file_write_request();
118551
118578
  init_git_request();
118579
+ init_machine_command_inbox();
118552
118580
  init_workspace_list();
118553
118581
  });
118554
118582
 
@@ -134326,4 +134354,4 @@ program2.hook("preAction", async (_thisCommand, actionCommand) => {
134326
134354
  });
134327
134355
  program2.parse();
134328
134356
 
134329
- //# debugId=80CAD6681DDF439964756E2164756E21
134357
+ //# debugId=3DCDB18F8D48DCD164756E2164756E21