@integrity-labs/agt-cli 0.28.1042 → 0.28.1044

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-JPE2SHWA.js";
43
+ } from "../chunk-QPKBYXGK.js";
44
44
  import {
45
45
  getProjectDir,
46
46
  isSessionResumeDisabled,
47
47
  readDirectChatSessionState
48
- } from "../chunk-JGPCLZFP.js";
48
+ } from "../chunk-TAINRP4T.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-TXRZFABA.js";
82
+ } from "../chunk-46YPCLWA.js";
83
83
  import "../chunk-TQDIIS3X.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.1042" : "dev";
5477
+ var cliVersion = true ? "0.28.1044" : "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.1042" : "dev";
6737
+ var cliVersion2 = true ? "0.28.1044" : "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) => {
@@ -11537,7 +11537,13 @@ var HTTP_PROBE_PROVIDERS = /* @__PURE__ */ new Set([
11537
11537
  // Routes to `probeInstantly` against `GET /api/v2/accounts?limit=1`: free,
11538
11538
  // read-only, no required arguments. It needs `accounts:read`, which a
11539
11539
  // customer may leave off their key, so a 403 grades `degraded`, not `down`.
11540
- "instantly"
11540
+ "instantly",
11541
+ // CS-1857: Mitti, added with the integration for the same reason as Instantly.
11542
+ // A Mitti service user token lapses after 31-180 days of inactivity or when an
11543
+ // admin revokes it, and the integration is read-only, so a dead token would
11544
+ // otherwise surface as empty compliance reports rather than a failed write.
11545
+ // Routes to `probeMitti` against `GET /scheduling/v1/feed/schedules?limit=1`.
11546
+ "mitti"
11541
11547
  // ENG-6100: GitHub is deliberately NOT here. This set drives the ASYNC
11542
11548
  // connectivity monitor's routing, where github (source_type='native')
11543
11549
  // stays host-side (cli_command — `gh`, the credential the agent actually
@@ -11989,6 +11995,39 @@ async function probeInstantly(creds, fetchImpl) {
11989
11995
  return networkOutcome(err, String(token));
11990
11996
  }
11991
11997
  }
11998
+ async function probeMitti(creds, fetchImpl) {
11999
+ const token = creds.api_key ?? creds.access_token;
12000
+ if (!token)
12001
+ return { status: "down", message: "No credential present" };
12002
+ try {
12003
+ const res = await timedFetch(fetchImpl, "https://api.mitti.com/scheduling/v1/feed/schedules?limit=1", {
12004
+ headers: { Authorization: `Bearer ${token}` }
12005
+ });
12006
+ if (res.status === 403) {
12007
+ return {
12008
+ status: "degraded",
12009
+ cause: "auth_rejected",
12010
+ message: 'Mitti denied access (403) - check the plan has API access, the token is a service user token, and it has the "View all data" permission'
12011
+ };
12012
+ }
12013
+ if (!res.ok) {
12014
+ const message = res.status === 401 ? "Mitti rejected the token (401) - expired, revoked or invalid API token" : res.status === 429 ? rateLimitMessage("Mitti", res.status) : `Mitti API returned ${res.status}`;
12015
+ return { status: statusForHttp(res.status), cause: causeForHttp(res.status), message };
12016
+ }
12017
+ let body = null;
12018
+ try {
12019
+ body = await res.json();
12020
+ } catch {
12021
+ body = null;
12022
+ }
12023
+ if (!Array.isArray(body?.data)) {
12024
+ return { status: "down", message: "Mitti returned 200 without a schedules feed - not a Mitti API response" };
12025
+ }
12026
+ return { status: "ok", message: "Connected to Mitti" };
12027
+ } catch (err) {
12028
+ return networkOutcome(err, String(token));
12029
+ }
12030
+ }
11992
12031
  async function probeHttpProvider(definitionId, credentials, fetchImpl = fetch) {
11993
12032
  switch (definitionId) {
11994
12033
  case "linear":
@@ -12003,6 +12042,8 @@ async function probeHttpProvider(definitionId, credentials, fetchImpl = fetch) {
12003
12042
  return probeSportsyear(credentials, fetchImpl);
12004
12043
  case "instantly":
12005
12044
  return probeInstantly(credentials, fetchImpl);
12045
+ case "mitti":
12046
+ return probeMitti(credentials, fetchImpl);
12006
12047
  case "google-workspace":
12007
12048
  return probeBearerJson("https://www.googleapis.com/oauth2/v2/userinfo", credentials, fetchImpl, (body) => {
12008
12049
  const info = body;
@@ -15683,4 +15724,4 @@ export {
15683
15724
  peekCurrentSession,
15684
15725
  readDailySessionPin
15685
15726
  };
15686
- //# sourceMappingURL=chunk-TXRZFABA.js.map
15727
+ //# sourceMappingURL=chunk-46YPCLWA.js.map