@openshain/mcp 0.2.0 → 0.4.0

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/src/session.ts CHANGED
@@ -3,6 +3,7 @@ import type { WorkId } from "@openshain/core";
3
3
  /** What one connection remembers: the work the agent is on, and the order of its calls. */
4
4
  export class Session {
5
5
  private currentId: WorkId | undefined;
6
+ private readonly known = new Set<WorkId>();
6
7
  private queue: Promise<unknown> = Promise.resolve();
7
8
 
8
9
  get current(): WorkId | undefined {
@@ -11,6 +12,12 @@ export class Session {
11
12
 
12
13
  select(id: WorkId): void {
13
14
  this.currentId = id;
15
+ this.known.add(id);
16
+ }
17
+
18
+ /** Whether this connection created or selected the work, so it may record its own events on it. */
19
+ knows(id: WorkId): boolean {
20
+ return this.known.has(id);
14
21
  }
15
22
 
16
23
  clear(): void {