chatroom-cli 1.99.2 → 1.100.1

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,13 +79814,8 @@ function getNativeEnhancerRequestTurnEndGuidance() {
79814
79814
  var init_command2 = __esm(() => {
79815
79815
  init_stdin_heredoc();
79816
79816
  });
79817
- // ../../services/backend/prompts/sections/commands-reference.ts
79818
- var init_commands_reference = __esm(() => {
79819
- init_command();
79820
- init_reminder();
79821
- init_command2();
79822
- init_utils3();
79823
- });
79817
+ // ../../services/backend/prompts/sections/activated-skills.ts
79818
+ var init_activated_skills = () => {};
79824
79819
 
79825
79820
  // ../../services/backend/prompts/cli/backlog/command.ts
79826
79821
  var init_command3 = __esm(() => {
@@ -79896,6 +79891,26 @@ var init_glossary = __esm(() => {
79896
79891
  ];
79897
79892
  });
79898
79893
 
79894
+ // ../../services/backend/prompts/cli/history-retrieval/guidance.ts
79895
+ var init_guidance = () => {};
79896
+
79897
+ // ../../services/backend/prompts/sections/general-knowledge.ts
79898
+ var init_general_knowledge = __esm(() => {
79899
+ init_activated_skills();
79900
+ init_glossary();
79901
+ init_guidance();
79902
+ init_utils3();
79903
+ });
79904
+
79905
+ // ../../services/backend/prompts/sections/commands-reference.ts
79906
+ var init_commands_reference = __esm(() => {
79907
+ init_command();
79908
+ init_reminder();
79909
+ init_command2();
79910
+ init_utils3();
79911
+ init_general_knowledge();
79912
+ });
79913
+
79899
79914
  // ../../services/backend/prompts/cli/roles/builder.ts
79900
79915
  var init_builder = () => {};
79901
79916
  // ../../services/backend/prompts/cli/sections/handoff-rules.ts
@@ -79981,7 +79996,7 @@ var init_role_identity = __esm(() => {
79981
79996
  // ../../services/backend/prompts/native/system-prompt.ts
79982
79997
  var init_system_prompt = __esm(() => {
79983
79998
  init_commands_reference();
79984
- init_glossary();
79999
+ init_general_knowledge();
79985
80000
  init_role_guidance();
79986
80001
  init_role_identity();
79987
80002
  init_selector_context();
@@ -80290,8 +80305,8 @@ var init_generator = __esm(() => {
80290
80305
  init_system_prompt();
80291
80306
  init_classification_guide();
80292
80307
  init_commands_reference();
80308
+ init_general_knowledge();
80293
80309
  init_getting_started();
80294
- init_glossary();
80295
80310
  init_handoff_options();
80296
80311
  init_next_step();
80297
80312
  init_role_guidance();
@@ -84362,10 +84377,11 @@ async function logDaemonAuditEvent(logEvent, event) {
84362
84377
  }
84363
84378
 
84364
84379
  // ../../services/backend/config/reliability.ts
84365
- 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;
84366
84381
  var init_reliability = __esm(() => {
84367
84382
  DAEMON_HEARTBEAT_INTERVAL_MS = 5 * 60000;
84368
84383
  DAEMON_HEARTBEAT_TTL_MS = 6 * DAEMON_HEARTBEAT_INTERVAL_MS;
84384
+ MACHINE_COMMAND_DAEMON_ROUTINE_TTL_MS = 5 * 60000;
84369
84385
  OBSERVED_FULL_PUSH_INTERVAL_MS = 5 * 60000;
84370
84386
  OBSERVED_SYNC_RECONCILE_MS = 15 * 60000;
84371
84387
  WORKSPACE_RECENCY_WINDOW_MS = 7 * 24 * 60 * 60 * 1000;
@@ -109104,20 +109120,27 @@ function handleRefreshCapabilitiesEffect(event, tracker) {
109104
109120
  })));
109105
109121
  });
109106
109122
  }
109107
- async function handleInboundCommandEvent(commandId, tracker, effectContext2, session2, commandEvent) {
109108
- let event;
109109
- if (commandEvent?._id.toString() === commandId) {
109110
- event = commandEvent;
109111
- } else {
109112
- 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, {
109113
109128
  sessionId: session2.sessionId,
109114
- machineId: session2.machineId
109129
+ commandId: claimedCommand.commandId
109130
+ }).catch(() => {
109131
+ return;
109115
109132
  });
109116
- event = result?.events?.find((e) => e._id.toString() === commandId);
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
109140
+ });
109141
+ } finally {
109142
+ clearInterval(renewTimer);
109117
109143
  }
109118
- if (!event)
109119
- return;
109120
- await exports_Effect.runPromise(dispatchCommandEventEffect(event, tracker).pipe(exports_Effect.provide(effectContext2)));
109121
109144
  }
109122
109145
  var GIT_PUSH_ACTIONS, commandEventHandlers, dispatchCommandEventEffect = (event, tracker) => {
109123
109146
  if (!isDaemonCommandEventType(event.type))
@@ -117358,7 +117381,7 @@ Listening for commands...`);
117358
117381
  registerCommandInboundHandler(async (event) => {
117359
117382
  evictStaleDedupEntries(dedupTracker);
117360
117383
  if (event.type === "command.received") {
117361
- await handleInboundCommandEvent(event.commandId, dedupTracker, effectContext2, session2, event.commandEvent);
117384
+ await handleInboundCommandEvent(event.commandId, dedupTracker, effectContext2, session2, event.claimedCommand);
117362
117385
  } else {
117363
117386
  await drainActionableCommandRuns(session2, commandRunRuntime);
117364
117387
  }
@@ -118077,35 +118100,6 @@ var init_agentic_query_session = __esm(() => {
118077
118100
  init_api3();
118078
118101
  });
118079
118102
 
118080
- // src/daemon/infrastructure/convex/subscribers/command-events.ts
118081
- function startCommandEventsSubscriber(deps, onEvent) {
118082
- const seen = new Set;
118083
- const unsub = deps.wsClient.onUpdate(api.machines.getCommandEvents, { sessionId: deps.sessionId, machineId: deps.machineId }, (result) => {
118084
- if (!result?.events?.length)
118085
- return;
118086
- for (const event of result.events) {
118087
- if (seen.has(event._id))
118088
- continue;
118089
- seen.add(event._id);
118090
- onEvent({
118091
- type: "command.received",
118092
- commandId: event._id,
118093
- commandEvent: event
118094
- });
118095
- }
118096
- }, (err) => {
118097
- console.warn(`[daemon] command-events subscriber error: ${err instanceof Error ? err.message : String(err)}`);
118098
- });
118099
- return {
118100
- async stop() {
118101
- unsub();
118102
- }
118103
- };
118104
- }
118105
- var init_command_events = __esm(() => {
118106
- init_api3();
118107
- });
118108
-
118109
118103
  // src/daemon/infrastructure/convex/subscribers/command-run.ts
118110
118104
  function runId(run3) {
118111
118105
  return typeof run3._id === "string" ? run3._id : run3._id.toString();
@@ -118453,6 +118447,45 @@ var init_git_request = __esm(() => {
118453
118447
  init_api3();
118454
118448
  });
118455
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
+
118456
118489
  // src/daemon/infrastructure/convex/subscribers/workspace-list.ts
118457
118490
  function startWorkspaceListSubscriber(deps, onEvent) {
118458
118491
  let lastSnapshotKey = "";
@@ -118491,7 +118524,13 @@ function startAllSubscribers(deps) {
118491
118524
  const session2 = startDirectHarnessSessionSubscriber(deps, onEvent);
118492
118525
  const prompt = startDirectHarnessPromptSubscriber(deps, onEvent);
118493
118526
  const directHarnessCommand = startDirectHarnessCommandSubscriber(deps, onEvent);
118494
- 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
+ });
118495
118534
  const commandRun = startCommandRunSubscriber(deps, onEvent);
118496
118535
  const workspaceList = startWorkspaceListSubscriber(deps, onEvent);
118497
118536
  const gitRequest = startGitRequestSubscriber(deps, onEvent);
@@ -118508,7 +118547,7 @@ function startAllSubscribers(deps) {
118508
118547
  session2.stop(),
118509
118548
  prompt.stop(),
118510
118549
  directHarnessCommand.stop(),
118511
- commandEvents.stop(),
118550
+ machineCommands.stop(),
118512
118551
  commandRun.stop(),
118513
118552
  workspaceList.stop(),
118514
118553
  gitRequest.stop(),
@@ -118527,7 +118566,6 @@ var init_subscriber_registry = __esm(() => {
118527
118566
  init_event_router();
118528
118567
  init_agentic_query_prompt();
118529
118568
  init_agentic_query_session();
118530
- init_command_events();
118531
118569
  init_command_run();
118532
118570
  init_direct_harness_command();
118533
118571
  init_direct_harness_prompt();
@@ -118538,6 +118576,7 @@ var init_subscriber_registry = __esm(() => {
118538
118576
  init_file_tree_request();
118539
118577
  init_file_write_request();
118540
118578
  init_git_request();
118579
+ init_machine_command_inbox();
118541
118580
  init_workspace_list();
118542
118581
  });
118543
118582
 
@@ -134315,4 +134354,4 @@ program2.hook("preAction", async (_thisCommand, actionCommand) => {
134315
134354
  });
134316
134355
  program2.parse();
134317
134356
 
134318
- //# debugId=6F8892900A69B55764756E2164756E21
134357
+ //# debugId=3DCDB18F8D48DCD164756E2164756E21