@myagentroam/node 0.10.61 → 0.10.63

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/database.js CHANGED
@@ -363,13 +363,14 @@ export class NodeDatabase {
363
363
  if (current === undefined || current['pin_order'] === null)
364
364
  throw new Error('SESSION_NOT_PINNED');
365
365
  const order = numberValue(current, 'pin_order');
366
+ const workspaceId = stringValue(current, 'workspace_id');
366
367
  const adjacent = this.raw
367
368
  .prepare(direction === 'up'
368
369
  ? 'SELECT id, pin_order FROM agent_sessions WHERE workspace_id = ? AND pin_order < ? ORDER BY pin_order DESC LIMIT 1'
369
370
  : 'SELECT id, pin_order FROM agent_sessions WHERE workspace_id = ? AND pin_order > ? ORDER BY pin_order ASC LIMIT 1')
370
- .get(stringValue(current, 'workspace_id'), order);
371
+ .get(workspaceId, order);
371
372
  if (adjacent === undefined)
372
- return;
373
+ return workspaceId;
373
374
  this.raw.exec('BEGIN IMMEDIATE');
374
375
  try {
375
376
  this.raw
@@ -384,6 +385,7 @@ export class NodeDatabase {
384
385
  this.raw.exec('ROLLBACK');
385
386
  throw error;
386
387
  }
388
+ return workspaceId;
387
389
  }
388
390
  deleteSessionRecord(sessionId) {
389
391
  this.raw.exec('BEGIN IMMEDIATE');
@@ -249,7 +249,21 @@ export class ClaudeCodeRunner extends AbstractRunner {
249
249
  }
250
250
  return deduplicateDirectSessions(sessions);
251
251
  }
252
- stop() { }
252
+ stop() {
253
+ for (const approval of this.execution.approvals.values()) {
254
+ clearTimeout(approval.timer);
255
+ approval.resolve('REJECTED');
256
+ }
257
+ this.execution.approvals.clear();
258
+ for (const pending of this.execution.userInputs.values()) {
259
+ clearTimeout(pending.timer);
260
+ pending.reject('NODE_STOPPED');
261
+ }
262
+ this.execution.userInputs.clear();
263
+ for (const run of this.execution.runs.values())
264
+ run.handle.cancel();
265
+ this.execution.runs.clear();
266
+ }
253
267
  start(input) {
254
268
  return this.client.start(input);
255
269
  }