@integrity-labs/agt-cli 0.28.1093 → 0.28.1095

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-IT7TKE5O.js";
43
+ } from "../chunk-OHKWHHTS.js";
44
44
  import {
45
45
  getProjectDir,
46
46
  isSessionResumeDisabled,
47
47
  readDirectChatSessionState
48
- } from "../chunk-WP6ISOPX.js";
48
+ } from "../chunk-6VIH2UFL.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-EAXTNN24.js";
82
+ } from "../chunk-KEMDLWTE.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.1093" : "dev";
5477
+ var cliVersion = true ? "0.28.1095" : "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.1093" : "dev";
6737
+ var cliVersion2 = true ? "0.28.1095" : "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) => {
@@ -24,7 +24,7 @@ import {
24
24
  rotateDailySession,
25
25
  sessionFileExists,
26
26
  todayLocalIso
27
- } from "./chunk-EAXTNN24.js";
27
+ } from "./chunk-KEMDLWTE.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-WP6ISOPX.js.map
6116
+ //# sourceMappingURL=chunk-6VIH2UFL.js.map
@@ -11997,7 +11997,13 @@ var HTTP_PROBE_PROVIDERS = /* @__PURE__ */ new Set([
11997
11997
  // CS-1863: Storrito, added with the integration. A deleted API credential
11998
11998
  // answers with a redirect to the login page rather than a 401, so without a
11999
11999
  // probe a dead token would surface only as failed story posts.
12000
- "storrito"
12000
+ "storrito",
12001
+ // CS-1972: Botify, added with the integration. A Botify API token never
12002
+ // expires on its own - it dies when a user regenerates it or leaves - and the
12003
+ // integration is read-only, so without a probe a dead token would surface
12004
+ // only as failed queries. Routes to `probeBotify` against the install's
12005
+ // `GET /projects/{username}`.
12006
+ "botify"
12001
12007
  // ENG-6100: GitHub is deliberately NOT here. This set drives the ASYNC
12002
12008
  // connectivity monitor's routing, where github (source_type='native')
12003
12009
  // stays host-side (cli_command — `gh`, the credential the agent actually
@@ -12571,10 +12577,64 @@ async function probeStorrito(creds, fetchImpl, config) {
12571
12577
  return networkOutcome(err, String(token));
12572
12578
  }
12573
12579
  }
12580
+ var BOTIFY_SLUG_RE = /^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$/;
12581
+ async function probeBotify(creds, fetchImpl, config) {
12582
+ const token = creds.api_key ?? creds.access_token;
12583
+ if (!token)
12584
+ return { status: "down", message: "No credential present" };
12585
+ const username = typeof config?.["username"] === "string" ? config["username"].trim() : "";
12586
+ if (!BOTIFY_SLUG_RE.test(username)) {
12587
+ return {
12588
+ status: "down",
12589
+ message: "Botify username is missing or invalid - set it on the install (the first part of app.botify.com/<username>/<project>)"
12590
+ };
12591
+ }
12592
+ try {
12593
+ const res = await timedFetch(fetchImpl, `https://api.botify.com/v1/projects/${encodeURIComponent(username)}?size=1`, { headers: { Authorization: `Token ${token}`, Accept: "application/json" } });
12594
+ if (res.status === 401) {
12595
+ return {
12596
+ status: "down",
12597
+ cause: "auth_rejected",
12598
+ message: "Botify rejected the token (401) - it was regenerated, mistyped or its user was removed"
12599
+ };
12600
+ }
12601
+ if (res.status === 403 || res.status === 404) {
12602
+ return {
12603
+ status: "degraded",
12604
+ cause: "auth_rejected",
12605
+ message: `Botify accepted the token but cannot show account "${username}" (${res.status}) - check the install's username and that the token's user can see that account`
12606
+ };
12607
+ }
12608
+ if (!res.ok) {
12609
+ const message = res.status === 429 ? rateLimitMessage("Botify", res.status) : `Botify API returned ${res.status}`;
12610
+ return { status: statusForHttp(res.status), cause: causeForHttp(res.status), message };
12611
+ }
12612
+ let body = null;
12613
+ try {
12614
+ body = await res.json();
12615
+ } catch {
12616
+ body = null;
12617
+ }
12618
+ if (!Array.isArray(body?.results)) {
12619
+ return { status: "down", message: "Botify returned 200 without a project list - not a Botify API response" };
12620
+ }
12621
+ if (body.results.length === 0) {
12622
+ return {
12623
+ status: "degraded",
12624
+ message: `Connected to Botify, but account "${username}" has no active project this token can see`
12625
+ };
12626
+ }
12627
+ return { status: "ok", message: `Connected to Botify (account ${username})` };
12628
+ } catch (err) {
12629
+ return networkOutcome(err, String(token));
12630
+ }
12631
+ }
12574
12632
  async function probeHttpProvider(definitionId, credentials, fetchImpl = fetch, config) {
12575
12633
  switch (definitionId) {
12576
12634
  case "storrito":
12577
12635
  return probeStorrito(credentials, fetchImpl, config);
12636
+ case "botify":
12637
+ return probeBotify(credentials, fetchImpl, config);
12578
12638
  case "linear":
12579
12639
  return probeLinear(credentials, fetchImpl);
12580
12640
  case "buffer":
@@ -16385,4 +16445,4 @@ export {
16385
16445
  peekCurrentSession,
16386
16446
  readDailySessionPin
16387
16447
  };
16388
- //# sourceMappingURL=chunk-EAXTNN24.js.map
16448
+ //# sourceMappingURL=chunk-KEMDLWTE.js.map