@integrity-labs/agt-cli 0.28.1079 → 0.28.1081

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-TTSW5ZM2.js → chunk-3O2US5IG.js} +4 -4
  3. package/dist/{chunk-5SASCNYV.js → chunk-7F2UFKYG.js} +68 -31
  4. package/dist/chunk-7F2UFKYG.js.map +1 -0
  5. package/dist/{chunk-OGMCA67P.js → chunk-SREQF7XT.js} +2 -2
  6. package/dist/{claude-pair-runtime-ZHB5I7E6.js → claude-pair-runtime-JCCZH6OO.js} +2 -2
  7. package/dist/lib/manager-worker.js +16 -16
  8. package/dist/mcp/augmented-support.js +25 -3
  9. package/dist/mcp/direct-chat-channel.js +39 -27
  10. package/dist/mcp/index.js +64 -29
  11. package/dist/mcp/origami.js +39 -27
  12. package/dist/mcp/slack-channel.js +39 -27
  13. package/dist/mcp/telegram-channel.js +43 -31
  14. package/dist/{persistent-session-UZUEF6BV.js → persistent-session-HC2M4YIE.js} +3 -3
  15. package/dist/{responsiveness-probe-K5DU6QFZ.js → responsiveness-probe-FU36EGNL.js} +3 -3
  16. package/dist/{session-auth-dead-47ZVQPUP.js → session-auth-dead-W6E555FY.js} +2 -2
  17. package/package.json +1 -1
  18. package/dist/chunk-5SASCNYV.js.map +0 -1
  19. /package/dist/{chunk-TTSW5ZM2.js.map → chunk-3O2US5IG.js.map} +0 -0
  20. /package/dist/{chunk-OGMCA67P.js.map → chunk-SREQF7XT.js.map} +0 -0
  21. /package/dist/{claude-pair-runtime-ZHB5I7E6.js.map → claude-pair-runtime-JCCZH6OO.js.map} +0 -0
  22. /package/dist/{persistent-session-UZUEF6BV.js.map → persistent-session-HC2M4YIE.js.map} +0 -0
  23. /package/dist/{responsiveness-probe-K5DU6QFZ.js.map → responsiveness-probe-FU36EGNL.js.map} +0 -0
  24. /package/dist/{session-auth-dead-47ZVQPUP.js.map → session-auth-dead-W6E555FY.js.map} +0 -0
