@integrity-labs/agt-cli 0.28.1079 → 0.28.1080

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,12 +40,12 @@ import {
40
40
  success,
41
41
  table,
42
42
  warn
43
- } from "../chunk-TTSW5ZM2.js";
43
+ } from "../chunk-W4NEUOMU.js";
44
44
  import {
45
45
  getProjectDir,
46
46
  isSessionResumeDisabled,
47
47
  readDirectChatSessionState
48
- } from "../chunk-OGMCA67P.js";
48
+ } from "../chunk-SREQF7XT.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-5SASCNYV.js";
82
+ } from "../chunk-7F2UFKYG.js";
83
83
  import "../chunk-OCMJ5E6J.js";
84
84
  import "../chunk-XWVM4KPK.js";
85
85
  import "../chunk-EL5MWGGH.js";
@@ -5474,7 +5474,7 @@ import { execFileSync, execSync } from "child_process";
5474
5474
  import { existsSync as existsSync11, realpathSync as realpathSync2 } from "fs";
5475
5475
  import chalk18 from "chalk";
5476
5476
  import ora16 from "ora";
5477
- var cliVersion = true ? "0.28.1079" : "dev";
5477
+ var cliVersion = true ? "0.28.1080" : "dev";
5478
5478
  async function fetchLatestVersion() {
5479
5479
  const host2 = getHost();
5480
5480
  if (!host2) return null;
@@ -6734,7 +6734,7 @@ function handleError(err) {
6734
6734
  }
6735
6735
 
6736
6736
  // src/bin/agt.ts
6737
- var cliVersion2 = true ? "0.28.1079" : "dev";
6737
+ var cliVersion2 = true ? "0.28.1080" : "dev";
6738
6738
  var program = new Command();
6739
6739
  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");
6740
6740
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -1247,6 +1247,26 @@ function liveEmailHoldActions(guardrails) {
1247
1247
  const covered = Array.isArray(raw) ? raw.filter((a) => typeof a === "string" && a.trim() !== "") : [];
1248
1248
  return covered.length > 0 ? covered : null;
1249
1249
  }
1250
+ function liveDomainHold(guardrails) {
1251
+ const g = guardrails.find((x) => x.definitionId === EMAIL_DOMAIN_RESTRICT_DEF);
1252
+ const config = g?.config ?? {};
1253
+ if (!g || g.enforcement !== "enforce" || config.stage !== "require_approval" || config.approval_live !== true)
1254
+ return null;
1255
+ const raw = config.approval_covered_actions;
1256
+ const covered = Array.isArray(raw) ? raw.filter((a) => typeof a === "string" && a.trim() !== "") : [];
1257
+ return covered.length > 0 ? { covered } : null;
1258
+ }
1259
+ function requireApprovalDomainHoldException(covered) {
1260
+ const tools = ` sent with ${covered.map((a) => `\`${a}\``).join(", ")}`;
1261
+ return [
1262
+ ` Except \`${REQUIRE_APPROVAL_EMAIL_ACTION}\`${tools} to a domain the Email Domain Restriction does not allow:`,
1263
+ ` that restriction holds those sends for a human, so do not call \`request_approval\` and do`,
1264
+ ` not decline on this guardrail's basis. Attempt the send and let that hold decide; asking`,
1265
+ ` first would make your manager approve the same email twice. An email to an allowed domain,`,
1266
+ ` or sent any other way, is not held: ask first with \`request_approval\`, and when you do, pass`,
1267
+ ` \`detail.email\` = { to, from, subject } so your manager sees who it goes to.`
1268
+ ];
1269
+ }
1250
1270
  function requireApprovalEmailException(covered) {
1251
1271
  return [
1252
1272
  ` Except \`${REQUIRE_APPROVAL_EMAIL_ACTION}\` with ${covered.map((a) => `\`${a}\``).join(", ")}: your organization's`,
@@ -1264,16 +1284,19 @@ function requireApprovalActions(config) {
1264
1284
  const actions = raw.filter((a) => typeof a === "string" && a.trim() !== "").map((a) => a.trim());
1265
1285
  return actions.length > 0 ? actions : null;
1266
1286
  }
