@integrity-labs/agt-cli 0.28.936 → 0.28.938
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 +3 -3
- package/dist/{chunk-LN64VNHI.js → chunk-HEXKSBBV.js} +78 -11
- package/dist/{chunk-LN64VNHI.js.map → chunk-HEXKSBBV.js.map} +1 -1
- package/dist/lib/manager-worker.js +26 -2
- package/dist/lib/manager-worker.js.map +1 -1
- package/dist/mcp/slack-channel.js +44 -6
- package/package.json +1 -1
package/dist/bin/agt.js
CHANGED
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
success,
|
|
41
41
|
table,
|
|
42
42
|
warn
|
|
43
|
-
} from "../chunk-
|
|
43
|
+
} from "../chunk-HEXKSBBV.js";
|
|
44
44
|
import {
|
|
45
45
|
getProjectDir,
|
|
46
46
|
isSessionResumeDisabled,
|
|
@@ -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.
|
|
5470
|
+
var cliVersion = true ? "0.28.938" : "dev";
|
|
5471
5471
|
async function fetchLatestVersion() {
|
|
5472
5472
|
const host2 = getHost();
|
|
5473
5473
|
if (!host2) return null;
|
|
@@ -6727,7 +6727,7 @@ function handleError(err) {
|
|
|
6727
6727
|
}
|
|
6728
6728
|
|
|
6729
6729
|
// src/bin/agt.ts
|
|
6730
|
-
var cliVersion2 = true ? "0.28.
|
|
6730
|
+
var cliVersion2 = true ? "0.28.938" : "dev";
|
|
6731
6731
|
var program = new Command();
|
|
6732
6732
|
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");
|
|
6733
6733
|
program.hook("preAction", async (thisCommand, actionCommand) => {
|
|
@@ -6965,7 +6965,7 @@ function exchangeFailureKind(err) {
|
|
|
6965
6965
|
}
|
|
6966
6966
|
|
|
6967
6967
|
// src/lib/api-client.ts
|
|
6968
|
-
var agtCliVersion = true ? "0.28.
|
|
6968
|
+
var agtCliVersion = true ? "0.28.938" : "dev";
|
|
6969
6969
|
var lastConfigHash = null;
|
|
6970
6970
|
function setConfigHash(hash) {
|
|
6971
6971
|
lastConfigHash = hash && hash.length > 0 ? hash : null;
|
|
@@ -9203,18 +9203,35 @@ var TRANSIENT_SIGNATURES = [
|
|
|
9203
9203
|
// Google's quota wording do not use the number at all.
|
|
9204
9204
|
{
|
|
9205
9205
|
re: new RegExp(`${STATUS_CTX}429\\b|too many requests|rate limit|secondary rate|quota exceeded|abuse detection`, "i"),
|
|
9206
|
-
reason: "rate limited by the provider"
|
|
9206
|
+
reason: "rate limited by the provider",
|
|
9207
|
+
// BEHAVIOUR CHANGE, and it is the point rather than a side effect.
|
|
9208
|
+
// `rate_limited` is one of the two `isVendorSideCause` members, so
|
|
9209
|
+
// `isTransientStreakPermanent` stops promoting a long 429 streak to the
|
|
9210
|
+
// hard-down path. That is exactly what ENG-9173 asked for: "59 consecutive
|
|
9211
|
+
// Buffer 429s paged at CRITICAL, next to genuinely actionable criticals,
|
|
9212
|
+
// naming no action at all, because nobody can un-429 a vendor." Until now
|
|
9213
|
+
// the cause arrived as `unknown`, which is NOT vendor-side, so the
|
|
9214
|
+
// suppression that ticket built could never fire on this lane.
|
|
9215
|
+
cause: "rate_limited"
|
|
9207
9216
|
},
|
|
9208
9217
|
// Vendor-side server errors. Anchored on the phrase or on an explicit
|
|
9209
9218
|
// HTTP-status context so a bare 3-digit number cannot match.
|
|
9210
9219
|
{
|
|
9211
9220
|
re: new RegExp(`${STATUS_CTX}(?:502|503|504)\\b|bad gateway|service unavailable|gateway time-?out|internal server error|server error \\(5\\d\\d\\)`, "i"),
|
|
9212
|
-
reason: "provider returned a server error"
|
|
9221
|
+
reason: "provider returned a server error",
|
|
9222
|
+
// Also vendor-side, same consequence as above and for the same reason:
|
|
9223
|
+
// "the vendor returned 5xx — their fault, ours to watch."
|
|
9224
|
+
cause: "server_error"
|
|
9213
9225
|
},
|
|
9214
9226
|
// Transport. The provider may be fine and simply unreachable from here.
|
|
9215
9227
|
{
|
|
9216
9228
|
re: /ECONNREFUSED|ECONNRESET|ETIMEDOUT|ENOTFOUND|EAI_AGAIN|EHOSTUNREACH|ENETUNREACH|connection refused|connection reset|network is unreachable|temporary failure in name resolution|tls handshake|dial tcp/i,
|
|
9217
|
-
reason: "network failure reaching the provider"
|
|
9229
|
+
reason: "network failure reaching the provider",
|
|
9230
|
+
// NOT vendor-side, so escalation is unchanged here — `unreachable` "may be
|
|
9231
|
+
// US, which is why it counts as actionable". Naming it changes what an
|
|
9232
|
+
// operator READS, not whether they are told. Same call `networkOutcome`
|
|
9233
|
+
// made for the HTTP lane.
|
|
9234
|
+
cause: "unreachable"
|
|
9218
9235
|
},
|
|
9219
9236
|
// OUR failure, not the credential's. ENG-8344 fetches the token per use
|
|
9220
9237
|
// through the platform, so an identity-tier outage surfaces here as a
|
|
@@ -9224,14 +9241,56 @@ var TRANSIENT_SIGNATURES = [
|
|
|
9224
9241
|
{
|
|
9225
9242
|
re: /credential fetch failed|key exchange failed|host\/exchange|upstream connect error|could not read Username/i,
|
|
9226
9243
|
reason: "our credential broker could not supply a token"
|
|
9244
|
+
// DELIBERATELY UNCAUSED — the one entry in this table with no `cause`, and
|
|
9245
|
+
// it is a decision, not an oversight. Nothing in the closed vocabulary
|
|
9246
|
+
// describes "our own broker failed":
|
|
9247
|
+
// - `auth_rejected` is actively wrong. It means the CUSTOMER'S credential
|
|
9248
|
+
// was refused, and its remedy is "reconnect" — telling a customer to
|
|
9249
|
+
// re-auth a working token during OUR outage is precisely the 2026-08-14
|
|
9250
|
+
// fleet-wide misfire this signature was written to prevent.
|
|
9251
|
+
// - `server_error` means THE VENDOR returned 5xx, and it is vendor-side,
|
|
9252
|
+
// so it would SUPPRESS escalation of an outage that is ours and that we
|
|
9253
|
+
// most want to be woken for.
|
|
9254
|
+
// - `unreachable` is a network fact about the provider; the broker is
|
|
9255
|
+
// reachable and answering, just not with a token.
|
|
9256
|
+
// So the honest value is `unknown`, which stays actionable, and a wrong
|
|
9257
|
+
// cause is worse than no cause because it sends an operator somewhere
|
|
9258
|
+
// specific. Fixing this properly needs a new enum member (a `broker_*`
|
|
9259
|
+
// cause), which is a schema decision and is out of scope here.
|
|
9227
9260
|
}
|
|
9228
9261
|
];
|
|
9229
|
-
function
|
|
9230
|
-
for (const { re, reason } of TRANSIENT_SIGNATURES) {
|
|
9231
|
-
if (re.test(text)) return reason;
|
|
9262
|
+
function transientSignatureFor(text) {
|
|
9263
|
+
for (const { re, reason, cause } of TRANSIENT_SIGNATURES) {
|
|
9264
|
+
if (re.test(text)) return cause ? { reason, cause } : { reason };
|
|
9232
9265
|
}
|
|
9233
9266
|
return null;
|
|
9234
9267
|
}
|
|
9268
|
+
var DOWN_SIGNATURES = [
|
|
9269
|
+
{
|
|
9270
|
+
// MEASURED, not imagined. Captured 2026-09-16 from `gh api user` on this
|
|
9271
|
+
// host against a GitHub App token lacking the permission:
|
|
9272
|
+
// {"message":"Resource not accessible by integration", … "status":"403"}
|
|
9273
|
+
// gh: Resource not accessible by integration (HTTP 403)
|
|
9274
|
+
// A 403 that is not throttling — the rate-limit signature is checked first
|
|
9275
|
+
// and owns the throttling 403s, so reaching here means it is not one.
|
|
9276
|
+
//
|
|
9277
|
+
// The rest are GitHub's and git's own refusal wording. `Bad credentials` is
|
|
9278
|
+
// the literal body of GitHub's 401; the "not logged into any … hosts"
|
|
9279
|
+
// sentence is `gh auth status`'s, and is already pinned as a `down` case in
|
|
9280
|
+
// eng-5463-cli-probe-transient.test.ts.
|
|
9281
|
+
re: new RegExp(
|
|
9282
|
+
`resource not accessible by integration|bad credentials|not logged into any\\b[^\\n]*\\bhosts|requires authentication|authentication failed|invalid authentication|${STATUS_CTX}401\\b|unauthorized\\b`,
|
|
9283
|
+
"i"
|
|
9284
|
+
),
|
|
9285
|
+
cause: "auth_rejected"
|
|
9286
|
+
}
|
|
9287
|
+
];
|
|
9288
|
+
function downCauseFor(text) {
|
|
9289
|
+
for (const { re, cause } of DOWN_SIGNATURES) {
|
|
9290
|
+
if (re.test(text)) return cause;
|
|
9291
|
+
}
|
|
9292
|
+
return void 0;
|
|
9293
|
+
}
|
|
9235
9294
|
var DID_NOT_RUN_SIGNATURES = [
|
|
9236
9295
|
{
|
|
9237
9296
|
re: /the real \S+ binary is not on PATH|only the Augmented shim is/i,
|
|
@@ -9433,7 +9492,11 @@ function runCliProbe(binary, args, opts = {}) {
|
|
|
9433
9492
|
return;
|
|
9434
9493
|
}
|
|
9435
9494
|
if (e.killed || e.signal === "SIGTERM") {
|
|
9436
|
-
resolve({
|
|
9495
|
+
resolve({
|
|
9496
|
+
status: "transient_error",
|
|
9497
|
+
cause: "unreachable",
|
|
9498
|
+
message: `${binary} probe timed out after ${timeoutMs / 1e3}s`
|
|
9499
|
+
});
|
|
9437
9500
|
return;
|
|
9438
9501
|
}
|
|
9439
9502
|
const diagnostic = `${stderr ?? ""}
|
|
@@ -9453,16 +9516,20 @@ ${e.message}`;
|
|
|
9453
9516
|
});
|
|
9454
9517
|
return;
|
|
9455
9518
|
}
|
|
9456
|
-
const transient =
|
|
9519
|
+
const transient = transientSignatureFor(diagnostic);
|
|
9457
9520
|
if (transient) {
|
|
9458
9521
|
resolve({
|
|
9459
9522
|
status: "transient_error",
|
|
9460
|
-
|
|
9523
|
+
// ENG-10529: present only when the matched signature carries one.
|
|
9524
|
+
// The broker entry deliberately carries none — see its comment.
|
|
9525
|
+
...transient.cause ? { cause: transient.cause } : {},
|
|
9526
|
+
message: `${binary} probe inconclusive \u2014 ${transient.reason}: ${firstMeaningfulLine(stderr, stdout, e.message)}`
|
|
9461
9527
|
});
|
|
9462
9528
|
return;
|
|
9463
9529
|
}
|
|
9464
9530
|
resolve({
|
|
9465
9531
|
status: "down",
|
|
9532
|
+
.../* @__PURE__ */ ((c) => c ? { cause: c } : {})(downCauseFor(diagnostic)),
|
|
9466
9533
|
message: `${binary} exited non-zero: ${firstMeaningfulLine(stderr, stdout, e.message)}`
|
|
9467
9534
|
});
|
|
9468
9535
|
}
|
|
@@ -11590,4 +11657,4 @@ export {
|
|
|
11590
11657
|
managerInstallSystemUnitCommand,
|
|
11591
11658
|
managerUninstallSystemUnitCommand
|
|
11592
11659
|
};
|
|
11593
|
-
//# sourceMappingURL=chunk-
|
|
11660
|
+
//# sourceMappingURL=chunk-HEXKSBBV.js.map
|