@integrity-labs/agt-cli 0.28.853 → 0.28.855

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.
Files changed (24) hide show
  1. package/dist/bin/agt.js +5 -5
  2. package/dist/{chunk-XCAI3GSF.js → chunk-7YVKIYVW.js} +2 -2
  3. package/dist/{chunk-WUXQVP7A.js → chunk-IHBWFKOW.js} +172 -3
  4. package/dist/chunk-IHBWFKOW.js.map +1 -0
  5. package/dist/{chunk-6BA2US4B.js → chunk-RKCG63PT.js} +4 -4
  6. package/dist/{claude-pair-runtime-CJXQTVSC.js → claude-pair-runtime-FFUPKRVC.js} +2 -2
  7. package/dist/lib/manager-worker.js +37 -21
  8. package/dist/lib/manager-worker.js.map +1 -1
  9. package/dist/mcp/direct-chat-channel.js +133 -0
  10. package/dist/mcp/index.js +133 -0
  11. package/dist/mcp/origami.js +133 -0
  12. package/dist/mcp/slack-channel.js +133 -0
  13. package/dist/mcp/telegram-channel.js +133 -0
  14. package/dist/{persistent-session-YGK7YHPR.js → persistent-session-CNVU25IF.js} +3 -3
  15. package/dist/{responsiveness-probe-NGWO3JK3.js → responsiveness-probe-TZOKOH6C.js} +3 -3
  16. package/dist/{session-auth-dead-4UZR5655.js → session-auth-dead-GRYXFDYD.js} +2 -2
  17. package/package.json +1 -1
  18. package/dist/chunk-WUXQVP7A.js.map +0 -1
  19. /package/dist/{chunk-XCAI3GSF.js.map → chunk-7YVKIYVW.js.map} +0 -0
  20. /package/dist/{chunk-6BA2US4B.js.map → chunk-RKCG63PT.js.map} +0 -0
  21. /package/dist/{claude-pair-runtime-CJXQTVSC.js.map → claude-pair-runtime-FFUPKRVC.js.map} +0 -0
  22. /package/dist/{persistent-session-YGK7YHPR.js.map → persistent-session-CNVU25IF.js.map} +0 -0
  23. /package/dist/{responsiveness-probe-NGWO3JK3.js.map → responsiveness-probe-TZOKOH6C.js.map} +0 -0
  24. /package/dist/{session-auth-dead-4UZR5655.js.map → session-auth-dead-GRYXFDYD.js.map} +0 -0
package/dist/bin/agt.js CHANGED
@@ -40,12 +40,12 @@ import {
40
40
  success,
41
41
  table,
42
42
  warn
43
- } from "../chunk-6BA2US4B.js";
43
+ } from "../chunk-RKCG63PT.js";
44
44
  import {
45
45
  getProjectDir,
46
46
  isSessionResumeDisabled,
47
47
  readDirectChatSessionState
48
- } from "../chunk-XCAI3GSF.js";
48
+ } from "../chunk-7YVKIYVW.js";
49
49
  import {
50
50
  AnchorSessionClient,
51
51
  CHANNEL_REGISTRY,
@@ -79,7 +79,7 @@ import {
79
79
  serializeManifestForSlackCli,
80
80
  sessionFileExists,
81
81
  sessionTranscriptDir
82
- } from "../chunk-WUXQVP7A.js";
82
+ } from "../chunk-IHBWFKOW.js";
83
83
  import "../chunk-XWVM4KPK.js";
84
84
 
85
85
  // src/bin/agt.ts