1267
- function requireApprovalHowLines(g, level, emailHold) {
1287
+ function requireApprovalHowLines(g, level, holds) {
1288
+ const emailHold = holds.requireApproval;
1289
+ const domainHold = emailHold === null ? holds.domain : null;
1268
1290
  const actions = requireApprovalActions(g.config);
1269
1291
  const namesEmail = actions === null || actions.includes(REQUIRE_APPROVAL_EMAIL_ACTION);
1270
1292
  const namesOther = actions === null || actions.some((a) => a !== REQUIRE_APPROVAL_EMAIL_ACTION);
1271
- const asksAboutEmail = namesEmail && emailHold === null;
1272
- const ask = namesOther || asksAboutEmail;
1293
+ const asksAboutEmail = namesEmail && emailHold === null && domainHold === null;
1294
+ const ask = namesOther || asksAboutEmail || namesEmail && domainHold !== null;
1273
1295
  return [
1274
1296
  ...ask ? REQUIRE_APPROVAL_HOW[level] : [],
1275
1297
  ...asksAboutEmail ? REQUIRE_APPROVAL_EMAIL_DETAIL : [],
1276
- ...namesEmail && emailHold !== null ? requireApprovalEmailException(emailHold) : []
1298
+ ...namesEmail && emailHold !== null ? requireApprovalEmailException(emailHold) : [],
1299
+ ...namesEmail && domainHold !== null ? requireApprovalDomainHoldException(domainHold.covered) : []
1277
1300
  ];
1278
1301
  }
1279
1302
  function renderAdvisoryGuardrailBullet(g, emailHold) {
@@ -1385,7 +1408,7 @@ function buildGuardrailsSection(guardrails) {
1385
1408
  }
1386
1409
  if (advisory.length > 0) {
1387
1410
  blocks.push(``, `### Advisory (policy only \u2014 not enforced by the platform)`, ``, `Follow these as operator instructions, at the level each one states (it`, `replaces the refuse-by-default rule above). No platform control backs them, so`, `never say an action was blocked, held for approval, or audited on their`, `basis \u2014 if you decline, say so and why.`, ``);
1388
- const emailHold = liveEmailHoldActions(active);
1411
+ const emailHold = { requireApproval: liveEmailHoldActions(active), domain: liveDomainHold(guardrails) };
1389
1412
  blocks.push(advisory.map((g) => renderAdvisoryGuardrailBullet(g, emailHold)).join("\n"));
1390
1413
  }
1391
1414
  if (overridden.length > 0) {
@@ -5715,6 +5738,36 @@ var FLAG_REGISTRY = [
5715
5738
  // wearing a precise number, which is the failure this field invites.
5716
5739
  since: "0.28.618"
5717
5740
  },
5741
+ {
5742
+ key: "block-self-serve-org-creation",
5743
+ description: "Invite-only onboarding (ENG-11305): refuse self-serve organization creation. On: the signup trigger and /auth/ensure-person create no organization for a new account, POST /organizations returns 403, and the user is told organizations are by invitation. Still allowed: accepting an invitation, and staff organization creation - NOTHING else. A company-domain signup is no longer auto-joined to any existing organization: no signal available here proves domain ownership (a slug is not a domain, and organization_email_domains.verified_at is self-asserted by any org admin), so an invitation is the only door. Existing organizations are untouched. STAGE-WIDE ONLY: it is read inside Postgres (`self_serve_org_creation_blocked`), which sees only the stage value, never an org override - there is no org yet. Turn it OFF here to reopen self-serve signup.",
5744
+ flagType: "boolean",
5745
+ // Ships ARMED (ENG-11305): the block is the point, and a dark default is a
5746
+ // control that is "Done" and never in force. This literal is duplicated as
5747
+ // the fallback inside self_serve_org_creation_blocked() (SQL cannot see the
5748
+ // registry); eng-11305-self-serve-org-block.test.ts asserts they agree. No
5749
+ // envVar on purpose: TS honours env first and SQL cannot see it, so the two
5750
+ // halves of the gate would disagree on any host that set one.
5751
+ defaultValue: true,
5752
+ // An org override is meaningless here (no org exists when this evaluates)
5753
+ // and is ignored by the SQL half; stop org admins setting one that would
5754
+ // read as if it did something.
5755
+ platformAdminOnly: true,
5756
+ // ADR-0022 §4, CodeRabbit on #6733. `platformAdminOnly` answers WHO may
5757
+ // change this; it does not make changing it deliberate. Turning this flag
5758
+ // OFF reopens self-serve organization creation fleet-wide — every new org
5759
+ // carries the default comp subscription and can provision managed hosts —
5760
+ // and it is a single toggle on a list of toggles, with no org-level blast
5761
+ // radius to make anyone hesitate. `sensitive` is what forces the
5762
+ // confirmation: `isSensitiveFlag` gates the API mutation on an explicit
5763
+ // `confirm: true` (`routes/flags.ts:487`) and on `?confirm=true` for an
5764
+ // override removal (`:360`), and the admin page routes it through a
5765
+ // confirm modal rather than an inline write (`page.tsx:179`).
5766
+ //
5767
+ // This rolls FLAGS_SCHEMA_VERSION, which is expected: `sensitive` is part
5768
+ // of the structural projection (`schema-version.ts:37`).
5769
+ sensitive: true
5770
+ },
5718
5771
  {
5719
5772
  key: "agent-hours-billing-enabled",
5720
5773
  description: "Agent-hours (utilisation) billing (ENG-7910). Per-org gate; ships dark. When on for an org, its closed billing periods are settled into org_agent_hours_settlements from the plan/override agent-hours terms, and the customer billing surface shows used-vs-included hours + projected overage. Off = no settlement written, no charge, surface hidden. Launch prices are seeded in plan_billing_terms; flip on per-org for a controlled rollout.",
@@ -15395,27 +15448,21 @@ function isBareAck(text) {
15395
15448
  }
15396
15449
 
15397
15450
  // ../../packages/core/dist/conversations/metrics.js
15451
+ var DAY_MS2 = 24 * 60 * 60 * 1e3;
15452
+ var ALL_TIME_FLOOR_ISO = "2026-01-01T00:00:00.000Z";
15453
+ var ALL_TIME_FLOOR_MS = Date.parse(ALL_TIME_FLOOR_ISO);
15398
15454
  var PERIOD_CONFIG = {
15399
- "24h": { windowMs: 24 * 60 * 60 * 1e3, bucket: "hour" },
15400
- "7d": { windowMs: 7 * 24 * 60 * 60 * 1e3, bucket: "day" },
15401
- "30d": { windowMs: 30 * 24 * 60 * 60 * 1e3, bucket: "day" }
15455
+ "24h": { windowMs: DAY_MS2, bucket: "hour" },
15456
+ "7d": { windowMs: 7 * DAY_MS2, bucket: "day" },
15457
+ "30d": { windowMs: 30 * DAY_MS2, bucket: "day" },
15458
+ "90d": { windowMs: 90 * DAY_MS2, bucket: "day" },
15459
+ "180d": { windowMs: 180 * DAY_MS2, bucket: "day" },
15460
+ all: { windowMs: null, bucket: "day" }
15402
15461
  };
15403
15462
  var CONVERSATION_METRICS_PERIODS = Object.keys(PERIOD_CONFIG);
15404
15463
 
15405
15464
  // ../../packages/core/dist/conversations/eval-scores.js
15406
15465
  var EVAL_SCORE_MA_WINDOW_MS = 28 * 24 * 60 * 60 * 1e3;
15407
- var PERIOD_CONFIG2 = {
15408
- "24h": { windowMs: 24 * 60 * 60 * 1e3, bucket: "hour" },
15409
- "7d": { windowMs: 7 * 24 * 60 * 60 * 1e3, bucket: "day" },
15410
- "30d": { windowMs: 30 * 24 * 60 * 60 * 1e3, bucket: "day" }
15411
- };
15412
-
15413
- // ../../packages/core/dist/conversations/eval-failures.js
15414
- var PERIOD_WINDOW_MS = {
15415
- "24h": 24 * 60 * 60 * 1e3,
15416
- "7d": 7 * 24 * 60 * 60 * 1e3,
15417
- "30d": 30 * 24 * 60 * 60 * 1e3
15418
- };
15419
15466
 
15420
15467
  // ../../packages/core/dist/conversations/eval-failure-categories.js
15421
15468
  var CONVERSATION_FAILURE_CATEGORIES = [
@@ -15473,19 +15520,9 @@ function buildFailureCategoryPromptLines() {
15473
15520
  function isConversationFailureCategory(v) {
15474
15521
  return typeof v === "string" && CONVERSATION_FAILURE_CATEGORIES.includes(v);
15475
15522
  }
15476
- var PERIOD_WINDOW_MS2 = {
15477
- "24h": 24 * 60 * 60 * 1e3,
15478
- "7d": 7 * 24 * 60 * 60 * 1e3,
15479
- "30d": 30 * 24 * 60 * 60 * 1e3
15480
- };
15481
15523
 
15482
15524
  // ../../packages/core/dist/ratings/kanban-ratings.js
15483
15525
  var RATING_MA_WINDOW_MS = 28 * 24 * 60 * 60 * 1e3;
15484
- var PERIOD_CONFIG3 = {
15485
- "24h": { windowMs: 24 * 60 * 60 * 1e3, bucket: "hour" },
15486
- "7d": { windowMs: 7 * 24 * 60 * 60 * 1e3, bucket: "day" },
15487
- "30d": { windowMs: 30 * 24 * 60 * 60 * 1e3, bucket: "day" }
15488
- };
15489
15526
 
15490
15527
  // ../../packages/core/dist/triggers/registry.js
15491
15528
  var sources = /* @__PURE__ */ new Map();
@@ -16199,4 +16236,4 @@ export {
16199
16236
  peekCurrentSession,
16200
16237
  readDailySessionPin
16201
16238
  };
16202
- //# sourceMappingURL=chunk-5SASCNYV.js.map
16239
+ //# sourceMappingURL=chunk-7F2UFKYG.js.map