@integrity-labs/agt-cli 0.19.10 → 0.19.12

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.
@@ -22,7 +22,7 @@ import {
22
22
  resolveChannels,
23
23
  resolveDmTarget,
24
24
  wrapScheduledTaskPrompt
25
- } from "../chunk-VL4VCDEN.js";
25
+ } from "../chunk-N6PGVBYF.js";
26
26
  import {
27
27
  findTaskByTemplate,
28
28
  getProjectDir,
@@ -1630,7 +1630,7 @@ function clearAgentCaches(agentId, codeName) {
1630
1630
  var cachedFrameworkVersion = null;
1631
1631
  var lastVersionCheckAt = 0;
1632
1632
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
1633
- var agtCliVersion = true ? "0.19.10" : "dev";
1633
+ var agtCliVersion = true ? "0.19.12" : "dev";
1634
1634
  function resolveBrewPath(execFileSync2) {
1635
1635
  try {
1636
1636
  const out = execFileSync2("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -4786,6 +4786,24 @@ async function pollDirectChatMessages(agentStates) {
4786
4786
  async function processDirectChatMessage(agent, msg) {
4787
4787
  const fw = agentFrameworkCache.get(agent.codeName) ?? "openclaw";
4788
4788
  log(`[direct-chat] Processing message for '${agent.codeName}' (fw=${fw}): id=${msg.id} len=${msg.content.length}`);
4789
+ if (isSessionHealthy(agent.codeName)) {
4790
+ const escapeXml = (value) => value.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll('"', "&quot;").replaceAll("'", "&apos;");
4791
+ const channelEnvelope = `<channel source="direct-chat" session_id="${escapeXml(msg.session_id)}" user="webapp">
4792
+ ${escapeXml(msg.content)}
4793
+ </channel>`;
4794
+ const delivered = await injectMessage(
4795
+ agent.codeName,
4796
+ "chat",
4797
+ channelEnvelope,
4798
+ { task_name: "direct-chat" },
4799
+ log
4800
+ );
4801
+ if (delivered) {
4802
+ log(`[direct-chat] Injected into persistent session for '${agent.codeName}' (msg=${msg.id}); agent will reply via direct_chat.reply tool`);
4803
+ return;
4804
+ }
4805
+ log(`[direct-chat] Inject reported unverified for '${agent.codeName}' (msg=${msg.id}) \u2014 falling back to one-shot direct-chat handling`);
4806
+ }
4789
4807
  try {
4790
4808
  let reply;
4791
4809
  if (fw === "claude-code") {