@@ -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.853" : "dev";
5470
+ var cliVersion = true ? "0.28.855" : "dev";
5471
5471
  async function fetchLatestVersion() {
5472
5472
  const host2 = getHost();
5473
5473
  if (!host2) return null;
@@ -6658,7 +6658,7 @@ function handleError(err) {
6658
6658
  }
6659
6659
 
6660
6660
  // src/bin/agt.ts
6661
- var cliVersion2 = true ? "0.28.853" : "dev";
6661
+ var cliVersion2 = true ? "0.28.855" : "dev";
6662
6662
  var program = new Command();
6663
6663
  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");
6664
6664
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -18,7 +18,7 @@ import {
18
18
  rotateDailySession,
19
19
  sessionFileExists,
20
20
  todayLocalIso
21
- } from "./chunk-WUXQVP7A.js";
21
+ } from "./chunk-IHBWFKOW.js";
22
22
  import {
23
23
  reapOrphanChannelMcps
24
24
  } from "./chunk-XWVM4KPK.js";
@@ -5431,4 +5431,4 @@ export {
5431
5431
  stopAllSessionsAndWait,
5432
5432
  getProjectDir
5433
5433
  };
5434
- //# sourceMappingURL=chunk-XCAI3GSF.js.map
5434
+ //# sourceMappingURL=chunk-7YVKIYVW.js.map
@@ -177,6 +177,137 @@ ${AGENT_RULES_SECTION_END}
177
177
  `;
178
178
  }
179
179
 
180
+ // ../../packages/core/dist/guardrails/calendar-policy.js
181
+ function parseCalendarGuardStage(raw) {
182
+ if (raw === "warn" || raw === "enforce")
183
+ return raw;
184
+ return "shadow";
185
+ }
186
+
187
+ // ../../packages/core/dist/guardrails/enforcer-registry.js
188
+ var GUARDRAIL_ENFORCERS = [
189
+ // ---- Enforced: this definition has its own enforcement point -------------
190
+ {
191
+ id: "email.domain_restrict",
192
+ mechanism: "enforced",
193
+ stage: "live",
194
+ enforcer: "packages/api/src/lib/email-domain-guard.ts",
195
+ effect: "enforceEmailDomainGuard runs at the top of both agent-egress paths; internal_only with zero verified domains takes an explicit AUDITED no-op branch rather than failing open silently."
196
+ },
197
+ {
198
+ // MEASURED, and it corrects a claim ADR-0080 makes about this definition.
199
+ //
200
+ // The ADR reports calendar as `enforced` + `stage: 'shadow'`, blocked by
201
+ // ENG-5868 (caller identity is not threaded to `callIntegrationTool`). Read
202
+ // literally that says an org cannot get redaction today, and that is not
203
+ // what the code does. `decideCalendarRedactionMode` (calendar-policy.ts) is
204
+ // FAIL-CLOSED: with the caller unresolvable it returns `redact`, not
205
+ // pass-through. `redactCalendarToolResponseIfNeeded` then calls
206
+ // `applyRedactionToResponse` for every response whenever `config.stage` is
207
+ // `enforce`. So an org that sets the stage gets real redaction — ENG-5868
208
+ // costs the control its PRECISION (it cannot spare the principal), not its
209
+ // ability to act.
210
+ //
211
+ // The stage is therefore per-ORG configuration, which ADR-0080 decision 1
212
+ // is explicit is the effectiveness axis the static union deliberately does
213
+ // not carry. `effectiveCalendarEnforcement` in the CLAUDE.md renderer owns
214
+ // it, and since ENG-10104 caps `enforce` to `warn` whenever the org's stage
215
+ // is not `enforce`.
216
+ id: "calendar.confidentiality",
217
+ mechanism: "enforced",
218
+ stage: "live",
219
+ enforcer: "packages/api/src/lib/calendar-confidentiality-guard.ts",
220
+ effect: "at config.stage=enforce, redacts summary/description/attendees/location out of calendar read responses; at shadow/warn it writes a would_redact audit row and returns the response unchanged."
221
+ },
222
+ // ---- Delegated: read by another definition's enforcement point -----------
223
+ //
224
+ // Both can block, because their owner's point is live — which is the question
225
+ // `guardrailCanBlock` asks and the right answer to it. It is NOT the whole
226
+ // story for these two, and the gap has its own ticket: the org's email guard
227
+ // STAGE is threaded into the prompt shape for `email.domain_restrict`'s id
228
+ // alone (`host-runtime.ts`, the ENG-7829 fix), so a row of either id stored at
229
+ // `enforce` on a shadow-stage org still renders under "must comply" with
230
+ // nothing capping it. That is the effectiveness axis, not the mechanism one —
231
+ // ENG-10110.
232
+ {
233
+ id: "email.require_approval",
234
+ mechanism: "delegated",
235
+ ownedBy: "email.domain_restrict",
236
+ enforcer: "packages/api/src/lib/email-domain-guard.ts",
237
+ effect: "routes a send to an approver instead of letting it leave."
238
+ },
239
+ {
240
+ id: "email.mail_rules",
241
+ mechanism: "delegated",
242
+ ownedBy: "email.domain_restrict",
243
+ enforcer: "packages/api/src/lib/email-domain-guard.ts",
244
+ effect: "gates mail-rule creation/modification on the same egress path."
245
+ },
246
+ // ---- Advisory: seeded, applied, rendered — and read by nothing -----------
247
+ //
248
+ // These are NOT dead config. They are presented to operators in the console
249
+ // and to agents in CLAUDE.md, three of them under a heading that promises the
250
+ // violation is blocked. Listed individually rather than as a wildcard so that
251
+ // fixing one is a one-line diff from `advisory` to `enforced`.
252
+ //
253
+ // The ticket is ENG-9800, not ENG-9874. ENG-9874 catalogued these and is
254
+ // closed; a closed ticket tracks nothing, which is the same shrug an absent
255
+ // one would be. ENG-9800 is the open sweep that owns making them real.
256
+ {
257
+ id: "require-approval-for-actions",
258
+ mechanism: "advisory",
259
+ reason: "unimplemented",
260
+ ticket: "ENG-9800",
261
+ note: `Rendered to agents as "violation blocks the action". Nothing reads it. The ENG-8562 incident is this guardrail's promise, unkept.`
262
+ },
263
+ {
264
+ id: "data.pii_access",
265
+ mechanism: "advisory",
266
+ reason: "unimplemented",
267
+ ticket: "ENG-9800",
268
+ note: "Rendered as Enforced with block_export semantics; no export path consults it."
269
+ },
270
+ {
271
+ id: "data.credential_access",
272
+ mechanism: "advisory",
273
+ reason: "unimplemented",
274
+ ticket: "ENG-9800",
275
+ note: "Rendered as Enforced with block_read/block_write; no credential path consults it."
276
+ },
277
+ { id: "comm.social_posting", mechanism: "advisory", reason: "unimplemented", ticket: "ENG-9800" },
278
+ { id: "compliance.audit_all", mechanism: "advisory", reason: "unimplemented", ticket: "ENG-9800" },
279
+ { id: "no-external-network", mechanism: "advisory", reason: "unimplemented", ticket: "ENG-9800" },
280
+ { id: "no-pii-in-output", mechanism: "advisory", reason: "unimplemented", ticket: "ENG-9800" },
281
+ { id: "restrict-file-access", mechanism: "advisory", reason: "unimplemented", ticket: "ENG-9800" },
282
+ { id: "schedule.operating_hours", mechanism: "advisory", reason: "unimplemented", ticket: "ENG-9800" },
283
+ { id: "spend.hourly_limit", mechanism: "advisory", reason: "unimplemented", ticket: "ENG-9800" },
284
+ { id: "tool.allow_list", mechanism: "advisory", reason: "unimplemented", ticket: "ENG-9800" },
285
+ { id: "tool.block_list", mechanism: "advisory", reason: "unimplemented", ticket: "ENG-9800" },
286
+ { id: "tool.financial_txn", mechanism: "advisory", reason: "unimplemented", ticket: "ENG-9800" },
287
+ { id: "working-hours-only", mechanism: "advisory", reason: "unimplemented", ticket: "ENG-9800" }
288
+ ];
289
+ var BY_ID = new Map(GUARDRAIL_ENFORCERS.map((e) => [e.id, e]));
290
+ function guardrailCanBlock(definitionId) {
291
+ return resolveCanBlock(definitionId, (id) => BY_ID.get(id));
292
+ }
293
+ function resolveCanBlock(definitionId, lookup) {
294
+ const seen = /* @__PURE__ */ new Set();
295
+ let id = definitionId;
296
+ for (; ; ) {
297
+ if (seen.has(id))
298
+ return false;
299
+ seen.add(id);
300
+ const entry = lookup(id);
301
+ if (!entry)
302
+ return false;
303
+ if (entry.mechanism === "enforced")
304
+ return entry.stage === "live";
305
+ if (entry.mechanism !== "delegated")
306
+ return false;
307
+ id = entry.ownedBy;
308
+ }
309
+ }
310
+
180
311
  // ../../packages/core/dist/provisioning/platform-storage.js
