@myagentroam/node 0.9.149 → 0.9.150

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.
@@ -152,8 +152,6 @@ export class MarAgentHostedConversationRuntime {
152
152
  await input.onEvent?.(projected);
153
153
  }
154
154
  const result = await execution.result();
155
- if (result.status === 'cancelled')
156
- titleController.abort();
157
155
  const generatedTitle = await titleTask;
158
156
  if (generatedTitle && !titleController.signal.aborted)
159
157
  await agent
@@ -203,25 +201,31 @@ export class MarAgentHostedConversationRuntime {
203
201
  cancel: () => {
204
202
  if (settled || this.#active.get(input.sessionId)?.handle !== handle)
205
203
  return false;
206
- titleController.abort();
207
204
  execution.cancel();
208
205
  return true;
209
206
  }
210
207
  };
211
- this.#active.set(input.sessionId, { handle, completion });
208
+ this.#active.set(input.sessionId, {
209
+ handle,
210
+ completion,
211
+ cancelTitle: () => titleController.abort()
212
+ });
212
213
  return handle;
213
214
  }
214
215
  async releaseSession(input) {
215
216
  const active = this.#active.get(input.sessionId);
216
217
  if (active === undefined)
217
218
  return;
219
+ active.cancelTitle();
218
220
  active.handle.cancel();
219
221
  await active.completion.catch(() => undefined);
220
222
  }
221
223
  async dispose() {
222
224
  const active = [...this.#active.values()];
223
- for (const execution of active)
225
+ for (const execution of active) {
226
+ execution.cancelTitle();
224
227
  execution.handle.cancel();
228
+ }
225
229
  await Promise.allSettled(active.map((execution) => execution.completion));
226
230
  }
227
231
  async #readGeneratedTitle(homeDirectory, sessionId) {
@@ -52,11 +52,15 @@ export class MarAgentManagedRunController {
52
52
  return this.#disposePromise;
53
53
  this.#disposed = true;
54
54
  this.#disposePromise = (async () => {
55
- for (const execution of this.#executions.values())
55
+ for (const execution of this.#executions.values()) {
56
+ execution.cancelTitle();
56
57
  execution.cancel();
58
+ }
57
59
  await Promise.allSettled([...new Set(this.#runtimeAcquisitions.values())]);
58
- for (const execution of this.#executions.values())
60
+ for (const execution of this.#executions.values()) {
61
+ execution.cancelTitle();
59
62
  execution.cancel();
63
+ }
60
64
  await Promise.all([...new Set(this.#sessionRuntimes.values())].map((runtime) => this.#releaseRuntime(runtime)));
61
65
  await this.#mcpClients.close();
62
66
  await this.#computerUse?.dispose();
@@ -74,8 +78,11 @@ export class MarAgentManagedRunController {
74
78
  await this.#computerUse?.releaseSession(sessionId);
75
79
  return;
76
80
  }
77
- if (runtime.activeRunId !== undefined)
78
- this.#executions.get(runtime.activeRunId)?.cancel();
81
+ if (runtime.activeRunId !== undefined) {
82
+ const execution = this.#executions.get(runtime.activeRunId);
83
+ execution?.cancelTitle();
84
+ execution?.cancel();
85
+ }
79
86
  await this.#releaseRuntime(runtime);
80
87
  await Promise.all([
81
88
  this.#computerUse?.releaseSession(sessionId),
@@ -379,10 +386,8 @@ export class MarAgentManagedRunController {
379
386
  ? session.compact(runInput)
380
387
  : session.run(runInput);
381
388
  this.#executions.set(input.runId, {
382
- cancel: () => {
383
- titleController.abort();
384
- handle.cancel();
385
- }
389
+ cancel: () => handle.cancel(),
390
+ cancelTitle: () => titleController.abort()
386
391
  });
387
392
  this.host.emit(input.runId, 'run.running', {}, 'RUNNING');
388
393
  for await (const event of handle) {
@@ -398,8 +403,6 @@ export class MarAgentManagedRunController {
398
403
  this.project(input.runId, event);
399
404
  }
400
405
  const result = await handle.result();
401
- if (result.status === 'cancelled')
402
- titleController.abort();
403
406
  const title = await titleTask;
404
407
  if (title && !titleController.signal.aborted)
405
408
  await runtime.agent
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myagentroam/node",
3
- "version": "0.9.149",
3
+ "version": "0.9.150",
4
4
  "description": "MyAgentRoam Node runtime CLI.",
5
5
  "license": "Apache-2.0 AND GPL-2.0-or-later",
6
6
  "type": "module",
@@ -34,10 +34,10 @@
34
34
  "npm": "11.12.1",
35
35
  "ws": "^8.21.3",
36
36
  "zod": "4.4.3",
37
+ "@myagentroam/marctl": "0.9.120",
38
+ "@myagentroam/agent": "0.9.150",
37
39
  "@myagentroam/code-navigation": "0.9.129",
38
- "@myagentroam/agent": "0.9.149",
39
- "@myagentroam/protocol": "0.9.149",
40
- "@myagentroam/marctl": "0.9.120"
40
+ "@myagentroam/protocol": "0.9.150"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/ws": "^8.18.1"