@@ -24,7 +24,7 @@ import {
24
24
  rotateDailySession,
25
25
  sessionFileExists,
26
26
  todayLocalIso
27
- } from "./chunk-5SASCNYV.js";
27
+ } from "./chunk-7F2UFKYG.js";
28
28
  import {
29
29
  classifyUnanswerablePane,
30
30
  findUsageLimitResetHint,
@@ -6113,4 +6113,4 @@ export {
6113
6113
  stopAllSessionsAndWait,
6114
6114
  getProjectDir
6115
6115
  };
6116
- //# sourceMappingURL=chunk-OGMCA67P.js.map
6116
+ //# sourceMappingURL=chunk-SREQF7XT.js.map
@@ -266,7 +266,7 @@ async function spawnPairSession(session) {
266
266
  return { ok: true };
267
267
  } catch {
268
268
  }
269
- const { resolveClaudeBinary } = await import("./persistent-session-UZUEF6BV.js");
269
+ const { resolveClaudeBinary } = await import("./persistent-session-HC2M4YIE.js");
270
270
  const claudeBin = resolveClaudeBinary();
271
271
  const pairEnv = {
272
272
  ...process.env,
@@ -734,4 +734,4 @@ export {
734
734
  startClaudePair,
735
735
  submitClaudePairCode
736
736
  };
737
- //# sourceMappingURL=claude-pair-runtime-ZHB5I7E6.js.map
737
+ //# sourceMappingURL=claude-pair-runtime-JCCZH6OO.js.map
@@ -67,7 +67,7 @@ import {
67
67
  safeWriteJsonAtomic,
68
68
  setConfigHash,
69
69
  tripClass
70
- } from "../chunk-TTSW5ZM2.js";
70
+ } from "../chunk-3O2US5IG.js";
71
71
  import {
72
72
  getProjectDir as getProjectDir2,
73
73
  getReadyTasks,
@@ -154,7 +154,7 @@ import {
154
154
  webFetchBaselineValue,
155
155
  webFetchRestartNeeded,
156
156
  writeEgressAllowlist
157
- } from "../chunk-OGMCA67P.js";
157
+ } from "../chunk-SREQF7XT.js";
158
158
  import {
159
159
  ACCOUNT_ENFORCEMENT_MARKER_FILENAME,
160
160
  AnchorSessionClient,
@@ -263,7 +263,7 @@ import {
263
263
  subagentActivityAgeSeconds,
264
264
  sumTranscriptUsageInWindow,
265
265
  transcriptActivityAgeSeconds
266
- } from "../chunk-5SASCNYV.js";
266
+ } from "../chunk-7F2UFKYG.js";
267
267
  import {
268
268
  classifyUnanswerablePane,
269
269
  paneRemedy
@@ -14141,7 +14141,7 @@ var pendingDayRolloverReset = /* @__PURE__ */ new Set();
14141
14141
  var dayRolloverInboundHold = /* @__PURE__ */ new Map();
14142
14142
  var INBOUND_HOLD_EPISODE_GAP_MS = 12e4;
14143
14143
  async function channelInboundActivityAgeSecondsFor(codeName) {
14144
- const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-K5DU6QFZ.js");
14144
+ const { newestPendingInboundActivityMtimeMs } = await import("../responsiveness-probe-FU36EGNL.js");
14145
14145
  const newest = newestPendingInboundActivityMtimeMs(dirname11(paneLogPath(codeName)));
14146
14146
  if (newest === null) return null;
14147
14147
  return Math.max(0, Math.floor((Date.now() - newest) / 1e3));
@@ -14899,7 +14899,7 @@ var agentRestartTimezoneInputs = /* @__PURE__ */ new Map();
14899
14899
  var lastVersionCheckAt = 0;
14900
14900
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
14901
14901
  var lastResponsivenessProbeAt = 0;
14902
- var agtCliVersion = true ? "0.28.1079" : "dev";
14902
+ var agtCliVersion = true ? "0.28.1081" : "dev";
14903
14903
  function resolveBrewPath(execFileSync3) {
14904
14904
  try {
14905
14905
  const out = execFileSync3("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -16516,7 +16516,7 @@ function flushRestartedAgentDiagnostics(hostId, codeNames) {
16516
16516
  if (codeNames.length === 0) return;
16517
16517
  void (async () => {
16518
16518
  try {
16519
- const { collectDiagnostics } = await import("../persistent-session-UZUEF6BV.js");
16519
+ const { collectDiagnostics } = await import("../persistent-session-HC2M4YIE.js");
16520
16520
  await api.post("/host/heartbeat", {
16521
16521
  host_id: hostId,
16522
16522
  agent_diagnostics: collectDiagnostics(codeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor)
@@ -16658,7 +16658,7 @@ async function pollCycleInner() {
16658
16658
  }
16659
16659
  try {
16660
16660
  const { detectHostSecurity } = await import("../host-security-KQYYZZVW.js");
16661
- const { collectDiagnostics } = await import("../persistent-session-UZUEF6BV.js");
16661
+ const { collectDiagnostics } = await import("../persistent-session-HC2M4YIE.js");
16662
16662
  const diagCodeNames = [...agentState.persistentSessionAgents];
16663
16663
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames, quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor) : void 0;
16664
16664
  let tailscaleHostname;
@@ -16866,7 +16866,7 @@ async function pollCycleInner() {
16866
16866
  collectPanelessActivityProbes,
16867
16867
  getResponsivenessIntervalMs,
16868
16868
  occupancyQualificationClassifications
16869
- } = await import("../responsiveness-probe-K5DU6QFZ.js");
16869
+ } = await import("../responsiveness-probe-FU36EGNL.js");
16870
16870
  const probeIntervalMs = getResponsivenessIntervalMs();
16871
16871
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
16872
16872
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -16983,7 +16983,7 @@ async function pollCycleInner() {
16983
16983
  collectResponsivenessProbes,
16984
16984
  livePendingInboundOldestAgeSeconds,
16985
16985
  parkPendingInbound
16986
- } = await import("../responsiveness-probe-K5DU6QFZ.js");
16986
+ } = await import("../responsiveness-probe-FU36EGNL.js");
16987
16987
  const { getProjectDir: wedgeProjectDir } = await import("../scheduler-engine-M6AFZWNU.js");
16988
16988
  const wedgeNow = /* @__PURE__ */ new Date();
16989
16989
  const liveAgents = agentState.persistentSessionAgents;
@@ -17269,7 +17269,7 @@ async function pollCycleInner() {
17269
17269
  }
17270
17270
  }
17271
17271
  );
17272
- const { parkPendingInbound } = await import("../responsiveness-probe-K5DU6QFZ.js");
17272
+ const { parkPendingInbound } = await import("../responsiveness-probe-FU36EGNL.js");
17273
17273
  const { parked, deadLettered } = parkPendingInbound(codeName, new Date(fatalNowMs));
17274
17274
  paneFatalStreak.delete(codeName);
17275
17275
  paneFatalRestarts.set(codeName, [...history, fatalNowMs]);
@@ -17300,7 +17300,7 @@ async function pollCycleInner() {
17300
17300
  TRANSCRIPT_MOUNT_ESCALATION_REFRESH_MS,
17301
17301
  bindSourceEscalations
17302
17302
  } = await import("../transcript-mount-health-OHE6IVJV.js");
17303
- const { transcriptBindSourcesFor, ensureTranscriptBindSources } = await import("../persistent-session-UZUEF6BV.js");
17303
+ const { transcriptBindSourcesFor, ensureTranscriptBindSources } = await import("../persistent-session-HC2M4YIE.js");
17304
17304
  const mountConfig = resolveTranscriptMountConfig();
17305
17305
  const liveAgents = agentState.persistentSessionAgents;
17306
17306
  for (const tracked of [
@@ -17465,7 +17465,7 @@ async function pollCycleInner() {
17465
17465
  }
17466
17466
  try {
17467
17467
  const { scrapeMcpFailedBannerCount } = await import("../pane-mcp-banner-scraper-VR5QGP3J.js");
17468
- const { probeSessionAuth } = await import("../session-auth-dead-47ZVQPUP.js");
17468
+ const { probeSessionAuth } = await import("../session-auth-dead-W6E555FY.js");
17469
17469
  const observations = [];
17470
17470
  const pendingCacheCommits = [];
17471
17471
  const modelApiErrorReportingOn = hostFlagStore().getBoolean("model-api-error-reporting");
@@ -22030,7 +22030,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
22030
22030
  try {
22031
22031
  const freshId = rotateSessionForWedge(codeName);
22032
22032
  consecutiveWedgeCycles.delete(codeName);
22033
- const { parkPendingInbound: parkForRestart } = await import("../responsiveness-probe-K5DU6QFZ.js");
22033
+ const { parkPendingInbound: parkForRestart } = await import("../responsiveness-probe-FU36EGNL.js");
22034
22034
  const { parked, deadLettered } = parkForRestart(codeName, /* @__PURE__ */ new Date());
22035
22035
  const parkNote = parked > 0 ? `, ${parked} inbound parked` : "";
22036
22036
  const deadNote = deadLettered > 0 ? `, ${deadLettered} undeliverable dead-lettered` : "";
@@ -22073,7 +22073,7 @@ async function handleRestartDoorbell(agentId, requestedAt, restartReason) {
22073
22073
  void api.post("/host/restart-ack", { host_id: hostId, agent_id: agentId, restart_requested_at: requestedAt }).catch((err) => log(`[restart-lane] ack failed for '${codeName}': ${err.message}`));
22074
22074
  void (async () => {
22075
22075
  try {
22076
- const { collectDiagnostics } = await import("../persistent-session-UZUEF6BV.js");
22076
+ const { collectDiagnostics } = await import("../persistent-session-HC2M4YIE.js");
22077
22077
  await api.post("/host/heartbeat", {
22078
22078
  host_id: hostId,
22079
22079
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor)
@@ -22124,7 +22124,7 @@ async function respawnAgentAfterMcpStop(codeName, reason) {
22124
22124
  }
22125
22125
  try {
22126
22126
  const hostId = await getHostId();
22127
- const { collectDiagnostics } = await import("../persistent-session-UZUEF6BV.js");
22127
+ const { collectDiagnostics } = await import("../persistent-session-HC2M4YIE.js");
22128
22128
  await api.post("/host/heartbeat", {
22129
22129
  host_id: hostId,
22130
22130
  agent_diagnostics: collectDiagnostics([codeName], quarantineEntriesFor, claudeMdSizeFor, spawnOutcomeForDiagnostics, pidPressureFor, forwardedToolsFor, runtimeVersionFor)
@@ -22796,7 +22796,7 @@ async function processClaudePairSessions(agents) {
22796
22796
  // cannot take it for itself — by the time it runs, the write it is looking
22797
22797
  // for may already have happened.
22798
22798
  snapshotPairConfig
22799
- } = await import("../claude-pair-runtime-ZHB5I7E6.js");
22799
+ } = await import("../claude-pair-runtime-JCCZH6OO.js");
22800
22800
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
22801
22801
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
22802
22802
  const killed = await killPairSession(pairTmuxSession(pairId));
@@ -21168,6 +21168,23 @@ var SupportClient = class _SupportClient {
21168
21168
  var listSchema = external_exports.object({
21169
21169
  limit: external_exports.number().int().positive().optional().describe("Max rows to return (page size, clamped server-side). Not a scope - reads are always your own org.")
21170
21170
  });
21171
+ var NO_REQUESTER_REASONS = [
21172
+ "agent_initiated",
21173
+ "requester_declined_contact",
21174
+ "no_identifiable_user"
21175
+ ];
21176
+ var NO_REQUESTER_REASON_DESCRIPTION = 'Required when you pass neither requester_email nor requester_user_id: say why there is no requester. "agent_initiated" = you are filing this on your own initiative, no person asked; "requester_declined_contact" = a person asked but did not agree to be contacted; "no_identifiable_user" = a person asked but you cannot tell who. Never pass this together with a requester.';
21177
+ function requesterChoiceError(args) {
21178
+ const hasRequester = Boolean(args.requester_email?.trim() || args.requester_user_id?.trim());
21179
+ const hasReason = Boolean(args.no_requester_reason);
21180
+ if (hasRequester && hasReason) {
21181
+ return "Not sent: pass either a requester (requester_email or requester_user_id) or no_requester_reason, not both.";
21182
+ }
21183
+ if (!hasRequester && !hasReason) {
21184
+ return `Not sent: say who this request is for. Pass requester_email (only with that person's consent) or requester_user_id, so Ninjafy can reply to them. If there is no one to reply to, pass no_requester_reason: "agent_initiated" (nobody asked, you are filing it yourself), "requester_declined_contact" (they asked but did not agree to be contacted) or "no_identifiable_user" (you cannot tell who asked). Then call this again.`;
21185
+ }
21186
+ return null;
21187
+ }
21171
21188
  var fileRequestSchema = external_exports.object({
21172
21189
  title: external_exports.string().min(1).describe("Short summary of the bug or request."),
21173
21190
  description: external_exports.string().min(1).describe("Full detail: what happened / what is wanted, and any reproduction steps."),
@@ -21177,7 +21194,8 @@ var fileRequestSchema = external_exports.object({
21177
21194
  ),
21178
21195
  requester_user_id: external_exports.string().uuid().optional().describe(
21179
21196
  "Optional Ninjafy user id (UUID) of the requester, used to look up their email for the resolved-notification when you have an id but not an address."
21180
- )
21197
+ ),
21198
+ no_requester_reason: external_exports.enum(NO_REQUESTER_REASONS).optional().describe(NO_REQUESTER_REASON_DESCRIPTION)
21181
21199
  });
21182
21200
  var searchKbSchema = external_exports.object({
21183
21201
  query: external_exports.string().trim().min(1).describe('What to look up in the knowledge base (e.g. "agent keeps restarting", "connect Slack").'),
@@ -21387,9 +21405,11 @@ server.tool(
21387
21405
  );
21388
21406
  server.tool(
21389
21407
  "support_file_support_request",
21390
- "File a BUG report to Ninjafy support when you hit a platform problem you cannot resolve from your own org (Ninjafy was formerly Augmented Team; either name means this platform). It goes to the Ninjafy support queue, not your org. Pass { title, description }. Returns { ok, status } - relay the outcome to the user.",
21408
+ "File a BUG report to Ninjafy support when you hit a platform problem you cannot resolve from your own org (Ninjafy was formerly Augmented Team; either name means this platform). It goes to the Ninjafy support queue, not your org. Pass { title, description } plus EITHER the requester (requester_email, only with their consent, or requester_user_id) OR no_requester_reason saying why there is none. Returns { ok, status } - relay the outcome to the user.",
21391
21409
  fileRequestSchema.shape,
21392
21410
  async (args) => {
21411
+ const choiceError = requesterChoiceError(args);
21412
+ if (choiceError) return { content: [{ type: "text", text: choiceError }], isError: true };
21393
21413
  try {
21394
21414
  return ok(await client.fileSupportRequest(args));
21395
21415
  } catch (err) {
@@ -21399,9 +21419,11 @@ server.tool(
21399
21419
  );
21400
21420
  server.tool(
21401
21421
  "support_file_feature_request",
21402
- 'File a FEATURE or new-integration request to Ninjafy support, formerly Augmented Team (goes to the support queue, not your org). Use `provider` for an integration ask (e.g. "notion"). Pass { title, description, provider? }. Returns { ok, status }.',
21422
+ 'File a FEATURE or new-integration request to Ninjafy support, formerly Augmented Team (goes to the support queue, not your org). Use `provider` for an integration ask (e.g. "notion"). Pass { title, description, provider? } plus EITHER the requester (requester_email, only with their consent, or requester_user_id) OR no_requester_reason saying why there is none. Returns { ok, status }.',
21403
21423
  fileRequestSchema.shape,
21404
21424
  async (args) => {
21425
+ const choiceError = requesterChoiceError(args);
21426
+ if (choiceError) return { content: [{ type: "text", text: choiceError }], isError: true };
21405
21427
  try {
21406
21428
  return ok(await client.fileFeatureRequest(args));
21407
21429
  } catch (err) {
@@ -36236,42 +36236,24 @@ var DAY_MS = 24 * HOUR_MS;
36236
36236
  var ALERT_AGE_SEVERITY_FLOORS = [{ afterMs: 24 * HOUR_MS, floor: "critical" }];
36237
36237
 
36238
36238
  // ../core/dist/conversations/metrics.js
36239
+ var DAY_MS2 = 24 * 60 * 60 * 1e3;
36240
+ var ALL_TIME_FLOOR_ISO = "2026-01-01T00:00:00.000Z";
36241
+ var ALL_TIME_FLOOR_MS = Date.parse(ALL_TIME_FLOOR_ISO);
36239
36242
  var PERIOD_CONFIG = {
36240
- "24h": { windowMs: 24 * 60 * 60 * 1e3, bucket: "hour" },
36241
- "7d": { windowMs: 7 * 24 * 60 * 60 * 1e3, bucket: "day" },
36242
- "30d": { windowMs: 30 * 24 * 60 * 60 * 1e3, bucket: "day" }
36243
+ "24h": { windowMs: DAY_MS2, bucket: "hour" },
36244
+ "7d": { windowMs: 7 * DAY_MS2, bucket: "day" },
36245
+ "30d": { windowMs: 30 * DAY_MS2, bucket: "day" },
36246
+ "90d": { windowMs: 90 * DAY_MS2, bucket: "day" },
36247
+ "180d": { windowMs: 180 * DAY_MS2, bucket: "day" },
36248
+ all: { windowMs: null, bucket: "day" }
36243
36249
  };
36244
36250
  var CONVERSATION_METRICS_PERIODS = Object.keys(PERIOD_CONFIG);
36245
36251
 
36246
36252
  // ../core/dist/conversations/eval-scores.js
36247
36253
  var EVAL_SCORE_MA_WINDOW_MS = 28 * 24 * 60 * 60 * 1e3;
36248
- var PERIOD_CONFIG2 = {
36249
- "24h": { windowMs: 24 * 60 * 60 * 1e3, bucket: "hour" },
36250
- "7d": { windowMs: 7 * 24 * 60 * 60 * 1e3, bucket: "day" },
36251
- "30d": { windowMs: 30 * 24 * 60 * 60 * 1e3, bucket: "day" }
36252
- };
36253
-
36254
- // ../core/dist/conversations/eval-failures.js
36255
- var PERIOD_WINDOW_MS = {
36256
- "24h": 24 * 60 * 60 * 1e3,
36257
- "7d": 7 * 24 * 60 * 60 * 1e3,
36258
- "30d": 30 * 24 * 60 * 60 * 1e3
36259
- };
36260
-
36261
- // ../core/dist/conversations/eval-failure-categories.js
36262
- var PERIOD_WINDOW_MS2 = {
36263
- "24h": 24 * 60 * 60 * 1e3,
36264
- "7d": 7 * 24 * 60 * 60 * 1e3,
36265
- "30d": 30 * 24 * 60 * 60 * 1e3
36266
- };
36267
36254
 
36268
36255
  // ../core/dist/ratings/kanban-ratings.js
36269
36256
  var RATING_MA_WINDOW_MS = 28 * 24 * 60 * 60 * 1e3;
36270
- var PERIOD_CONFIG3 = {
36271
- "24h": { windowMs: 24 * 60 * 60 * 1e3, bucket: "hour" },
36272
- "7d": { windowMs: 7 * 24 * 60 * 60 * 1e3, bucket: "day" },
36273
- "30d": { windowMs: 30 * 24 * 60 * 60 * 1e3, bucket: "day" }
36274
- };
36275
36257
 
36276
36258
  // ../core/dist/triggers/registry.js
36277
36259
  var sources = /* @__PURE__ */ new Map();
@@ -36669,6 +36651,36 @@ var FLAG_REGISTRY = [
36669
36651
  // wearing a precise number, which is the failure this field invites.
36670
36652
  since: "0.28.618"
36671
36653
  },
36654
+ {
36655
+ key: "block-self-serve-org-creation",
36656
+ 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.",
36657
+ flagType: "boolean",
36658
+ // Ships ARMED (ENG-11305): the block is the point, and a dark default is a
36659
+ // control that is "Done" and never in force. This literal is duplicated as
36660
+ // the fallback inside self_serve_org_creation_blocked() (SQL cannot see the
36661
+ // registry); eng-11305-self-serve-org-block.test.ts asserts they agree. No
36662
+ // envVar on purpose: TS honours env first and SQL cannot see it, so the two
36663
+ // halves of the gate would disagree on any host that set one.
36664
+ defaultValue: true,
36665
+ // An org override is meaningless here (no org exists when this evaluates)
36666
+ // and is ignored by the SQL half; stop org admins setting one that would
36667
+ // read as if it did something.
36668
+ platformAdminOnly: true,
36669
+ // ADR-0022 §4, CodeRabbit on #6733. `platformAdminOnly` answers WHO may
36670
+ // change this; it does not make changing it deliberate. Turning this flag
36671
+ // OFF reopens self-serve organization creation fleet-wide — every new org
36672
+ // carries the default comp subscription and can provision managed hosts —
36673
+ // and it is a single toggle on a list of toggles, with no org-level blast
36674
+ // radius to make anyone hesitate. `sensitive` is what forces the
36675
+ // confirmation: `isSensitiveFlag` gates the API mutation on an explicit
36676
+ // `confirm: true` (`routes/flags.ts:487`) and on `?confirm=true` for an
36677
+ // override removal (`:360`), and the admin page routes it through a
36678
+ // confirm modal rather than an inline write (`page.tsx:179`).
36679
+ //
36680
+ // This rolls FLAGS_SCHEMA_VERSION, which is expected: `sensitive` is part
36681
+ // of the structural projection (`schema-version.ts:37`).
36682
+ sensitive: true
36683
+ },
36672
36684
  {
36673
36685
  key: "agent-hours-billing-enabled",
36674
36686
  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.",
package/dist/mcp/index.js CHANGED
@@ -28454,42 +28454,24 @@ var DAY_MS = 24 * HOUR_MS;
28454
28454
  var ALERT_AGE_SEVERITY_FLOORS = [{ afterMs: 24 * HOUR_MS, floor: "critical" }];
28455
28455
 
28456
28456
  // ../core/dist/conversations/metrics.js
28457
+ var DAY_MS2 = 24 * 60 * 60 * 1e3;
28458
+ var ALL_TIME_FLOOR_ISO = "2026-01-01T00:00:00.000Z";
28459
+ var ALL_TIME_FLOOR_MS = Date.parse(ALL_TIME_FLOOR_ISO);
28457
28460
  var PERIOD_CONFIG = {
28458
- "24h": { windowMs: 24 * 60 * 60 * 1e3, bucket: "hour" },
28459
- "7d": { windowMs: 7 * 24 * 60 * 60 * 1e3, bucket: "day" },
28460
- "30d": { windowMs: 30 * 24 * 60 * 60 * 1e3, bucket: "day" }
28461
+ "24h": { windowMs: DAY_MS2, bucket: "hour" },
28462
+ "7d": { windowMs: 7 * DAY_MS2, bucket: "day" },
28463
+ "30d": { windowMs: 30 * DAY_MS2, bucket: "day" },
28464
+ "90d": { windowMs: 90 * DAY_MS2, bucket: "day" },
28465
+ "180d": { windowMs: 180 * DAY_MS2, bucket: "day" },
28466
+ all: { windowMs: null, bucket: "day" }
28461
28467
  };
28462
28468
  var CONVERSATION_METRICS_PERIODS = Object.keys(PERIOD_CONFIG);
28463
28469
 
28464
28470
  // ../core/dist/conversations/eval-scores.js
28465
28471
  var EVAL_SCORE_MA_WINDOW_MS = 28 * 24 * 60 * 60 * 1e3;
28466
- var PERIOD_CONFIG2 = {
28467
- "24h": { windowMs: 24 * 60 * 60 * 1e3, bucket: "hour" },
28468
- "7d": { windowMs: 7 * 24 * 60 * 60 * 1e3, bucket: "day" },
28469
- "30d": { windowMs: 30 * 24 * 60 * 60 * 1e3, bucket: "day" }
28470
- };
28471
-
28472
- // ../core/dist/conversations/eval-failures.js
28473
- var PERIOD_WINDOW_MS = {
28474
- "24h": 24 * 60 * 60 * 1e3,
28475
- "7d": 7 * 24 * 60 * 60 * 1e3,
28476
- "30d": 30 * 24 * 60 * 60 * 1e3
28477
- };
28478
-
28479
- // ../core/dist/conversations/eval-failure-categories.js
28480
- var PERIOD_WINDOW_MS2 = {
28481
- "24h": 24 * 60 * 60 * 1e3,
28482
- "7d": 7 * 24 * 60 * 60 * 1e3,
28483
- "30d": 30 * 24 * 60 * 60 * 1e3
28484
- };
28485
28472
 
28486
28473
  // ../core/dist/ratings/kanban-ratings.js
28487
28474
  var RATING_MA_WINDOW_MS = 28 * 24 * 60 * 60 * 1e3;
28488
- var PERIOD_CONFIG3 = {
28489
- "24h": { windowMs: 24 * 60 * 60 * 1e3, bucket: "hour" },
28490
- "7d": { windowMs: 7 * 24 * 60 * 60 * 1e3, bucket: "day" },
28491
- "30d": { windowMs: 30 * 24 * 60 * 60 * 1e3, bucket: "day" }
28492
- };
28493
28475
 
28494
28476
  // ../core/dist/triggers/registry.js
28495
28477
  var sources = /* @__PURE__ */ new Map();
@@ -28887,6 +28869,36 @@ var FLAG_REGISTRY = [
28887
28869
  // wearing a precise number, which is the failure this field invites.
28888
28870
  since: "0.28.618"
28889
28871
  },
28872
+ {
28873
+ key: "block-self-serve-org-creation",
28874
+ 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.",
28875
+ flagType: "boolean",
28876
+ // Ships ARMED (ENG-11305): the block is the point, and a dark default is a
28877
+ // control that is "Done" and never in force. This literal is duplicated as
28878
+ // the fallback inside self_serve_org_creation_blocked() (SQL cannot see the
28879
+ // registry); eng-11305-self-serve-org-block.test.ts asserts they agree. No
28880
+ // envVar on purpose: TS honours env first and SQL cannot see it, so the two
28881
+ // halves of the gate would disagree on any host that set one.
28882
+ defaultValue: true,
28883
+ // An org override is meaningless here (no org exists when this evaluates)
28884
+ // and is ignored by the SQL half; stop org admins setting one that would
28885
+ // read as if it did something.
28886
+ platformAdminOnly: true,
28887
+ // ADR-0022 §4, CodeRabbit on #6733. `platformAdminOnly` answers WHO may
28888
+ // change this; it does not make changing it deliberate. Turning this flag
28889
+ // OFF reopens self-serve organization creation fleet-wide — every new org
28890
+ // carries the default comp subscription and can provision managed hosts —
28891
+ // and it is a single toggle on a list of toggles, with no org-level blast
28892
+ // radius to make anyone hesitate. `sensitive` is what forces the
28893
+ // confirmation: `isSensitiveFlag` gates the API mutation on an explicit
28894
+ // `confirm: true` (`routes/flags.ts:487`) and on `?confirm=true` for an
28895
+ // override removal (`:360`), and the admin page routes it through a
28896
+ // confirm modal rather than an inline write (`page.tsx:179`).
28897
+ //
28898
+ // This rolls FLAGS_SCHEMA_VERSION, which is expected: `sensitive` is part
28899
+ // of the structural projection (`schema-version.ts:37`).
28900
+ sensitive: true
28901
+ },
28890
28902
  {
28891
28903
  key: "agent-hours-billing-enabled",
28892
28904
  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.",
@@ -46673,6 +46685,23 @@ var FEATURE_REQUEST_TYPES = [
46673
46685
  "bug",
46674
46686
  "other"
46675
46687
  ];
46688
+ var NO_REQUESTER_REASONS = [
46689
+ "agent_initiated",
46690
+ "requester_declined_contact",
46691
+ "no_identifiable_user"
46692
+ ];
46693
+ var NO_REQUESTER_REASON_DESCRIPTION = 'Required when you pass neither requester_email nor requester_user_id: say why there is no requester. "agent_initiated" = you are filing this on your own initiative, no person asked; "requester_declined_contact" = a person asked but did not agree to be contacted; "no_identifiable_user" = a person asked but you cannot tell who. Never pass this together with a requester.';
46694
+ function requesterChoiceError(args) {
46695
+ const hasRequester = Boolean(args.requester_email?.trim() || args.requester_user_id?.trim());
46696
+ const hasReason = Boolean(args.no_requester_reason);
46697
+ if (hasRequester && hasReason) {
46698
+ return "Not sent: pass either a requester (requester_email or requester_user_id) or no_requester_reason, not both.";
46699
+ }
46700
+ if (!hasRequester && !hasReason) {
46701
+ return `Not sent: say who this request is for. Pass requester_email (only with that person's consent) or requester_user_id, so Ninjafy can reply to them. If there is no one to reply to, pass no_requester_reason: "agent_initiated" (nobody asked, you are filing it yourself), "requester_declined_contact" (they asked but did not agree to be contacted) or "no_identifiable_user" (you cannot tell who asked). Then call this again.`;
46702
+ }
46703
+ return null;
46704
+ }
46676
46705
  function describeFeatureRequestResult(resp) {
46677
46706
  if (resp.status === "created") {
46678
46707
  return {
@@ -48615,7 +48644,7 @@ server.tool(
48615
48644
  );
48616
48645
  server.tool(
48617
48646
  "request_feature",
48618
- 'Send a feature request to Ninjafy support (formerly Augmented Team \u2014 the same platform either way, so use this whichever name the user says) \u2014 most often to ask for a NEW third-party integration that is not in your toolkit yet (set feature_type="integration" and put the service name in provider). Also accepts general product feedback (other feature_type values). Use this when a user needs a capability you do not have and that you cannot configure yourself. Do not use it for things you can already do or set up. If the request came from a specific end user, you can pass their requester_email (only with their consent) so Ninjafy can email them directly when it is resolved.',
48647
+ 'Send a feature request to Ninjafy support (formerly Augmented Team \u2014 the same platform either way, so use this whichever name the user says) \u2014 most often to ask for a NEW third-party integration that is not in your toolkit yet (set feature_type="integration" and put the service name in provider). Also accepts general product feedback (other feature_type values). Use this when a user needs a capability you do not have and that you cannot configure yourself. Do not use it for things you can already do or set up. Say who the request is for: pass the requester_email of the person who asked (only with their consent) or their requester_user_id, so Ninjafy can reply to them; if there is no one to reply to, pass no_requester_reason instead. One of the two is required.',
48619
48648
  {
48620
48649
  feature_type: external_exports.enum(FEATURE_REQUEST_TYPES).describe(
48621
48650
  'What kind of request this is. Use "integration" to ask for a new third-party integration/toolkit; otherwise: tool, channel, capability, bug, or other.'
@@ -48635,9 +48664,14 @@ server.tool(
48635
48664
  ),
48636
48665
  requester_user_id: external_exports.string().uuid().optional().describe(
48637
48666
  "Optional Ninjafy user id (UUID) of the requester, used to look up their email for the resolved-notification when you have an id but not an address. Omit unless you know the actual Ninjafy user id."
48638
- )
48667
+ ),
48668
+ no_requester_reason: external_exports.enum(NO_REQUESTER_REASONS).optional().describe(NO_REQUESTER_REASON_DESCRIPTION)
48639
48669
  },
48640
48670
  async (params) => {
48671
+ const choiceError = requesterChoiceError(params);
48672
+ if (choiceError) {
48673
+ return { content: [{ type: "text", text: choiceError }], isError: true };
48674
+ }
48641
48675
  if (!AGT_AGENT_CODE_NAME) {
48642
48676
  return {
48643
48677
  content: [{ type: "text", text: "Error: AGT_AGENT_CODE_NAME not configured." }],
@@ -48654,6 +48688,7 @@ server.tool(
48654
48688
  ...params.provider ? { provider: params.provider } : {},
48655
48689
  ...params.requester_email ? { requester_email: params.requester_email } : {},
48656
48690
  ...params.requester_user_id ? { requester_user_id: params.requester_user_id } : {},
48691
+ ...params.no_requester_reason ? { no_requester_reason: params.no_requester_reason } : {},
48657
48692
  ...params.acknowledged_catalogue_alternative ? { acknowledged_catalogue_alternative: true } : {}
48658
48693
  });
48659
48694
  } catch (err) {
@@ -42377,42 +42377,24 @@ var DAY_MS = 24 * HOUR_MS;
42377
42377
  var ALERT_AGE_SEVERITY_FLOORS = [{ afterMs: 24 * HOUR_MS, floor: "critical" }];
42378
42378
 
42379
42379
  // ../core/dist/conversations/metrics.js
42380
+ var DAY_MS2 = 24 * 60 * 60 * 1e3;
42381
+ var ALL_TIME_FLOOR_ISO = "2026-01-01T00:00:00.000Z";
42382
+ var ALL_TIME_FLOOR_MS = Date.parse(ALL_TIME_FLOOR_ISO);
42380
42383
  var PERIOD_CONFIG = {
42381
- "24h": { windowMs: 24 * 60 * 60 * 1e3, bucket: "hour" },
42382
- "7d": { windowMs: 7 * 24 * 60 * 60 * 1e3, bucket: "day" },
42383
- "30d": { windowMs: 30 * 24 * 60 * 60 * 1e3, bucket: "day" }
42384
+ "24h": { windowMs: DAY_MS2, bucket: "hour" },
42385
+ "7d": { windowMs: 7 * DAY_MS2, bucket: "day" },
42386
+ "30d": { windowMs: 30 * DAY_MS2, bucket: "day" },
42387
+ "90d": { windowMs: 90 * DAY_MS2, bucket: "day" },
42388
+ "180d": { windowMs: 180 * DAY_MS2, bucket: "day" },
42389
+ all: { windowMs: null, bucket: "day" }
42384
42390
  };
42385
42391
  var CONVERSATION_METRICS_PERIODS = Object.keys(PERIOD_CONFIG);
42386
42392
 
42387
42393
  // ../core/dist/conversations/eval-scores.js
42388
42394
  var EVAL_SCORE_MA_WINDOW_MS = 28 * 24 * 60 * 60 * 1e3;
42389
- var PERIOD_CONFIG2 = {
42390
- "24h": { windowMs: 24 * 60 * 60 * 1e3, bucket: "hour" },
42391
- "7d": { windowMs: 7 * 24 * 60 * 60 * 1e3, bucket: "day" },
42392
- "30d": { windowMs: 30 * 24 * 60 * 60 * 1e3, bucket: "day" }
42393
- };
42394
-
42395
- // ../core/dist/conversations/eval-failures.js
42396
- var PERIOD_WINDOW_MS = {
42397
- "24h": 24 * 60 * 60 * 1e3,
42398
- "7d": 7 * 24 * 60 * 60 * 1e3,
42399
- "30d": 30 * 24 * 60 * 60 * 1e3
42400
- };
42401
-
42402
- // ../core/dist/conversations/eval-failure-categories.js
42403
- var PERIOD_WINDOW_MS2 = {
42404
- "24h": 24 * 60 * 60 * 1e3,
42405
- "7d": 7 * 24 * 60 * 60 * 1e3,
42406
- "30d": 30 * 24 * 60 * 60 * 1e3
42407
- };
42408
42395
 
42409
42396
  // ../core/dist/ratings/kanban-ratings.js
42410
42397
  var RATING_MA_WINDOW_MS = 28 * 24 * 60 * 60 * 1e3;
42411
- var PERIOD_CONFIG3 = {
42412
- "24h": { windowMs: 24 * 60 * 60 * 1e3, bucket: "hour" },
42413
- "7d": { windowMs: 7 * 24 * 60 * 60 * 1e3, bucket: "day" },
42414
- "30d": { windowMs: 30 * 24 * 60 * 60 * 1e3, bucket: "day" }
42415
- };
42416
42398
 
42417
42399
  // ../core/dist/triggers/registry.js
42418
42400
  var sources = /* @__PURE__ */ new Map();
@@ -42810,6 +42792,36 @@ var FLAG_REGISTRY = [
42810
42792
  // wearing a precise number, which is the failure this field invites.
42811
42793
  since: "0.28.618"
42812
42794
  },
42795
+ {
42796
+ key: "block-self-serve-org-creation",
42797
+ 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.",
42798
+ flagType: "boolean",
42799
+ // Ships ARMED (ENG-11305): the block is the point, and a dark default is a
42800
+ // control that is "Done" and never in force. This literal is duplicated as
42801
+ // the fallback inside self_serve_org_creation_blocked() (SQL cannot see the
42802
+ // registry); eng-11305-self-serve-org-block.test.ts asserts they agree. No
42803
+ // envVar on purpose: TS honours env first and SQL cannot see it, so the two
42804
+ // halves of the gate would disagree on any host that set one.
42805
+ defaultValue: true,
42806
+ // An org override is meaningless here (no org exists when this evaluates)
42807
+ // and is ignored by the SQL half; stop org admins setting one that would
42808
+ // read as if it did something.
42809
+ platformAdminOnly: true,
42810
+ // ADR-0022 §4, CodeRabbit on #6733. `platformAdminOnly` answers WHO may
42811
+ // change this; it does not make changing it deliberate. Turning this flag
42812
+ // OFF reopens self-serve organization creation fleet-wide — every new org
42813
+ // carries the default comp subscription and can provision managed hosts —
42814
+ // and it is a single toggle on a list of toggles, with no org-level blast
42815
+ // radius to make anyone hesitate. `sensitive` is what forces the
42816
+ // confirmation: `isSensitiveFlag` gates the API mutation on an explicit
42817
+ // `confirm: true` (`routes/flags.ts:487`) and on `?confirm=true` for an
42818
+ // override removal (`:360`), and the admin page routes it through a
42819
+ // confirm modal rather than an inline write (`page.tsx:179`).
42820
+ //
42821
+ // This rolls FLAGS_SCHEMA_VERSION, which is expected: `sensitive` is part
42822
+ // of the structural projection (`schema-version.ts:37`).
42823
+ sensitive: true
42824
+ },
42813
42825
  {
42814
42826
  key: "agent-hours-billing-enabled",
42815
42827
  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.",