@tmcp/session-manager 0.2.0 → 0.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @tmcp/session-manager
2
2
 
3
+ ## 0.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 77be8a1: chore: add license
8
+
9
+ ## 0.2.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 5613d43: fix: handle `resources/unsubscribe`
14
+ - Updated dependencies [5613d43]
15
+ - tmcp@1.16.3
16
+
3
17
  ## 0.2.0
4
18
 
5
19
  ### Minor Changes
package/README.md CHANGED
@@ -153,8 +153,12 @@ const sessionManagers = {
153
153
  info: new InMemoryInfoSessionManager(),
154
154
  };
155
155
 
156
- const httpTransport = new HttpTransport(server, { sessionManager: sessionManagers });
157
- const sseTransport = new SseTransport(server, { sessionManager: sessionManagers });
156
+ const httpTransport = new HttpTransport(server, {
157
+ sessionManager: sessionManagers,
158
+ });
159
+ const sseTransport = new SseTransport(server, {
160
+ sessionManager: sessionManagers,
161
+ });
158
162
  ```
159
163
 
160
164
  ## Related Packages
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@tmcp/session-manager",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
+ "license": "MIT",
4
5
  "description": "",
5
6
  "main": "src/index.js",
6
7
  "repository": {
@@ -24,7 +25,7 @@
24
25
  },
25
26
  "type": "module",
26
27
  "peerDependencies": {
27
- "tmcp": "^1.16.0"
28
+ "tmcp": "^1.16.3"
28
29
  },
29
30
  "publishConfig": {
30
31
  "access": "public"
@@ -32,6 +33,7 @@
32
33
  "devDependencies": {
33
34
  "dts-buddy": "^0.6.2",
34
35
  "publint": "^0.3.12",
36
+ "tmcp": "^1.19.4",
35
37
  "@tmcp/internal-ts-helpers": "^1.0.0"
36
38
  },
37
39
  "scripts": {
package/src/index.js CHANGED
@@ -174,6 +174,15 @@ export class InfoSessionManager {
174
174
  throw new Error('Method not implemented.');
175
175
  }
176
176
 
177
+ /**
178
+ * @abstract
179
+ * @param {string} id
180
+ * @param {string} uri
181
+ */
182
+ removeSubscription(id, uri) {
183
+ throw new Error('Method not implemented.');
184
+ }
185
+
177
186
  /**
178
187
  * @abstract
179
188
  * @param {string} id
@@ -278,6 +287,16 @@ export class InMemoryInfoSessionManager extends InfoSessionManager {
278
287
  subscriptions.add(id);
279
288
  }
280
289
 
290
+ /**
291
+ * @type {InfoSessionManager["removeSubscription"]}
292
+ */
293
+ removeSubscription(id, uri) {
294
+ let subscriptions = this.#subscriptions.get(uri);
295
+ if (subscriptions) {
296
+ subscriptions.delete(id);
297
+ }
298
+ }
299
+
281
300
  /**
282
301
  * @type {InfoSessionManager["delete"]}
283
302
  */
@@ -67,6 +67,10 @@ declare module '@tmcp/session-manager' {
67
67
  * @abstract
68
68
  * */
69
69
  abstract addSubscription(id: string, uri: string): void;
70
+ /**
71
+ * @abstract
72
+ * */
73
+ abstract removeSubscription(id: string, uri: string): void;
70
74
  /**
71
75
  * @abstract
72
76
  * */
@@ -13,6 +13,6 @@
13
13
  "sourcesContent": [
14
14
  null
15
15
  ],
16
- "mappings": ";;;;;;;;cASaA,oBAAoBA;;;;;;;;;;;;;;;;;;cAwCpBC,4BAA4BA;;;;;;;;;;;;;;cAsD5BC,kBAAkBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkFlBC,0BAA0BA",
16
+ "mappings": ";;;;;;;;cASaA,oBAAoBA;;;;;;;;;;;;;;;;;;cAwCpBC,4BAA4BA;;;;;;;;;;;;;;cAsD5BC,kBAAkBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2FlBC,0BAA0BA",
17
17
  "ignoreList": []
18
18
  }