@sjawhar/claude-envoy 4.5.0 → 4.5.1

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.
@@ -2,5 +2,5 @@
2
2
  "name": "claude-envoy",
3
3
  "description": "Put Envoy events into the Claude Code session's own conversation and expose Envoy MCP tools.",
4
4
  "mcpServers": "./.mcp.json",
5
- "version": "4.5.0"
5
+ "version": "4.5.1"
6
6
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-envoy",
3
- "version": "4.5.0",
3
+ "version": "4.5.1",
4
4
  "description": "Put Envoy events into the Claude Code session's own conversation and expose Envoy MCP tools.",
5
5
  "mcpServers": {}
6
6
  }
@@ -57868,7 +57868,7 @@ var import_nats2 = __toESM(require_mod4(), 1);
57868
57868
 
57869
57869
  // package.json
57870
57870
  var name2 = "@sjawhar/claude-envoy";
57871
- var version2 = "4.5.0";
57871
+ var version2 = "4.5.1";
57872
57872
  var legion = {
57873
57873
  daemonApiVersion: 152
57874
57874
  };
@@ -58106,25 +58106,29 @@ class AgentStreamPublisher {
58106
58106
  this.#fitCommands(subject);
58107
58107
  }
58108
58108
  setContext(subject, usage) {
58109
- if (usage === undefined)
58110
- return;
58111
- if (!(usage.contextWindow > 0))
58112
- return;
58113
- if (typeof usage.percent !== "number" && !(usage.tokens > 0))
58114
- return;
58115
- const kept = {
58116
- contextWindow: usage.contextWindow,
58117
- tokens: usage.tokens
58118
- };
58119
- const json = JSON.stringify(kept);
58120
- if (json === this.#contextJson)
58121
- return;
58122
- this.#context = kept;
58123
- this.#contextJson = json;
58109
+ if (usage === undefined || !(usage.contextWindow > 0)) {
58110
+ if (this.#context === "cleared")
58111
+ return;
58112
+ this.#context = "cleared";
58113
+ this.#contextJson = undefined;
58114
+ } else {
58115
+ if (typeof usage.percent !== "number" && !(usage.tokens > 0))
58116
+ return;
58117
+ const kept = {
58118
+ contextWindow: usage.contextWindow,
58119
+ tokens: usage.tokens
58120
+ };
58121
+ const json = JSON.stringify(kept);
58122
+ if (json === this.#contextJson)
58123
+ return;
58124
+ this.#context = kept;
58125
+ this.#contextJson = json;
58126
+ }
58124
58127
  this.#seq += 1;
58125
58128
  this.#contextSeq = this.#seq;
58126
- if (this.watched)
58127
- this.#deps.publish(subject, JSON.stringify(this.#contextFrame(kept)));
58129
+ if (this.watched) {
58130
+ this.#deps.publish(subject, JSON.stringify(this.#contextFrame(this.#context)));
58131
+ }
58128
58132
  this.#fitCommands(subject);
58129
58133
  }
58130
58134
  #fitCommands(subject) {
@@ -58165,6 +58169,9 @@ class AgentStreamPublisher {
58165
58169
  return { ...settings, kind: "settings", seq: this.#settingsSeq, v: AGENT_STREAM_PROTOCOL };
58166
58170
  }
58167
58171
  #contextFrame(context) {
58172
+ if (context === "cleared") {
58173
+ return { kind: "context-cleared", seq: this.#contextSeq, v: AGENT_STREAM_PROTOCOL };
58174
+ }
58168
58175
  return { ...context, kind: "context", seq: this.#contextSeq, v: AGENT_STREAM_PROTOCOL };
58169
58176
  }
58170
58177
  record(subject, raw, streaming, dispatchMessageId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/claude-envoy",
3
- "version": "4.5.0",
3
+ "version": "4.5.1",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Claude Code plugin for Legion's Envoy bus",
6
6
  "type": "module",