@pwrdrvr/agent-acp 0.12.1 → 0.12.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/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Client } from '@zed-industries/agent-client-protocol';
1
+ import { Client } from '@agentclientprotocol/sdk';
2
2
  import { Logger, AgentBackend, NormalizedThreadEvent, Unsubscribe, AgentBackendToolCallHandler, AgentBackendApprovalHandler, AgentStartThreadOptions, AgentBackendStartThreadResult, AgentStartTurnOptions, NormalizedTokenUsage, NormalizedToolCall } from '@pwrdrvr/agent-core';
3
3
  import { JsonRpcId } from '@pwrdrvr/agent-transport';
4
4
 
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import { Readable, Writable } from "stream";
4
4
  import {
5
5
  ClientSideConnection,
6
6
  ndJsonStream
7
- } from "@zed-industries/agent-client-protocol";
7
+ } from "@agentclientprotocol/sdk";
8
8
  import { noopLogger } from "@pwrdrvr/agent-core";
9
9
  function isPlainObject(value) {
10
10
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -22,6 +22,7 @@ function sanitizeAcpNotificationLine(line) {
22
22
  if (!isPlainObject(params)) return line;
23
23
  const update = params.update;
24
24
  if (!isPlainObject(update)) return line;
25
+ if (update.sessionUpdate === "config_option_update") return "";
25
26
  let changed = false;
26
27
  for (const key of ["rawInput", "rawOutput"]) {
27
28
  if (!(key in update)) continue;
@@ -48,13 +49,15 @@ function sanitizeInboundStream(source) {
48
49
  while (nl !== -1) {
49
50
  const line = buffer.slice(0, nl);
50
51
  buffer = buffer.slice(nl + 1);
51
- controller.enqueue(encoder.encode(sanitizeAcpNotificationLine(line) + "\n"));
52
+ const sanitized = sanitizeAcpNotificationLine(line);
53
+ if (sanitized.length > 0) controller.enqueue(encoder.encode(sanitized + "\n"));
52
54
  nl = buffer.indexOf("\n");
53
55
  }
54
56
  },
55
57
  flush(controller) {
56
58
  if (buffer.length > 0) {
57
- controller.enqueue(encoder.encode(sanitizeAcpNotificationLine(buffer)));
59
+ const sanitized = sanitizeAcpNotificationLine(buffer);
60
+ if (sanitized.length > 0) controller.enqueue(encoder.encode(sanitized));
58
61
  buffer = "";
59
62
  }
60
63
  }