chatroom-cli 1.103.1 → 1.103.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
@@ -30445,8 +30445,8 @@ var init_claude_sdk_agent_service = __esm(() => {
30445
30445
  maxTurns: DEFAULT_MAX_TURNS2,
30446
30446
  pathToClaudeCodeExecutable: executablePath,
30447
30447
  includePartialMessages: true,
30448
- systemPrompt: isFirstQuery && !sdkSession.resumeOnFirstQuery ? sdkSession.storedSystemPrompt : undefined,
30449
- resume: useResume ? sdkSession.sessionId : undefined,
30448
+ ...isFirstQuery && !sdkSession.resumeOnFirstQuery && sdkSession.storedSystemPrompt !== undefined ? { systemPrompt: sdkSession.storedSystemPrompt } : {},
30449
+ ...useResume && sdkSession.sessionId !== undefined ? { resume: sdkSession.sessionId } : {},
30450
30450
  settingSources: [],
30451
30451
  permissionMode: "bypassPermissions",
30452
30452
  allowDangerouslySkipPermissions: true,
@@ -79539,7 +79539,7 @@ To reconnect, run:`);
79539
79539
  chatroomId: this.chatroomId,
79540
79540
  role: this.role,
79541
79541
  taskId: task._id,
79542
- messageId: message?._id,
79542
+ ...message?._id !== undefined ? { messageId: message._id } : {},
79543
79543
  convexUrl: getConvexUrl()
79544
79544
  });
79545
79545
  const taskReceivedTime = new Date().toISOString().replace("T", " ").substring(0, 19);
@@ -110359,8 +110359,9 @@ var init_on_request_stop_agent = __esm(() => {
110359
110359
  // src/daemon/entry/events/agent/on-stop-scope-agent.ts
110360
110360
  var onStopScopeAgentEffect = (event) => exports_Effect.gen(function* () {
110361
110361
  const agentMgr = yield* DaemonAgentProcessManagerService;
110362
- if (agentMgr.runInboxScopedStop)
110363
- yield* agentMgr.runInboxScopedStop(event);
110362
+ const stop4 = agentMgr.runInboxScopedStop;
110363
+ if (stop4)
110364
+ yield* stop4(event);
110364
110365
  });
110365
110366
  var init_on_stop_scope_agent = __esm(() => {
110366
110367
  init_esm();
@@ -111914,13 +111915,6 @@ var init_file_content_subscription = __esm(() => {
111914
111915
  init_daemon_services();
111915
111916
  });
111916
111917
 
111917
- // src/infrastructure/services/workspace/file-tree-data-hash.ts
111918
- import { createHash as createHash6 } from "node:crypto";
111919
- function computeFileTreeDataHash(tree) {
111920
- return createHash6("md5").update(JSON.stringify(tree)).digest("hex");
111921
- }
111922
- var init_file_tree_data_hash = () => {};
111923
-
111924
111918
  // src/infrastructure/services/workspace/file-tree-sync-ranker.ts
111925
111919
  function fileExtension(p) {
111926
111920
  const b = (p.split("/").pop() ?? p).toLowerCase();
@@ -112741,6 +112735,13 @@ var init_file_tree_scanner = __esm(() => {
112741
112735
  init_workspace_visibility_policy();
112742
112736
  });
112743
112737
 
112738
+ // src/infrastructure/services/workspace/file-tree-data-hash.ts
112739
+ import { createHash as createHash6 } from "node:crypto";
112740
+ function computeFileTreeDataHash(tree) {
112741
+ return createHash6("md5").update(JSON.stringify(tree)).digest("hex");
112742
+ }
112743
+ var init_file_tree_data_hash = () => {};
112744
+
112744
112745
  // src/infrastructure/services/workspace/git-workspace-porcelain.ts
112745
112746
  import { existsSync as existsSync9 } from "node:fs";
112746
112747
  import path4 from "node:path";
@@ -116074,6 +116075,17 @@ var init_workspace_file_tree_delta_send = __esm(() => {
116074
116075
  function logSubscriptionWarn(label, err) {
116075
116076
  console.warn(`[${formatTimestamp()}] ⚠️ ${label}: ${getErrorMessage(err)}`);
116076
116077
  }
116078
+ async function runOneShotFileTreeSync(session2, workingDir) {
116079
+ const normalized = normalizeWorkingDirForLookup(workingDir);
116080
+ const tree = await scanFileTree(normalized);
116081
+ const send = createWorkspaceFileTreeCheckpointSend(session2, normalized);
116082
+ await send({ tree, revision: 0 });
116083
+ await session2.backend.mutation(api.workspaceFiles.fulfillFileTreeRequest, {
116084
+ sessionId: session2.sessionId,
116085
+ machineId: session2.machineId,
116086
+ workingDir: normalized
116087
+ });
116088
+ }
116077
116089
  async function stopCoordinatorForWorkingDir(coordinators, checkpointOutboxRegistry, deltaOutboxRegistry, normalized) {
116078
116090
  const coordinatorPromise = coordinators.get(normalized);
116079
116091
  if (!coordinatorPromise)
@@ -116082,8 +116094,8 @@ async function stopCoordinatorForWorkingDir(coordinators, checkpointOutboxRegist
116082
116094
  await coordinatorPromise.then((coordinator2) => coordinator2.stop()).catch(() => {
116083
116095
  return;
116084
116096
  });
116085
- await checkpointOutboxRegistry.stop(normalized);
116086
- await deltaOutboxRegistry.stop(normalized);
116097
+ await checkpointOutboxRegistry?.stop(normalized);
116098
+ await deltaOutboxRegistry?.stop(normalized);
116087
116099
  }
116088
116100
  async function drainPendingFileTreeReleaseRequests(session2, coordinators, checkpointOutboxRegistry, deltaOutboxRegistry) {
116089
116101
  const releases = await session2.backend.query(api.workspaceFiles.getPendingFileTreeReleaseRequests, {
@@ -116108,7 +116120,36 @@ async function drainPendingFileTreeReleaseRequests(session2, coordinators, check
116108
116120
  });
116109
116121
  }
116110
116122
  }
116111
- async function processPendingFileTreeRequests(session2, coordinators, ensureCoordinator, requests) {
116123
+ async function processOnePendingFileTreeRequest(session2, coordinators, ensureCoordinator, normalized, force, checkpointOutboxRegistry, deltaOutboxRegistry) {
116124
+ const start3 = Date.now();
116125
+ const lease = await session2.backend.query(api.workspaceFiles.getFileTreeWatchLease, {
116126
+ sessionId: session2.sessionId,
116127
+ machineId: session2.machineId,
116128
+ workingDir: normalized
116129
+ });
116130
+ if (!lease?.leaseActive) {
116131
+ await stopCoordinatorForWorkingDir(coordinators, checkpointOutboxRegistry, deltaOutboxRegistry, normalized);
116132
+ await runOneShotFileTreeSync(session2, normalized);
116133
+ console.log(`[${formatTimestamp()}] \uD83C\uDF33 File tree ready: ${normalized} (${Date.now() - start3}ms, one-shot)`);
116134
+ return;
116135
+ }
116136
+ await ensureCoordinator(normalized, force);
116137
+ await session2.backend.mutation(api.workspaceFiles.fulfillFileTreeRequest, {
116138
+ sessionId: session2.sessionId,
116139
+ machineId: session2.machineId,
116140
+ workingDir: normalized
116141
+ });
116142
+ const leaseAfterFulfill = await session2.backend.query(api.workspaceFiles.getFileTreeWatchLease, {
116143
+ sessionId: session2.sessionId,
116144
+ machineId: session2.machineId,
116145
+ workingDir: normalized
116146
+ });
116147
+ if (!leaseAfterFulfill?.leaseActive) {
116148
+ await stopCoordinatorForWorkingDir(coordinators, checkpointOutboxRegistry, deltaOutboxRegistry, normalized);
116149
+ }
116150
+ console.log(`[${formatTimestamp()}] \uD83C\uDF33 File tree ready: ${normalized} (${Date.now() - start3}ms${force ? ", reconciled" : ", cached"})`);
116151
+ }
116152
+ async function processPendingFileTreeRequests(session2, coordinators, ensureCoordinator, requests, checkpointOutboxRegistry, deltaOutboxRegistry) {
116112
116153
  if (!requests?.length)
116113
116154
  return;
116114
116155
  const requestsByDir = new Map;
@@ -116118,25 +116159,20 @@ async function processPendingFileTreeRequests(session2, coordinators, ensureCoor
116118
116159
  }
116119
116160
  for (const [normalized, force] of requestsByDir) {
116120
116161
  await enqueueFileTreeSync(session2.machineId, normalized, async () => {
116121
- const start3 = Date.now();
116122
- await ensureCoordinator(normalized, force).then(() => session2.backend.mutation(api.workspaceFiles.fulfillFileTreeRequest, {
116123
- sessionId: session2.sessionId,
116124
- machineId: session2.machineId,
116125
- workingDir: normalized
116126
- })).then(() => {
116127
- console.log(`[${formatTimestamp()}] \uD83C\uDF33 File tree ready: ${normalized} (${Date.now() - start3}ms${force ? ", reconciled" : ", cached"})`);
116128
- }).catch((err) => {
116162
+ try {
116163
+ await processOnePendingFileTreeRequest(session2, coordinators, ensureCoordinator, normalized, force, checkpointOutboxRegistry, deltaOutboxRegistry);
116164
+ } catch (err) {
116129
116165
  logSubscriptionWarn(`File tree failed for ${normalized}`, err);
116130
- });
116166
+ }
116131
116167
  });
116132
116168
  }
116133
116169
  }
116134
- async function drainPendingFileTreeRequests(session2, coordinators, ensureCoordinator) {
116170
+ async function drainPendingFileTreeRequests(session2, coordinators, ensureCoordinator, checkpointOutboxRegistry, deltaOutboxRegistry) {
116135
116171
  const requests = await session2.backend.query(api.workspaceFiles.getPendingFileTreeRequests, {
116136
116172
  sessionId: session2.sessionId,
116137
116173
  machineId: session2.machineId
116138
116174
  });
116139
- await processPendingFileTreeRequests(session2, coordinators, ensureCoordinator, requests);
116175
+ await processPendingFileTreeRequests(session2, coordinators, ensureCoordinator, requests, checkpointOutboxRegistry, deltaOutboxRegistry);
116140
116176
  }
116141
116177
  var startFileTreeSubscriptionEffect = () => exports_Effect.gen(function* () {
116142
116178
  const session2 = yield* DaemonSessionService;
@@ -116185,7 +116221,7 @@ var startFileTreeSubscriptionEffect = () => exports_Effect.gen(function* () {
116185
116221
  });
116186
116222
  };
116187
116223
  return {
116188
- drainPendingFileTreeRequests: () => drainPendingFileTreeRequests(session2, coordinators, ensureCoordinator),
116224
+ drainPendingFileTreeRequests: () => drainPendingFileTreeRequests(session2, coordinators, ensureCoordinator, checkpointOutboxRegistry, deltaOutboxRegistry),
116189
116225
  drainPendingFileTreeReleaseRequests: () => drainPendingFileTreeReleaseRequests(session2, coordinators, checkpointOutboxRegistry, deltaOutboxRegistry),
116190
116226
  stop: () => {
116191
116227
  (async () => {
@@ -116201,6 +116237,7 @@ var startFileTreeSubscriptionEffect = () => exports_Effect.gen(function* () {
116201
116237
  var init_file_tree_subscription = __esm(() => {
116202
116238
  init_esm();
116203
116239
  init_api3();
116240
+ init_file_tree_scanner();
116204
116241
  init_workspace_file_tree_coordinator();
116205
116242
  init_workspace_sync_queue();
116206
116243
  init_convex_error();
@@ -134469,7 +134506,9 @@ var init_opencode_install = __esm(() => {
134469
134506
 
134470
134507
  // src/infrastructure/retry-queue.ts
134471
134508
  async function withRetry(fn2, opts) {
134472
- const { maxRetries, baseDelayMs, maxDelayMs } = { ...DEFAULTS, ...opts };
134509
+ const maxRetries = opts?.maxRetries ?? DEFAULTS.maxRetries;
134510
+ const baseDelayMs = opts?.baseDelayMs ?? DEFAULTS.baseDelayMs;
134511
+ const maxDelayMs = opts?.maxDelayMs ?? DEFAULTS.maxDelayMs;
134473
134512
  for (let attempt = 0;attempt <= maxRetries; attempt++) {
134474
134513
  try {
134475
134514
  return await fn2();
@@ -135092,4 +135131,4 @@ program2.hook("preAction", async (_thisCommand, actionCommand) => {
135092
135131
  });
135093
135132
  program2.parse();
135094
135133
 
135095
- //# debugId=48E3BD8E7ACDCBFA64756E2164756E21
135134
+ //# debugId=56DD8E367644E33A64756E2164756E21