181
312
  var PLATFORM_STORAGE_RULE = "Store durable, reusable work you build (repeatable procedures, recurring responsibilities, scheduled automation, orchestration scripts) through the Ninjafy platform tools, never as loose local files, unless the user explicitly requests a different destination. Platform artifacts are versioned, reviewable, and survive re-provisioning; loose local files are wiped on the next provision rebuild, reach no one else, and bypass review. Ephemeral scratch files for the task at hand are fine on disk.";
182
313
 
@@ -1033,11 +1164,13 @@ function renderOverriddenGuardrailBullet(g) {
1033
1164
  function effectiveCalendarEnforcement(g) {
1034
1165
  if (g.definitionId !== CALENDAR_CONFIDENTIALITY_DEF)
1035
1166
  return g.enforcement;
1036
- const stage = typeof g.config?.["stage"] === "string" ? g.config["stage"] : "shadow";
1167
+ const stage = parseCalendarGuardStage(g.config?.["stage"]);
1037
1168
  if (stage === "enforce")
1038
1169
  return "enforce";
1039
1170
  if (stage === "warn" && g.enforcement !== "enforce")
1040
1171
  return "warn";
1172
+ if (g.enforcement === "enforce")
1173
+ return "warn";
1041
1174
  return g.enforcement;
1042
1175
  }
1043
1176
  function effectiveEmailEnforcement(g) {
@@ -1075,7 +1208,10 @@ function buildGuardrailsSection(guardrails) {
1075
1208
  return "";
1076
1209
  const isOverridden = (g) => !!(g.overrideApplied && g.overrideReason?.trim());
1077
1210
  const overridden = active.filter(isOverridden);
1078
- const normal = active.filter((g) => !isOverridden(g));
1211
+ const notOverridden = active.filter((g) => !isOverridden(g));
1212
+ const canBlock = (g) => guardrailCanBlock(g.definitionId);
1213
+ const advisory = notOverridden.filter((g) => !canBlock(g));
1214
+ const normal = notOverridden.filter(canBlock);
1079
1215
  const enforce = normal.filter((g) => g.enforcement === "enforce");
1080
1216
  const warn = normal.filter((g) => g.enforcement === "warn");
1081
1217
  const logOnly = normal.filter((g) => g.enforcement === "log");
@@ -1102,6 +1238,10 @@ function buildGuardrailsSection(guardrails) {
1102
1238
  blocks.push(``, `### Logged (observability only)`, ``);
1103
1239
  blocks.push(logOnly.map(renderGuardrailBullet).join("\n"));
1104
1240
  }
1241
+ if (advisory.length > 0) {
1242
+ blocks.push(``, `### Advisory (policy only \u2014 not enforced by the platform)`, ``, `Follow these as operator instructions. No platform control backs them, so`, `never say an action was blocked, held for approval, or audited on their`, `basis \u2014 say you are declining, and why.`, ``);
1243
+ blocks.push(advisory.map(renderGuardrailBullet).join("\n"));
1244
+ }
1105
1245
  if (overridden.length > 0) {
1106
1246
  blocks.push(``, `### Approved exceptions (an operator override applies - follow the adjusted policy)`, ``);
1107
1247
  blocks.push(overridden.map(renderOverriddenGuardrailBullet).join("\n"));
@@ -5438,6 +5578,35 @@ var FLAG_REGISTRY = [
5438
5578
  defaultValue: false,
5439
5579
  envVar: "AGT_MODEL_API_ERROR_REPORTING_ENABLED"
5440
5580
  },
5581
+ {
5582
+ key: "model-policy-failover-trigger",
5583
+ description: "Automatic model-policy failover (ENG-10156, ADR-0074). off = the trigger does not run. shadow = it evaluates every ingested model-API error against the policy's failover_trigger config and LOGS the decision with its inputs, acting on nothing. Enum gate; ships OFF.",
5584
+ flagType: "enum",
5585
+ // `armed` is DELIBERATELY not an allowed value yet.
5586
+ //
5587
+ // Nothing writes model_policy_failover_state with source='auto' — that is
5588
+ // the actuation half, and it is gated behind a recorded shadow soak
5589
+ // (ENG-10156 AC8). Offering `armed` now would be a setting an operator can
5590
+ // select, that reports success, and that does nothing: the failure mode is
5591
+ // worse than the missing feature, because it looks like a fleet running
5592
+ // with automatic failover enabled. Add it in the same change that makes it
5593
+ // act, not before.
5594
+ allowedValues: ["off", "shadow"],
5595
+ // OFF, not `shadow`, and the contrast with `channel-quarantine-mode` is the
5596
+ // reason: that flag defaults to `shadow` because shadow WAS the live
5597
+ // manager's compiled behaviour, so anything else would have changed the
5598
+ // fleet. Here there is no incumbent behaviour to preserve — nothing has ever
5599
+ // evaluated this — so `off` is the honest default and turning shadow on is a
5600
+ // deliberate act with a soak attached to it.
5601
+ defaultValue: "off",
5602
+ envVar: "AGT_MODEL_POLICY_FAILOVER_TRIGGER_MODE",
5603
+ // Marked sensitive ahead of `armed` existing: the value this flag will
5604
+ // eventually carry moves a host onto a secondary binding whose credential
5605
+ // may be ours (credential_owner: 'platform'), i.e. it spends money with no
5606
+ // human in the loop. Declaring that now costs nothing and means the audited
5607
+ // -flip behaviour is already in place on the day the value is added.
5608
+ sensitive: true
5609
+ },
5441
5610
  {
5442
5611
  key: "claude-md-skills-index",
5443
5612
  description: `Manager injects the "## Available Skills" bullet list (one line per installed skill, name + frontmatter description) into the agent's project CLAUDE.md. Claude Code already surfaces installed skills to the model natively from .claude/skills/*/SKILL.md, so on current models the list is duplicated context - and an expensive one: it measured 12,045 chars across 29 skills on a prod agent, pushing project/CLAUDE.md to 51k against Claude Code's 40,000-char ceiling, past which the tail of the agent's own system prompt is silently truncated. OFF suppresses ONLY the skill bullets; the "Updating Integrations" guidance in the same managed block is real instruction and is always kept. Defaults ON (today's behaviour) - flip OFF per org to reclaim the headroom.`,
@@ -13972,4 +14141,4 @@ export {
13972
14141
  peekCurrentSession,
13973
14142
  readDailySessionPin
13974
14143
  };
13975
- //# sourceMappingURL=chunk-WUXQVP7A.js.map
14144
+ //# sourceMappingURL=chunk-IHBWFKOW.js.map