@integrity-labs/agt-cli 0.28.683 → 0.28.685

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
@@ -40,7 +40,7 @@ import {
40
40
  success,
41
41
  table,
42
42
  warn
43
- } from "../chunk-WKYIIHJT.js";
43
+ } from "../chunk-Y5GJEUZF.js";
44
44
  import {
45
45
  readDirectChatSessionState
46
46
  } from "../chunk-ZKNKHAHX.js";
@@ -4909,7 +4909,7 @@ import { execFileSync, execSync } from "child_process";
4909
4909
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
4910
4910
  import chalk18 from "chalk";
4911
4911
  import ora16 from "ora";
4912
- var cliVersion = true ? "0.28.683" : "dev";
4912
+ var cliVersion = true ? "0.28.685" : "dev";
4913
4913
  async function fetchLatestVersion() {
4914
4914
  const host2 = getHost();
4915
4915
  if (!host2) return null;
@@ -6089,7 +6089,7 @@ function handleError(err) {
6089
6089
  }
6090
6090
 
6091
6091
  // src/bin/agt.ts
6092
- var cliVersion2 = true ? "0.28.683" : "dev";
6092
+ var cliVersion2 = true ? "0.28.685" : "dev";
6093
6093
  var program = new Command();
6094
6094
  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");
6095
6095
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -6489,7 +6489,7 @@ function exchangeFailureKind(err) {
6489
6489
  }
6490
6490
 
6491
6491
  // src/lib/api-client.ts
6492
- var agtCliVersion = true ? "0.28.683" : "dev";
6492
+ var agtCliVersion = true ? "0.28.685" : "dev";
6493
6493
  var lastConfigHash = null;
6494
6494
  function setConfigHash(hash) {
6495
6495
  lastConfigHash = hash && hash.length > 0 ? hash : null;
@@ -10231,4 +10231,4 @@ export {
10231
10231
  managerInstallSystemUnitCommand,
10232
10232
  managerUninstallSystemUnitCommand
10233
10233
  };
10234
- //# sourceMappingURL=chunk-WKYIIHJT.js.map
10234
+ //# sourceMappingURL=chunk-Y5GJEUZF.js.map
@@ -55,7 +55,7 @@ import {
55
55
  setConfigHash,
56
56
  setSecretFileTmpfsBacking,
57
57
  tripClass
58
- } from "../chunk-WKYIIHJT.js";
58
+ } from "../chunk-Y5GJEUZF.js";
59
59
  import {
60
60
  getProjectDir as getProjectDir2,
61
61
  getReadyTasks,
@@ -12403,7 +12403,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
12403
12403
  var lastVersionCheckAt = 0;
12404
12404
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
12405
12405
  var lastResponsivenessProbeAt = 0;
12406
- var agtCliVersion = true ? "0.28.683" : "dev";
12406
+ var agtCliVersion = true ? "0.28.685" : "dev";
12407
12407
  function resolveBrewPath(execFileSync3) {
12408
12408
  try {
12409
12409
  const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
package/dist/mcp/index.js CHANGED
@@ -45778,6 +45778,56 @@ server.tool(
45778
45778
  return { content: [{ type: "text", text: data.message ?? `Offer ${data.offer_id} filed.` }] };
45779
45779
  }
45780
45780
  );
45781
+ server.tool(
45782
+ "routine_revise",
45783
+ "Propose a CORRECTION to a routine you already own, for your manager to accept or decline. Use this when a routine you run is wrong: bad instructions, a gate that never fires, a step that no longer applies, or a defect you spotted before it ever ran. This is the only way to change what a routine DOES - schedule_update deliberately refuses prompt edits, and it will point you here. It does NOT change when the routine runs: to retime it, send only schedule fields to schedule_update instead. Nothing changes until your manager accepts: they get an accept/decline card, and the live routine keeps running as-is until they tap. On acceptance the SAME routine is updated in place - no duplicate is created. Pass the full replacement description, not a diff or a patch: it replaces the routine's substance wholesale, so anything you leave out is gone.",
45784
+ {
45785
+ routine_id: external_exports.string().trim().min(1).describe("The id of the routine to revise. It must be a routine YOU own; anything else reads as not-found."),
45786
+ description: external_exports.string().trim().min(1).describe(
45787
+ "The FULL replacement description - what the routine should do, from scratch. This becomes the routine's instructions verbatim, so write it as a complete brief rather than as a change to the old one. Anything you omit is removed."
45788
+ ),
45789
+ summary: external_exports.string().trim().min(1).describe(
45790
+ "What changed and WHY, in one or two sentences. This is what your manager reads on the accept/decline card before deciding, so it is the difference between a considered tap and a reluctant one. Required."
45791
+ ),
45792
+ name: external_exports.string().trim().min(1).optional().describe("Optional new name for the routine. Omit to keep the current one.")
45793
+ },
45794
+ async (params) => {
45795
+ try {
45796
+ const data = await apiPost("/host/routines/revise", {
45797
+ agent_id: AGT_AGENT_ID,
45798
+ routine_id: params.routine_id,
45799
+ description: params.description,
45800
+ summary: params.summary,
45801
+ ...params.name !== void 0 ? { name: params.name } : {}
45802
+ });
45803
+ if (!data.ok) {
45804
+ return {
45805
+ content: [{ type: "text", text: data.error ?? data.message ?? "Could not propose the revision." }]
45806
+ };
45807
+ }
45808
+ return {
45809
+ content: [
45810
+ {
45811
+ type: "text",
45812
+ text: data.message ?? "Revision proposed. The live routine is unchanged until your manager accepts it."
45813
+ }
45814
+ ]
45815
+ };
45816
+ } catch (err) {
45817
+ const msg = err instanceof Error ? err.message : String(err);
45818
+ const notFound = /returned 404/.test(msg);
45819
+ return {
45820
+ content: [
45821
+ {
45822
+ type: "text",
45823
+ text: notFound ? `Could not revise: no routine "${params.routine_id}" that you own. Check the id - you can only revise routines that are yours.` : `Could not propose the revision: ${msg}`
45824
+ }
45825
+ ],
45826
+ isError: true
45827
+ };
45828
+ }
45829
+ }
45830
+ );
45781
45831
  server.tool(
45782
45832
  "submit_routine_output",
45783
45833
  "Submit a gated routine's drafted output for human approval. Use ONLY when your routine prompt says the routine is in its approval phase - the platform delivers the draft after sign-off; do not deliver it yourself.",
@@ -46520,6 +46570,8 @@ var LOCAL_TOOL_NAMES = /* @__PURE__ */ new Set([
46520
46570
  "schedule_update",
46521
46571
  "submit_routine_output",
46522
46572
  "routine_propose",
46573
+ // ENG-9392: the correction half of routine_propose.
46574
+ "routine_revise",
46523
46575
  "knowledge_list",
46524
46576
  "knowledge_add",
46525
46577
  "knowledge_update",
@@ -42223,6 +42223,7 @@ function getEffectivePingAllowedUsers() {
42223
42223
  return readLivePingAllowedUsers() ?? PING_ALLOWED_USERS;
42224
42224
  }
42225
42225
  var SLACK_PENDING_INBOUND_DIR = SLACK_AGENT_DIR ? join20(SLACK_AGENT_DIR, "slack-pending-inbound") : null;
42226
+ var SLACK_PENDING_INBOUND_STALE_DIR = SLACK_AGENT_DIR ? join20(SLACK_AGENT_DIR, "slack-pending-inbound-stale") : null;
42226
42227
  var SLACK_RESTART_CONTEXT_DIR = SLACK_AGENT_DIR ? join20(SLACK_AGENT_DIR, "slack-restart-context") : null;
42227
42228
  var SLACK_RECOVERY_OUTBOX_DIR = SLACK_AGENT_DIR ? join20(SLACK_AGENT_DIR, "slack-recovery-outbox") : null;
42228
42229
  var SLACK_RECOVERY_LEDGER_DIR = SLACK_AGENT_DIR ? join20(SLACK_AGENT_DIR, ".agt-slack-recovery-ledger") : null;
@@ -42943,6 +42944,29 @@ var DISCRETIONARY_MARKER_MS = 10 * 60 * 1e3;
42943
42944
  function trackPendingMessage(channel, threadTs, messageTs, undeliverable = false, discretionary = false, payload) {
42944
42945
  writeSlackPendingInboundMarker(channel, threadTs, messageTs, undeliverable, discretionary, payload);
42945
42946
  }
42947
+ function deadLetterSlackMarker(fullPath, filename) {
42948
+ if (!SLACK_PENDING_INBOUND_STALE_DIR) return false;
42949
+ try {
42950
+ mkdirSync9(SLACK_PENDING_INBOUND_STALE_DIR, { recursive: true, mode: 448 });
42951
+ } catch {
42952
+ return false;
42953
+ }
42954
+ const target = join20(SLACK_PENDING_INBOUND_STALE_DIR, filename);
42955
+ try {
42956
+ if (!existsSync10(target)) {
42957
+ renameSync5(fullPath, target);
42958
+ return true;
42959
+ }
42960
+ } catch {
42961
+ return false;
42962
+ }
42963
+ try {
42964
+ renameSync5(fullPath, `${target}.${Date.now()}`);
42965
+ return true;
42966
+ } catch {
42967
+ return false;
42968
+ }
42969
+ }
42946
42970
  function sweepSlackStaleMarkers(thresholdMs) {
42947
42971
  if (!SLACK_PENDING_INBOUND_DIR) return;
42948
42972
  if (!existsSync10(SLACK_PENDING_INBOUND_DIR)) return;
@@ -43009,9 +43033,11 @@ function sweepSlackStaleMarkers(thresholdMs) {
43009
43033
  lostMarkers.push(
43010
43034
  `${redactSlackId(channel ?? "none")}/${redactSlackId(message_ts ?? "none")}@${received_at ?? "no-received_at"}${marker.discretionary ? " discretionary" : ""}${marker.payload ? "" : " no-payload"}${structurallyBroken ? " structural" : ""}`
43011
43035
  );
43012
- try {
43013
- unlinkSync7(fullPath);
43014
- } catch {
43036
+ if (!deadLetterSlackMarker(fullPath, filename)) {
43037
+ try {
43038
+ unlinkSync7(fullPath);
43039
+ } catch {
43040
+ }
43015
43041
  }
43016
43042
  cleared++;
43017
43043
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/agt-cli",
3
- "version": "0.28.683",
3
+ "version": "0.28.685",
4
4
  "description": "Augmented Team CLI — agent provisioning and management",
5
5
  "type": "module",
6
6
  "engines": {