@myagentroam/node 0.13.6 → 0.13.8

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.
@@ -28,6 +28,7 @@ export class HostedConversationNodeService {
28
28
  cleanupLocks = new Set();
29
29
  historyMutations = new Map();
30
30
  historyVersions = new Map();
31
+ historyEpoch = randomUUID();
31
32
  disablePrepared = false;
32
33
  workbenchSequence = 0;
33
34
  hostedWatch;
@@ -338,6 +339,7 @@ export class HostedConversationNodeService {
338
339
  run: this.runs.current(conversation.id)?.run ?? null,
339
340
  turns: history.turns,
340
341
  historyNextCursor: history.nextCursor,
342
+ historyVersion: `${this.historyEpoch}:${this.historyVersions.get(conversationId) ?? 0}`,
341
343
  files: this.options.store.listFiles(userId, conversation.id),
342
344
  models: models.map(modelSummary),
343
345
  error: null,
@@ -1 +1 @@
1
- {"type":"module","version":"0.13.6"}
1
+ {"type":"module","version":"0.13.8"}
@@ -49,7 +49,7 @@ export function prepareComposerResourceInput(input, cwd, workspacePath) {
49
49
  if (part.kind !== 'mar_references')
50
50
  return part.raw;
51
51
  return serializeComposerTag('mar_references', {
52
- references: part.payload.references.map((reference) => reference.type === 'session'
52
+ references: part.payload.references.map((reference) => reference.type !== 'file' && reference.type !== 'directory'
53
53
  ? reference
54
54
  : {
55
55
  ...reference,
@@ -6,6 +6,7 @@ const INTERVAL_MS = 2_000;
6
6
  const TTL_MS = 45_000;
7
7
  const MAX_FAILURES = 3;
8
8
  const INITIAL_SEGMENT_LIMIT = 6;
9
+ /** Owns shared native observation and page leases; history invalidation restarts reads, not leases. */
9
10
  export class NativeSessionWatchService {
10
11
  options;
11
12
  watches = new Map();
@@ -173,10 +174,21 @@ export class NativeSessionWatchService {
173
174
  this.watches.delete(sessionId);
174
175
  }
175
176
  invalidate(sessionId) {
176
- for (const [ownerKey, lease] of this.leases)
177
- if (lease.sessionId === sessionId)
178
- this.removeLease(ownerKey);
179
177
  this.stop(sessionId);
178
+ for (const [ownerKey, lease] of this.leases) {
179
+ if (lease.sessionId !== sessionId)
180
+ continue;
181
+ // Replace the lease object so pre-reset asynchronous reads cannot publish into it.
182
+ const replacement = {
183
+ ...lease,
184
+ ready: false,
185
+ snapshotSent: false,
186
+ historyReset: true,
187
+ pendingEvents: []
188
+ };
189
+ this.leases.set(ownerKey, replacement);
190
+ void this.initializeLease(replacement, this.options.projectInitialPage);
191
+ }
180
192
  }
181
193
  clear() {
182
194
  for (const watch of this.watches.values()) {
@@ -460,6 +472,7 @@ export class NativeSessionWatchService {
460
472
  lease.snapshotSent = true;
461
473
  this.options.emitWatchEvent?.({
462
474
  type: 'watch.session.snapshot',
475
+ ...(lease.historyReset ? { historyReset: true } : {}),
463
476
  workbenchConnectionId: lease.workbenchConnectionId,
464
477
  watchId: lease.watchId,
465
478
  nodeGeneration: lease.nodeGeneration,
@@ -471,6 +484,7 @@ export class NativeSessionWatchService {
471
484
  expiresAt: lease.expiresAt,
472
485
  payload
473
486
  });
487
+ delete lease.historyReset;
474
488
  }
475
489
  releasePendingEvents(sessionId) {
476
490
  for (const lease of this.leases.values()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myagentroam/node",
3
- "version": "0.13.6",
3
+ "version": "0.13.8",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/myagentroam/mar.git",
@@ -49,14 +49,14 @@
49
49
  "turndown-plugin-gfm": "^1.0.2",
50
50
  "ws": "^8.21.3",
51
51
  "zod": "4.4.3",
52
- "@myagentroam/agent": "0.13.6",
53
- "@myagentroam/protocol": "0.13.6"
52
+ "@myagentroam/agent": "0.13.8",
53
+ "@myagentroam/protocol": "0.13.8"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/turndown": "^5.0.6",
57
57
  "@types/ws": "^8.18.1",
58
- "@myagentroam/marctl": "0.13.6",
59
- "@myagentroam/code-navigation": "0.11.1"
58
+ "@myagentroam/code-navigation": "0.11.1",
59
+ "@myagentroam/marctl": "0.13.8"
60
60
  },
61
61
  "exports": {
62
62
  "./config": {