@integrity-labs/agt-cli 0.28.731 → 0.28.732

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/bin/agt.js CHANGED
@@ -41,7 +41,7 @@ import {
41
41
  success,
42
42
  table,
43
43
  warn
44
- } from "../chunk-YNIRFRQE.js";
44
+ } from "../chunk-DGIYNBDG.js";
45
45
  import {
46
46
  getProjectDir,
47
47
  isSessionResumeDisabled,
@@ -5467,7 +5467,7 @@ import { execFileSync, execSync } from "child_process";
5467
5467
  import { existsSync as existsSync11, realpathSync as realpathSync2 } from "fs";
5468
5468
  import chalk18 from "chalk";
5469
5469
  import ora16 from "ora";
5470
- var cliVersion = true ? "0.28.731" : "dev";
5470
+ var cliVersion = true ? "0.28.732" : "dev";
5471
5471
  async function fetchLatestVersion() {
5472
5472
  const host2 = getHost();
5473
5473
  if (!host2) return null;
@@ -6654,7 +6654,7 @@ function handleError(err) {
6654
6654
  }
6655
6655
 
6656
6656
  // src/bin/agt.ts
6657
- var cliVersion2 = true ? "0.28.731" : "dev";
6657
+ var cliVersion2 = true ? "0.28.732" : "dev";
6658
6658
  var program = new Command();
6659
6659
  program.name("agt").description("Augmented CLI \u2014 agent provisioning and management").version(cliVersion2).option("--json", "Emit machine-readable JSON output (suppress spinners and colors)").option("--skip-update-check", "Skip the automatic update check on startup");
6660
6660
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -6427,7 +6427,7 @@ function exchangeFailureKind(err) {
6427
6427
  }
6428
6428
 
6429
6429
  // src/lib/api-client.ts
6430
- var agtCliVersion = true ? "0.28.731" : "dev";
6430
+ var agtCliVersion = true ? "0.28.732" : "dev";
6431
6431
  var lastConfigHash = null;
6432
6432
  function setConfigHash(hash) {
6433
6433
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -10473,4 +10473,4 @@ export {
10473
10473
  managerInstallSystemUnitCommand,
10474
10474
  managerUninstallSystemUnitCommand
10475
10475
  };
10476
- //# sourceMappingURL=chunk-YNIRFRQE.js.map
10476
+ //# sourceMappingURL=chunk-DGIYNBDG.js.map
@@ -57,7 +57,7 @@ import {
57
57
  safeWriteJsonAtomic,
58
58
  setConfigHash,
59
59
  tripClass
60
- } from "../chunk-YNIRFRQE.js";
60
+ } from "../chunk-DGIYNBDG.js";
61
61
  import {
62
62
  getProjectDir as getProjectDir2,
63
63
  getReadyTasks,
@@ -12995,7 +12995,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
12995
12995
  var lastVersionCheckAt = 0;
12996
12996
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
12997
12997
  var lastResponsivenessProbeAt = 0;
12998
- var agtCliVersion = true ? "0.28.731" : "dev";
12998
+ var agtCliVersion = true ? "0.28.732" : "dev";
12999
12999
  function resolveBrewPath(execFileSync3) {
13000
13000
  try {
13001
13001
  const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -38165,6 +38165,20 @@ async function readCursorAdvanceBody(res) {
38165
38165
  };
38166
38166
  }
38167
38167
 
38168
+ // src/direct-chat-mcp-instructions.ts
38169
+ function buildDirectChatMcpInstructions() {
38170
+ return [
38171
+ "CRITICAL: every response to a direct-chat <channel> tag MUST go through direct_chat.reply (passing the session_id verbatim). Text in your session WITHOUT a direct_chat.reply call never reaches the operator \u2014 the reply dies inside the agent process.",
38172
+ 'Messages from the webapp Direct Chat arrive as <channel source="direct-chat" session_id="..." user="...">.',
38173
+ "When the tag carries user_name (and sometimes user_email / user_role), that is the verified human you are talking with; address them by name and tailor your reply to who they are. If those attributes are absent, the sender is unknown, so just reply helpfully without personalization.",
38174
+ "Reply using the direct_chat.reply tool, passing the session_id from the tag.",
38175
+ "Always reply to every direct chat message that expects a reply (its meta has requires_reply=true, or no requires_reply field) \u2014 the user is waiting in the webapp.",
38176
+ "NEVER call direct_chat.reply for a NOTICE \u2014 a notification whose meta has requires_reply=false (ENG-6381). It is an informational FYI (e.g. an integration-status update), not a question, and it has ALREADY been acknowledged for you. Replying would wrongly post into the operator\u2019s chat history and burn a turn. Just take it into account and carry on.",
38177
+ "In the rare case you deliberately handle a reply-expecting message without replying (e.g. an internal command), call direct_chat.consume with the session_id so it is not treated as undelivered and redelivered.",
38178
+ "Keep replies concise and helpful. You have full access to all your MCP tools."
38179
+ ].join(" ");
38180
+ }
38181
+
38168
38182
  // src/usage-limit-reactive-decision.ts
38169
38183
  import { createHash } from "crypto";
38170
38184
  function shouldArmWatch(opts) {
@@ -38531,23 +38545,12 @@ var mcp = new Server(
38531
38545
  experimental: { "claude/channel": {} },
38532
38546
  tools: {}
38533
38547
  },
38534
- instructions: [
38535
- // ENG-5845: highest-priority guard first. Without this framing,
38536
- // Opus 4.8 reads the softer "Reply using…" line as a suggestion and
38537
- // emits plain text — the reply lives in the local Claude session
38538
- // but never reaches the operator's session_id through the channel
38539
- // API. Mirrors the slack-channel CRITICAL line shipped in
38540
- // ENG-5830. Total instructions string is ~850 / 2048 chars so we
38541
- // have room to be explicit.
38542
- "CRITICAL: every response to a direct-chat <channel> tag MUST go through direct_chat.reply (passing the session_id verbatim). Text in your session WITHOUT a direct_chat.reply call never reaches the operator \u2014 the reply dies inside the agent process.",
38543
- 'Messages from the webapp Direct Chat arrive as <channel source="direct-chat" session_id="..." user="...">.',
38544
- "When the tag carries user_name (and sometimes user_email / user_role), that is the verified human you are talking with; address them by name and tailor your reply to who they are. If those attributes are absent, the sender is unknown, so just reply helpfully without personalization.",
38545
- "Reply using the direct_chat.reply tool, passing the session_id from the tag.",
38546
- "Always reply to every direct chat message that expects a reply (its meta has requires_reply=true, or no requires_reply field) \u2014 the user is waiting in the webapp.",
38547
- "NEVER call direct_chat.reply for a NOTICE \u2014 a notification whose meta has requires_reply=false (ENG-6381). It is an informational FYI (e.g. an integration-status update), not a question, and it has ALREADY been acknowledged for you. Replying would wrongly post into the operator\u2019s chat history and burn a turn. Just take it into account and carry on.",
38548
- "In the rare case you deliberately handle a reply-expecting message without replying (e.g. an internal command), call direct_chat.consume with the session_id so it is not treated as undelivered and redelivered.",
38549
- "Keep replies concise and helpful. You have full access to all your MCP tools."
38550
- ].join(" ")
38548
+ // NOTE: Claude Code truncates MCP server instructions at 2048 chars.
38549
+ // ENG-9649: built by a pure, length-tested builder
38550
+ // (direct-chat-mcp-instructions.ts). The budget used to be tracked in a
38551
+ // comment here, which had drifted 668 chars out of date without anything
38552
+ // noticing.
38553
+ instructions: buildDirectChatMcpInstructions()
38551
38554
  }
38552
38555
  );
38553
38556
  var claimTracker = new DirectChatClaimTracker();
@@ -40533,6 +40533,24 @@ async function actuateHostRestart(opts) {
40533
40533
  }
40534
40534
  }
40535
40535
 
40536
+ // src/telegram-mcp-instructions.ts
40537
+ var MAX_SKIP_REACTION_UNITS = 8;
40538
+ var REACT_POLICY = `Reacting is egress and does NOT settle anything \u2014 telegram.consume is what settles. Never react in a chat you are barred from, and never post a "this wasn't for me" message.`;
40539
+ function buildTelegramMcpInstructions(opts) {
40540
+ const emoji2 = opts.skipReaction ?? "";
40541
+ const skipReactionOn = opts.skipReactionOn && emoji2.length > 0 && emoji2.length <= MAX_SKIP_REACTION_UNITS;
40542
+ return [
40543
+ "CRITICAL: every response to a Telegram <channel> tag MUST go through telegram.reply with the chat_id from the tag \u2014 typed text never reaches the user. Slow work: interim ack (telegram.reply interim:true), then your FINAL answer as a separate telegram.reply (interim omitted). An ack is not the answer.",
40544
+ 'Messages from Telegram arrive as <channel source="telegram" chat_id="..." user="..." user_name="..." message_id="...">. Pass reply_to_message_id from the tag so the response lands as a quote-reply in busy chats.',
40545
+ "Deliberately NOT replying (a standing rule bars you from that chat, or the message only changed state)? Call telegram.consume with the chat_id and a short reason: it settles the message without posting anything. Without a reply or a consume it counts as undelivered and re-delivers to you forever.",
40546
+ "Inbound attachments: `files` on the tag is a JSON string \u2014 JSON.parse it. An entry with `path` (or top-level `image_path`) is already downloaded \u2014 Read it. Entries with `file_id` and no `path` need telegram.download_attachment (file_id + chat_id), then Read the returned path.",
40547
+ 'For work >30s follow the CLAUDE.md kanban flow: kanban_add \u2192 reply "On it \u2014 tracking here: <kanban URL>" \u2192 in_progress \u2192 reply the result. Simple lookups skip kanban but still reply.',
40548
+ "Address users by user_name; user is the numeric Telegram ID. Resolve ambiguous times against your own Timezone from CLAUDE.md \u2014 do not ask.",
40549
+ "Reactions (telegram.react sparingly \u2014 prefer a reply): \u{1F440} = ack (auto-added, do not duplicate); \u{1F44D} or \u{1F389} = success." + (skipReactionOn ? ` ${emoji2} = seen, not replying.` : "") + " NEVER react to signal failure of YOUR work \u2014 telegram.reply one sentence explaining it. Free-tier emoji only: \u{1F44D} \u{1F44E} \u2764 \u{1F525} \u{1F389} \u{1F64F} \u{1F44C} \u{1F440} \u{1F4AF} \u{1FAE1}.",
40550
+ skipReactionOn ? `${REACT_POLICY} Where engaging IS permitted you may also telegram.react "${emoji2}" after consuming.` : REACT_POLICY
40551
+ ].filter(Boolean).join(" ");
40552
+ }
40553
+
40536
40554
  // src/telegram-channel.ts
40537
40555
  function redactId(id) {
40538
40556
  return createHash3("sha256").update(String(id)).digest("hex").slice(0, 8);
@@ -42953,19 +42971,14 @@ var mcp = new Server(
42953
42971
  tools: {}
42954
42972
  },
42955
42973
  // NOTE: Claude Code truncates MCP server instructions at 2048 chars.
42956
- // Attachments rules live near the top because they get chopped otherwise
42957
- // and the agent silently loses attachment-handling guidance.
42958
- instructions: [
42959
- // Highest-priority lines first — Claude Code truncates this string at
42960
- // 2048 chars, so anything appended late silently disappears.
42961
- "CRITICAL: every response to a Telegram <channel> tag MUST go through telegram.reply with the chat_id from the tag \u2014 typed text never reaches the user. Slow work: interim ack (telegram.reply interim:true), then your FINAL answer as a separate telegram.reply (interim omitted). An ack is not the answer.",
42962
- 'Messages from Telegram arrive as <channel source="telegram" chat_id="..." user="..." user_name="..." message_id="...">. Pass reply_to_message_id from the tag so the response lands as a quote-reply in busy chats.',
42963
- "Inbound attachments: <channel> `files` is a JSON-serialised array \u2014 JSON.parse it. If an entry has `path`, the image is already downloaded \u2014 Read it directly, do NOT call telegram.download_attachment. Use that tool only for entries with `file_id` but NO `path` (PDF, docx, voice, audio, video, animations): pass file_id + chat_id verbatim, then Read the returned path. Single-image messages also get a top-level `image_path`. Caption arrives as channel content. Don't surface internal file-handling errors that don't affect the answer.",
42964
- 'For work >30s follow CLAUDE.md kanban flow: kanban_add \u2192 reply "On it \u2014 tracking here: <kanban URL>" \u2192 move to in_progress \u2192 do the work \u2192 reply with the result. Simple lookups skip kanban but still reply.',
42965
- "Address users by user_name; user is the numeric Telegram ID. Resolve ambiguous times against your own Timezone from CLAUDE.md \u2014 do not ask.",
42966
- "Reaction taxonomy (use telegram.react sparingly \u2014 prefer telegram.reply): \u{1F440} = ack (already auto-added on inbound, do not duplicate); \u{1F44D} or \u{1F389} = success." + (SKIP_REACTION_ON ? ` ${TELEGRAM_SKIP_REACTION} = seen but not replying (see below).` : "") + ` NEVER react to signal failure of YOUR work. On failure, telegram.reply with one sentence explaining what went wrong. Free-tier emoji: \u{1F44D} \u{1F44E} \u2764 \u{1F525} \u{1F389} \u{1F914} \u{1F92F} \u{1F64F} \u{1F44C} \u{1F440} \u{1F4AF} \u270D \u{1FAE1} \u{1F192} \u{1F973} \u{1F494}. (If a message arrived while you were offline you may see a system-posted "can't respond right now" notice \u2014 that's the runtime, not you; don't repeat or apologise for it.)`,
42967
- SKIP_REACTION_ON ? `When you read a message you decide NOT to reply to (nothing useful to add): call telegram.react with emoji "${TELEGRAM_SKIP_REACTION}" so the sender knows you saw it \u2014 never post a "this wasn't for me" message.` : ""
42968
- ].filter(Boolean).join(" ")
42974
+ // ENG-9649: built by a pure, length-tested builder
42975
+ // (telegram-mcp-instructions.ts) so a line can no longer fall off the end
42976
+ // unnoticed — which is exactly what happened to the do-not-reply guidance
42977
+ // while the reaction taxonomy went on pointing at it.
42978
+ instructions: buildTelegramMcpInstructions({
42979
+ skipReactionOn: SKIP_REACTION_ON,
42980
+ skipReaction: TELEGRAM_SKIP_REACTION
42981
+ })
42969
42982
  }
42970
42983
  );
42971
42984
  mcp.setRequestHandler(ListToolsRequestSchema, async () => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.731",
3
+ "version": "0.28.732",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {