agent-transport-system 0.7.82 → 0.7.83

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/ats.js CHANGED
@@ -30,12 +30,12 @@ import { Box, Container, Editor, Key, ProcessTerminal, TUI, Text, getEditorKeybi
30
30
  import { ReadStream, WriteStream } from "node:tty";
31
31
 
32
32
  //#region package.json
33
- var version = "0.7.82";
33
+ var version = "0.7.83";
34
34
  var package_default = {
35
35
  $schema: "https://www.schemastore.org/package.json",
36
36
  name: "agent-transport-system",
37
37
  version,
38
- atsReleaseDate: "2026-06-24",
38
+ atsReleaseDate: "2026-06-25",
39
39
  description: "Agent Transport System CLI - https://ats.sh",
40
40
  license: "MIT",
41
41
  type: "module",
@@ -4833,6 +4833,7 @@ const MAX_SPACE_REQUEST_TIMEOUT_MS = 12e4;
4833
4833
  const DEFAULT_HEARTBEAT_INTERVAL_MS$1 = 25e3;
4834
4834
  const MIN_HEARTBEAT_INTERVAL_MS$2 = 5e3;
4835
4835
  const MAX_HEARTBEAT_INTERVAL_MS$2 = 6e4;
4836
+ const DAEMON_STREAM_KEEPALIVE_INTERVAL_MS$1 = 2e4;
4836
4837
  const CATALOG_SYNC_RETRY_INTERVAL_MS$1 = 5e3;
4837
4838
  const CATALOG_SYNC_SIGNAL_POLL_INTERVAL_MS$1 = 1e3;
4838
4839
  const RUNTIME_AGENT_CONTROLLER_REPORT_SYNC_INTERVAL_MS$1 = 5 * 6e4;
@@ -20554,6 +20555,7 @@ const CATALOG_SYNC_RETRY_INTERVAL_MS = CATALOG_SYNC_RETRY_INTERVAL_MS$1;
20554
20555
  const CATALOG_SYNC_SIGNAL_POLL_INTERVAL_MS = CATALOG_SYNC_SIGNAL_POLL_INTERVAL_MS$1;
20555
20556
  const DAEMON_RUNTIME_CONTRACT_EPOCH = DAEMON_RUNTIME_CONTRACT_EPOCH$1;
20556
20557
  const DAEMON_STREAM_CONNECT_TIMEOUT_MS = DAEMON_STREAM_CONNECT_TIMEOUT_MS$1;
20558
+ const DAEMON_STREAM_KEEPALIVE_INTERVAL_MS = DAEMON_STREAM_KEEPALIVE_INTERVAL_MS$1;
20557
20559
  const DEFAULT_HEARTBEAT_INTERVAL_MS = DEFAULT_HEARTBEAT_INTERVAL_MS$1;
20558
20560
  const HEARTBEAT_RESPONSE_TIMEOUT_MS = HEARTBEAT_RESPONSE_TIMEOUT_MS$1;
20559
20561
  const MAX_HEARTBEAT_INTERVAL_MS = MAX_HEARTBEAT_INTERVAL_MS$2;
@@ -22113,6 +22115,7 @@ function listSpaceMemberDirectorySendTargets(directory) {
22113
22115
  return [...directory.members];
22114
22116
  }
22115
22117
  const MENTION_START_PATTERN = /[\w\\]/u;
22118
+ const MENTION_LEADING_WHITESPACE_PATTERN = /^@\s/u;
22116
22119
  function extractMentionAuthoringPrefix(textBeforeCursor) {
22117
22120
  if (!textBeforeCursor) return null;
22118
22121
  for (let currentIndex = textBeforeCursor.length - 1; currentIndex >= 0; currentIndex -= 1) {
@@ -22121,6 +22124,7 @@ function extractMentionAuthoringPrefix(textBeforeCursor) {
22121
22124
  if (previousCharacter.length > 0 && MENTION_START_PATTERN.test(previousCharacter)) continue;
22122
22125
  const prefix = textBeforeCursor.slice(currentIndex);
22123
22126
  if (prefix.includes("(") || prefix.includes(")")) return null;
22127
+ if (MENTION_LEADING_WHITESPACE_PATTERN.test(prefix)) return null;
22124
22128
  return prefix;
22125
22129
  }
22126
22130
  return null;
@@ -24946,6 +24950,8 @@ function resolveLocalAgentControllerBlockerReasonCodes(input) {
24946
24950
  //#endregion
24947
24951
  //#region ../../packages/protocol/dist/index.js
24948
24952
  const MAX_TEXT_LENGTH = 4e3;
24953
+ const DAEMON_STREAM_KEEPALIVE_PING = "ping";
24954
+ const DAEMON_STREAM_KEEPALIVE_PONG = "pong";
24949
24955
  function parseEnvelope$1(value) {
24950
24956
  const parsed = signalEnvelopeSchema.safeParse(value);
24951
24957
  return parsed.success ? parsed.data : null;
@@ -37698,6 +37704,7 @@ async function runDaemonSocketSession(input) {
37698
37704
  let routeCatalogSyncInFlight = false;
37699
37705
  let heartbeatTimer = null;
37700
37706
  let heartbeatTimerDueAtMs = null;
37707
+ let keepalivePingTimer = null;
37701
37708
  let lastDispatchActivityAtMs = null;
37702
37709
  let lastHeartbeatSentAtMs = null;
37703
37710
  let consecutiveHeartbeatFailures = 0;
@@ -37852,6 +37859,20 @@ async function runDaemonSocketSession(input) {
37852
37859
  heartbeatTimer = null;
37853
37860
  heartbeatTimerDueAtMs = null;
37854
37861
  };
37862
+ const clearKeepalivePingTimer = () => {
37863
+ if (!keepalivePingTimer) return;
37864
+ clearInterval(keepalivePingTimer);
37865
+ keepalivePingTimer = null;
37866
+ };
37867
+ const startKeepalivePing = () => {
37868
+ clearKeepalivePingTimer();
37869
+ keepalivePingTimer = setInterval(() => {
37870
+ if (closed) return;
37871
+ try {
37872
+ input.socket.send(DAEMON_STREAM_KEEPALIVE_PING);
37873
+ } catch {}
37874
+ }, DAEMON_STREAM_KEEPALIVE_INTERVAL_MS);
37875
+ };
37855
37876
  const resolvePendingRouteCatalogSyncRequests = (result) => {
37856
37877
  const pending = pendingRouteCatalogSyncRequests.splice(0, pendingRouteCatalogSyncRequests.length);
37857
37878
  for (const request of pending) request.resolve(result);
@@ -38476,6 +38497,7 @@ async function runDaemonSocketSession(input) {
38476
38497
  });
38477
38498
  });
38478
38499
  input.socket.onMessage((raw) => {
38500
+ if (raw === DAEMON_STREAM_KEEPALIVE_PONG) return;
38479
38501
  const parsedFrame = parseDaemonFrame(raw);
38480
38502
  if (!parsedFrame) {
38481
38503
  emitRunLine({
@@ -38598,6 +38620,7 @@ async function runDaemonSocketSession(input) {
38598
38620
  latestCatalogSyncSignalUpdatedAtMs = (await readDaemonCatalogSyncSignal().catch(() => null))?.updatedAtMs ?? 0;
38599
38621
  scheduleCatalogSyncSignalPoll();
38600
38622
  await sendHeartbeat();
38623
+ startKeepalivePing();
38601
38624
  await waitForClose;
38602
38625
  if (currentSocketRef.socket === input.socket) {
38603
38626
  currentSocketRef.socket = null;
@@ -38605,6 +38628,7 @@ async function runDaemonSocketSession(input) {
38605
38628
  }
38606
38629
  input.attachRouteCatalogSyncInvoker?.(null);
38607
38630
  clearHeartbeatTimer();
38631
+ clearKeepalivePingTimer();
38608
38632
  clearCatalogSyncSignalTimer();
38609
38633
  if (closeCode === 1e3 && closeReason === "shutdown") await localExecutionSlots.drain();
38610
38634
  else {