@wakeshift/sdk 0.7.2 → 0.7.3

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
@@ -2,6 +2,12 @@
2
2
 
3
3
  What changed in each release of `@wakeshift/sdk`. 0.4.0 is the first published release: to start with it, read the [README](README.md). Its notes below, and the earlier releases', are for apps that ran the preview builds.
4
4
 
5
+ ## 0.7.3 (2026-11-02)
6
+
7
+ ### Fixed
8
+
9
+ - **An unsubscribe without the session key says so.** When a wrapped tool's `call.unsubscribe` ends nothing because the call didn't pass the conversation's `session_key` (Claude Code's calls name no conversation, so the key is the only way Wakeshift finds it), Wakeshift's block on that call now tells the agent that nothing ended, to call again with the key it was given when it subscribed, and not to subscribe again until it has. `call.unsubscribe` still returns `false`, and the note follows your tool's own text. Before, the agent saw only your text ("This chat wasn't watching…"), subscribed again without the key, and got every message twice. The built-in `unsubscribe_events` tool's reply carries the same note.
10
+
5
11
  ## 0.7.2 (2026-11-02)
6
12
 
7
13
  ### Fixed
package/dist/toolcall.js CHANGED
@@ -240,6 +240,9 @@ export class CallScope {
240
240
  armed = false;
241
241
  created = [];
242
242
  nativeLines = [];
243
+ // Wakeshift's notes from the call's unsubscribes (one that ended nothing
244
+ // because the call passed no session key), for the block.
245
+ notes = [];
243
246
  inflight = new Set();
244
247
  queue = Promise.resolve();
245
248
  // The client's name identify gave, for a request that names none.
@@ -330,7 +333,16 @@ export class CallScope {
330
333
  const known = event.parseArgs(args);
331
334
  if (this.native)
332
335
  return this.endNative(event.name, known);
333
- const out = await this.at.wake.requestApp("POST", "/event-subscriptions/unsubscribe", { call: this.wire(), name: event.name, arguments: known });
336
+ const out = await this.at.wake.requestApp("POST", "/event-subscriptions/unsubscribe", {
337
+ call: this.wire(),
338
+ name: event.name,
339
+ arguments: known,
340
+ });
341
+ // addition: the call passed no session key, so it ended nothing; the
342
+ // block says to call again with it.
343
+ const note = out.addition?.text?.trim();
344
+ if (note && !this.notes.includes(note))
345
+ this.notes.push(note);
334
346
  return !!out.ended;
335
347
  });
336
348
  }
@@ -402,7 +414,16 @@ export class CallScope {
402
414
  // should subscribe to. A call that names no conversation, and subscribed
403
415
  // nothing, gets nothing (null). Only a failure for a call that subscribed
404
416
  // is thrown: without a subscription, the block is a courtesy.
417
+ //
418
+ // Notes from the call's unsubscribes come first, whatever else it gets.
405
419
  async addition() {
420
+ const add = await this.fetchAddition();
421
+ if (this.notes.length === 0)
422
+ return add;
423
+ const text = [this.notes.join(" "), add?.text?.trim() ?? ""].filter(Boolean).join("\n\n");
424
+ return { ...(add ?? {}), text };
425
+ }
426
+ async fetchAddition() {
406
427
  const wire = this.wire();
407
428
  if (!this.pending && this.nativeLines.length === 0 && !wire.session && !wire.conversation && !namesConversation(wire.meta))
408
429
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wakeshift/sdk",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "description": "Let agents subscribe to things in your app: Wakeshift wakes them when you emit an event.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Clawvisor Inc. <support@wakeshift.ai>",