@agentsky/sky 3.48.2 → 3.49.0

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 (35) hide show
  1. package/dist/{chunk-W24YSGH4.js → chunk-2YUZZ5VG.js} +7 -856
  2. package/dist/{chunk-ZRV3UUW5.js → chunk-6LRSRXQI.js} +1 -1
  3. package/dist/{chunk-PGX3AGCZ.js → chunk-7JFTEJ7B.js} +1 -1
  4. package/dist/chunk-BKNZQZZD.js +857 -0
  5. package/dist/{chunk-RKMMLSGJ.js → chunk-CK7N635F.js} +1 -1
  6. package/dist/{chunk-NAIYHS6Q.js → chunk-HFWHVU72.js} +2 -1
  7. package/dist/{chunk-A45NGV2Q.js → chunk-HGL7TLNA.js} +2 -2
  8. package/dist/{chunk-ZF2P6PKM.js → chunk-HNUY5PBQ.js} +2 -2
  9. package/dist/{chunk-OJ5ERABF.js → chunk-IO2N34S2.js} +1 -1
  10. package/dist/{chunk-UJS4JIE2.js → chunk-JMGVHVOS.js} +10 -10
  11. package/dist/{chunk-CV2ZRIF7.js → chunk-QTE5OMZY.js} +4 -4
  12. package/dist/{chunk-FVIPGI3E.js → chunk-RVI7ZWR2.js} +5 -5
  13. package/dist/chunk-TGU7T4O7.js +1363 -0
  14. package/dist/{chunk-NJPIE762.js → chunk-UYBKORXA.js} +43 -24
  15. package/dist/chunk-YO2XUCCF.js +30 -0
  16. package/dist/{chunk-6D36IT7T.js → chunk-ZOXE2XNH.js} +2 -2
  17. package/dist/{compute-AERPKXJ3.js → compute-4MMGFJGE.js} +2 -2
  18. package/dist/{compute-report-CTT4WBSQ.js → compute-report-LIMMRQY3.js} +15 -13
  19. package/dist/grok-bot-export-7LSTXWJW.js +57 -0
  20. package/dist/index.js +599 -1770
  21. package/dist/{local-skills-E56TR7O6.js → local-skills-5LJST7EP.js} +3 -3
  22. package/dist/{local-skills-run-TST44QSA.js → local-skills-run-6SZJQSVF.js} +9 -9
  23. package/dist/{mcp-register-HDOVT4QT.js → mcp-register-XY4MR3ZZ.js} +3 -3
  24. package/dist/{mcp-serve-2LBAEAJX.js → mcp-serve-QROKKUJV.js} +6 -6
  25. package/dist/{trace-S2XZC75N.js → trace-SJZ25T35.js} +4 -3
  26. package/dist/{trace-exclusions-JEGMUPWQ.js → trace-exclusions-IC6OA2ND.js} +3 -2
  27. package/dist/trace-handoff-CD5LOS7B.js +116 -0
  28. package/dist/{trace-library-HN5TU5EJ.js → trace-library-V23TEXG4.js} +14 -8
  29. package/dist/trace-privacy-DU3TL5EO.js +11 -0
  30. package/package.json +1 -1
  31. package/vendor/trace-collect/SOURCE.json +2 -1
  32. package/vendor/trace-collect/sources/_pii.mjs +56 -0
  33. package/vendor/trace-collect/sources/grok-bot.mjs +180 -0
  34. package/vendor/trace-collect/sources/index.mjs +4 -2
  35. package/vendor/trace-collect/sources/muse-agent.mjs +95 -0
@@ -1,3 +1,6 @@
1
+ import {
2
+ redactPlainText
3
+ } from "./chunk-BKNZQZZD.js";
1
4
  import {
2
5
  __export
3
6
  } from "./chunk-MLKGABMK.js";
@@ -1233,856 +1236,6 @@ function reasoningEffortDocLine() {
1233
1236
  return `${harness2}; models: ${models}`;
1234
1237
  }
1235
1238
 
1236
- // ../../packages/spec/src/import-base64.ts
1237
- function isCanonicalBase64(value) {
1238
- if (value.length === 0 || value.length % 4 !== 0) return false;
1239
- const padding = value.endsWith("==") ? 2 : value.endsWith("=") ? 1 : 0;
1240
- for (let index = 0; index < value.length - padding; index += 1) {
1241
- const code = value.charCodeAt(index);
1242
- const alphabet = code >= 65 && code <= 90 || code >= 97 && code <= 122 || code >= 48 && code <= 57 || code === 43 || code === 47;
1243
- if (!alphabet) return false;
1244
- }
1245
- return Buffer.from(value, "base64").toString("base64") === value;
1246
- }
1247
-
1248
- // ../../packages/spec/src/card-scrub.ts
1249
- var CARD_NUMBER_MASK = "[card number]";
1250
- var CARD_CODE_MASK = "[card code]";
1251
- var DIGIT_RUN = /(?<![\d])(?:\d[ -]?){12,18}\d(?![\d])/g;
1252
- var CODE_FIELD = /\b(cvc|cvv|cvc2|cvv2|security[ _-]?code|card[ _-]?code)\b(["']?\s*[:=]\s*["']?)(\d{3,4})\b/gi;
1253
- function luhnValid(digits) {
1254
- let sum = 0;
1255
- let double = false;
1256
- for (let i = digits.length - 1; i >= 0; i -= 1) {
1257
- let d = digits.charCodeAt(i) - 48;
1258
- if (d < 0 || d > 9) return false;
1259
- if (double) {
1260
- d *= 2;
1261
- if (d > 9) d -= 9;
1262
- }
1263
- sum += d;
1264
- double = !double;
1265
- }
1266
- return digits.length >= 13 && sum % 10 === 0;
1267
- }
1268
- var digitsOf = (run) => run.replace(/[ -]/g, "");
1269
- function isCardNumber(run, known) {
1270
- const digits = digitsOf(run);
1271
- return known.has(digits) || luhnValid(digits);
1272
- }
1273
- function scrubCardData(text, known = []) {
1274
- const knownDigits = new Set([...known].map(digitsOf));
1275
- return text.replace(DIGIT_RUN, (run) => isCardNumber(run, knownDigits) ? CARD_NUMBER_MASK : run).replace(CODE_FIELD, (_all, label, sep) => `${label}${sep}${CARD_CODE_MASK}`);
1276
- }
1277
- function holdsCardNumber(text, known = []) {
1278
- const knownDigits = new Set([...known].map(digitsOf));
1279
- for (const match of text.matchAll(DIGIT_RUN)) if (isCardNumber(match[0], knownDigits)) return true;
1280
- return false;
1281
- }
1282
-
1283
- // ../../packages/spec/src/import-redact.ts
1284
- function ci(word) {
1285
- return word.split("").map((c) => /[a-z]/i.test(c) ? `[${c.toUpperCase()}${c.toLowerCase()}]` : c).join("");
1286
- }
1287
- var UnsafeImportError = class extends Error {
1288
- };
1289
- var TEXT_ATTACHMENT_MEDIA_TYPES = [
1290
- "application/json",
1291
- "application/xml",
1292
- "application/javascript",
1293
- "application/ecmascript",
1294
- "application/x-javascript",
1295
- "application/yaml",
1296
- "application/x-yaml",
1297
- "application/x-www-form-urlencoded",
1298
- "image/svg+xml",
1299
- "application/toml",
1300
- "application/x-toml",
1301
- "application/sql",
1302
- "application/x-sql",
1303
- "application/pem-certificate-chain",
1304
- "application/x-pem-file",
1305
- "application/x-pem-key",
1306
- "application/x-ndjson",
1307
- "application/ndjson"
1308
- ];
1309
- var textAttachmentMediaTypes = new Set(TEXT_ATTACHMENT_MEDIA_TYPES);
1310
- function isTextMediaType(value) {
1311
- const media = typeof value === "string" ? value.split(";", 1)[0].trim().toLowerCase() : "";
1312
- return media.startsWith("text/") || textAttachmentMediaTypes.has(media) || /\+(?:json|xml)$/.test(media);
1313
- }
1314
- var MASK = "\u25CF\u25CF\u25CF\u25CF\u25CF";
1315
- var SECRET_PATTERNS = [
1316
- { name: "anthropic key", source: "(?<![A-Za-z0-9_])(sk-ant-)[A-Za-z0-9_-]{10,}", replacement: `\\1${MASK}` },
1317
- { name: "openai key", source: "(?<![A-Za-z0-9_])(sk-proj-|sk-)[A-Za-z0-9_-]{8,}", replacement: `\\1${MASK}` },
1318
- { name: "github token", source: "(?<![A-Za-z0-9_])(gh[pousr]_)[A-Za-z0-9]{16,}", replacement: `\\1${MASK}` },
1319
- { name: "github fine-grained token", source: "(?<![A-Za-z0-9_])(github_pat_)[A-Za-z0-9_]{20,}", replacement: `\\1${MASK}` },
1320
- { name: "slack token", source: "(?<![A-Za-z0-9_])(xox[abeprs]-|xapp-)[A-Za-z0-9-]{10,}", replacement: `\\1${MASK}` },
1321
- { name: "agentsky token", source: "(?<![A-Za-z0-9_])(ast_)[A-Za-z0-9_-]{10,}", replacement: `\\1${MASK}` },
1322
- { name: "guild broker token", source: "(?<![A-Za-z0-9_])(gbk_)[A-Za-z0-9_-]{10,}", replacement: `\\1${MASK}` },
1323
- { name: "jwt", source: "(?<![A-Za-z0-9_])eyJ[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]*", replacement: MASK },
1324
- { name: "private key", source: "-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----[\\s\\S]*?(?:-----END [A-Z0-9 ]*PRIVATE KEY-----|$)", replacement: MASK },
1325
- { name: "google oauth token", source: "(ya29\\.)[A-Za-z0-9_-]{20,}", replacement: `\\1${MASK}` },
1326
- { name: "google api key", source: "(?<![A-Za-z0-9_])(AIza)[A-Za-z0-9_-]{30,}", replacement: `\\1${MASK}` },
1327
- { name: "aws key id", source: "(?<![A-Za-z0-9_])(AKIA)[0-9A-Z]{16}(?![A-Za-z0-9_])", replacement: `\\1${MASK}` },
1328
- { name: "import key", source: "(agt_)[A-Za-z0-9_-]{20,}", replacement: `\\1${MASK}` },
1329
- {
1330
- name: "database url",
1331
- source: "(postgres://|postgresql://|mysql://|mongodb\\+srv://|mongodb://|redis://)([^:@/ ]+):[^@ ]+@",
1332
- replacement: `\\1\\2:${MASK}@`
1333
- },
1334
- { name: "bearer header", source: `(?<![A-Za-z0-9_])(${ci("bearer")}\\s+)[A-Za-z0-9._~+/=-]{16,}`, replacement: `\\1${MASK}` },
1335
- { name: "api key header", source: `(${ci("x-api-key")}: )[A-Za-z0-9_.=-]{16,}`, replacement: `\\1${MASK}` }
1336
- ];
1337
- var compiled = SECRET_PATTERNS.map((p) => ({
1338
- name: p.name,
1339
- re: new RegExp(p.source, "g"),
1340
- replacement: p.replacement.replace(/\\(\d)/g, "$$$1")
1341
- }));
1342
- function asPlainDecimal(token) {
1343
- const m = /^([+-]?)(\d+)(?:\.(\d*))?(?:[eE]([+-]?\d+))?$/.exec(token);
1344
- if (!m) return null;
1345
- const [, sign, whole, fraction = "", exponent = "0"] = m;
1346
- const digits = whole + fraction;
1347
- if (Math.abs(Number(exponent)) > 400) return /[1-9]/.test(digits) ? null : "0";
1348
- let pointAt = whole.length + Number(exponent);
1349
- let padded = digits;
1350
- if (pointAt <= 0) {
1351
- padded = "0".repeat(1 - pointAt) + digits;
1352
- pointAt += 1 - pointAt;
1353
- }
1354
- if (pointAt >= padded.length) padded += "0".repeat(pointAt - padded.length + 1);
1355
- const intPart = padded.slice(0, pointAt).replace(/^0+(?=\d)/, "");
1356
- const fracPart = padded.slice(pointAt).replace(/0+$/, "");
1357
- const value = fracPart ? `${intPart}.${fracPart}` : intPart;
1358
- return (sign === "-" && /[1-9]/.test(digits) ? "-" : "") + value;
1359
- }
1360
- function changesWhenRead(token) {
1361
- const value = Number(token);
1362
- if (!Number.isFinite(value)) return true;
1363
- const mine = asPlainDecimal(token);
1364
- const theirs = asPlainDecimal(String(value));
1365
- if (mine === null) return /[1-9]/.test(token);
1366
- if (theirs === null) return true;
1367
- return mine !== theirs;
1368
- }
1369
- function unsafeNumberSpans(line) {
1370
- const spans = [];
1371
- let inString = false;
1372
- for (let i = 0; i < line.length; i += 1) {
1373
- const c = line[i];
1374
- if (inString) {
1375
- if (c === "\\") i += 1;
1376
- else if (c === '"') inString = false;
1377
- continue;
1378
- }
1379
- if (c === '"') {
1380
- inString = true;
1381
- continue;
1382
- }
1383
- if (c !== "-" && (c < "0" || c > "9")) continue;
1384
- const start = i;
1385
- if (c === "-") i += 1;
1386
- while (i < line.length && line[i] >= "0" && line[i] <= "9") i += 1;
1387
- if (line[i] === ".") {
1388
- i += 1;
1389
- while (i < line.length && line[i] >= "0" && line[i] <= "9") i += 1;
1390
- }
1391
- if (line[i] === "e" || line[i] === "E") {
1392
- i += 1;
1393
- if (line[i] === "+" || line[i] === "-") i += 1;
1394
- while (i < line.length && line[i] >= "0" && line[i] <= "9") i += 1;
1395
- }
1396
- const token = line.slice(start, i);
1397
- if (changesWhenRead(token)) spans.push([start, i]);
1398
- i -= 1;
1399
- }
1400
- return spans;
1401
- }
1402
- function withPreservedNumbers(line) {
1403
- const spans = unsafeNumberSpans(line);
1404
- if (spans.length === 0) return { parse: () => JSON.parse(line), serialize: (v) => JSON.stringify(v) };
1405
- let sentinel = "n";
1406
- while (line.includes(`@@${sentinel}`)) sentinel += "n";
1407
- const token = (index) => `@@${sentinel}${index}@@`;
1408
- let out = "";
1409
- let cursor = 0;
1410
- const originals = [];
1411
- spans.forEach(([start, end], index) => {
1412
- out += line.slice(cursor, start) + JSON.stringify(token(index));
1413
- originals.push(line.slice(start, end));
1414
- cursor = end;
1415
- });
1416
- out += line.slice(cursor);
1417
- return {
1418
- parse: () => JSON.parse(out),
1419
- serialize: (value) => {
1420
- let text = JSON.stringify(value);
1421
- originals.forEach((original, index) => {
1422
- text = text.split(JSON.stringify(token(index))).join(original);
1423
- });
1424
- return text;
1425
- }
1426
- };
1427
- }
1428
- function hasDuplicateJsonKeys(line) {
1429
- const stack = [];
1430
- const skipSpace = (at) => {
1431
- while (at < line.length && /\s/.test(line[at])) at += 1;
1432
- return at;
1433
- };
1434
- for (let i = 0; i < line.length; i += 1) {
1435
- const c = line[i];
1436
- if (c === '"') {
1437
- const start = i;
1438
- i += 1;
1439
- while (i < line.length) {
1440
- if (line[i] === "\\") {
1441
- i += 2;
1442
- continue;
1443
- }
1444
- if (line[i] === '"') break;
1445
- i += 1;
1446
- }
1447
- const frame = stack[stack.length - 1];
1448
- const colon = skipSpace(i + 1);
1449
- if (frame?.kind === "object" && frame.expectingKey && line[colon] === ":") {
1450
- try {
1451
- const key = JSON.parse(line.slice(start, i + 1));
1452
- if (frame.keys.has(key)) return true;
1453
- frame.keys.add(key);
1454
- frame.expectingKey = false;
1455
- } catch {
1456
- }
1457
- }
1458
- continue;
1459
- }
1460
- if (c === "{") stack.push({ kind: "object", expectingKey: true, keys: /* @__PURE__ */ new Set() });
1461
- else if (c === "[") stack.push({ kind: "array", expectingKey: false });
1462
- else if (c === "}" || c === "]") stack.pop();
1463
- else if (c === "," && stack.at(-1)?.kind === "object") stack.at(-1).expectingKey = true;
1464
- }
1465
- return false;
1466
- }
1467
- var FIELD_ASSIGNMENTS = new RegExp(
1468
- String.raw`(?<![A-Za-z0-9_.])(\\{0,8}["']?([A-Za-z_][A-Za-z0-9_.-]{0,255})\\{0,8}["']?\s{0,8}\\{0,8}[:=]\\{0,8}\s{0,8}\\{0,8}(["']?))`,
1469
- "g"
1470
- );
1471
- var JSON_NUMBER = /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;
1472
- var COMPLETE_MASKED_VALUE = new RegExp(`^(?:${MASK}|${ci("bearer")} ${MASK})$`);
1473
- function codeIdentifierEnd(value, at) {
1474
- if (!/[A-Za-z_$]/.test(value[at] ?? "")) return -1;
1475
- at += 1;
1476
- while (/[A-Za-z0-9_$]/.test(value[at] ?? "")) at += 1;
1477
- return at;
1478
- }
1479
- function codeGroupEnd(value, at) {
1480
- const pairs = { "(": ")", "[": "]", "{": "}" };
1481
- const stack = [pairs[value[at]]];
1482
- for (let i = at + 1; i < value.length; i += 1) {
1483
- const c = value[i];
1484
- if (c === '"' || c === "'" || c === "`") {
1485
- for (i += 1; i < value.length; i += 1) {
1486
- if (value[i] === "\\") i += 1;
1487
- else if (value[i] === c) break;
1488
- }
1489
- if (i >= value.length) return -1;
1490
- continue;
1491
- }
1492
- if (pairs[c]) stack.push(pairs[c]);
1493
- else if (c === ")" || c === "]" || c === "}") {
1494
- if (stack.pop() !== c) return -1;
1495
- if (stack.length === 0) return i + 1;
1496
- }
1497
- }
1498
- return -1;
1499
- }
1500
- function credentialRhsBoundary(value, start, lineEnd) {
1501
- const pairs = { "(": ")", "[": "]", "{": "}" };
1502
- const stack = [];
1503
- for (let i = start; i < lineEnd; i += 1) {
1504
- const c = value[i];
1505
- if (c === '"' || c === "'" || c === "`") {
1506
- for (i += 1; i < lineEnd; i += 1) {
1507
- if (value[i] === "\\") i += 1;
1508
- else if (value[i] === c) break;
1509
- }
1510
- if (i >= lineEnd) return { end: lineEnd, unsafe: true };
1511
- continue;
1512
- }
1513
- if (c === "/") return { end: lineEnd, unsafe: true };
1514
- if (pairs[c]) stack.push(pairs[c]);
1515
- else if (c === ")" || c === "]" || c === "}") {
1516
- if (stack.pop() !== c) return { end: lineEnd, unsafe: true };
1517
- }
1518
- }
1519
- return { end: lineEnd, unsafe: stack.length > 0 };
1520
- }
1521
- function maskExpressionLiterals(value) {
1522
- let out = "";
1523
- const groups = [];
1524
- let previousNonWhitespace = "";
1525
- for (let i = 0; i < value.length; i += 1) {
1526
- const c = value[i];
1527
- if (c === "(" || c === "{") {
1528
- groups.push(c);
1529
- out += c;
1530
- previousNonWhitespace = c;
1531
- continue;
1532
- }
1533
- if (c === "[") {
1534
- let kind = /[A-Za-z0-9_$.)\]}]/.test(previousNonWhitespace) ? "index" : "array";
1535
- if (kind === "index") {
1536
- const end = codeGroupEnd(value, i);
1537
- if (end < 0) return null;
1538
- const content = value.slice(i + 1, end - 1).trim();
1539
- if (/^[-+.0-9]/.test(content) && !/^(?:0|[1-9][0-9]*)$/.test(content)) return null;
1540
- if (/^(?:0|[1-9][0-9]*)$/.test(content)) kind = "index-number";
1541
- }
1542
- groups.push(kind);
1543
- out += c;
1544
- previousNonWhitespace = c;
1545
- continue;
1546
- }
1547
- if (c === ")" || c === "]" || c === "}") {
1548
- groups.pop();
1549
- out += c;
1550
- previousNonWhitespace = c;
1551
- continue;
1552
- }
1553
- const previousIsIdentifier = i > 0 && /[A-Za-z0-9_$]/.test(value[i - 1]);
1554
- const numberLooking = !previousIsIdentifier && (/[0-9]/.test(c) || c === "." && /[0-9]/.test(value[i + 1] ?? "") || (c === "+" || c === "-") && (/[0-9]/.test(value[i + 1] ?? "") || value[i + 1] === "." && /[0-9]/.test(value[i + 2] ?? "")));
1555
- if (numberLooking && groups.at(-1) !== "index-number") return null;
1556
- if (c !== '"' && c !== "'" && c !== "`") {
1557
- out += c;
1558
- if (!/\s/.test(c)) previousNonWhitespace = c;
1559
- continue;
1560
- }
1561
- const start = i;
1562
- for (i += 1; i < value.length; i += 1) {
1563
- if (value[i] === "\\") i += 1;
1564
- else if (value[i] === c) break;
1565
- }
1566
- const literal2 = value.slice(start, i + 1);
1567
- out += groups.at(-1)?.startsWith("index") ? literal2 : `${c}${MASK}${c}`;
1568
- previousNonWhitespace = c;
1569
- }
1570
- return out;
1571
- }
1572
- function rewriteCodeExpression(value, declaration) {
1573
- let source = value.trim();
1574
- const semicolon = source.endsWith(";");
1575
- if (semicolon) source = source.slice(0, -1).trimEnd();
1576
- if (/^(?:null|undefined)$/.test(source)) return value;
1577
- if (source.startsWith("`")) {
1578
- if (codeGroupEnd(`(${source})`, 0) !== source.length + 2) return null;
1579
- return value.replace(source, `\`${MASK}\``);
1580
- }
1581
- const awaitPrefix = /^await\s+/.exec(source)?.[0] ?? "";
1582
- if (awaitPrefix) source = source.slice(awaitPrefix.length);
1583
- if (source.startsWith("[") || source.startsWith("{")) {
1584
- if (codeGroupEnd(source, 0) !== source.length) return null;
1585
- const full2 = semicolon ? `${MASK};` : MASK;
1586
- return value.replace(value.trim(), full2);
1587
- }
1588
- let at = codeIdentifierEnd(source, 0);
1589
- if (at < 0) return null;
1590
- let syntax = false;
1591
- while (at < source.length) {
1592
- if (source.startsWith("?.", at)) {
1593
- at += 2;
1594
- if (source[at] === "[" || source[at] === "(") {
1595
- const end2 = codeGroupEnd(source, at);
1596
- if (end2 < 0) return null;
1597
- syntax = true;
1598
- at = end2;
1599
- continue;
1600
- }
1601
- } else if (source[at] === ".") at += 1;
1602
- else if (source[at] === "[" || source[at] === "(") {
1603
- const end2 = codeGroupEnd(source, at);
1604
- if (end2 < 0) return null;
1605
- syntax = true;
1606
- at = end2;
1607
- continue;
1608
- } else return null;
1609
- const end = codeIdentifierEnd(source, at);
1610
- if (end < 0) return null;
1611
- syntax = true;
1612
- at = end;
1613
- }
1614
- if (!syntax && !declaration) return null;
1615
- const rewritten = maskExpressionLiterals(source);
1616
- if (rewritten === null) return null;
1617
- const full = semicolon ? `${awaitPrefix}${rewritten};` : `${awaitPrefix}${rewritten}`;
1618
- return value.replace(value.trim(), full);
1619
- }
1620
- function redactSecretValues(text) {
1621
- const hits = {};
1622
- let out = text;
1623
- for (const p of compiled) {
1624
- p.re.lastIndex = 0;
1625
- out = out.replace(p.re, (...m) => {
1626
- hits[p.name] = (hits[p.name] ?? 0) + 1;
1627
- return p.replacement.replace(/\$(\d)/g, (_, i) => String(m[Number(i)] ?? ""));
1628
- });
1629
- }
1630
- return { text: out, hits };
1631
- }
1632
- function redactPlainText(text) {
1633
- const hits = {};
1634
- let out = redactFieldAssignments(text, () => {
1635
- hits["secret field"] = (hits["secret field"] ?? 0) + 1;
1636
- });
1637
- if (holdsCardNumber(out)) {
1638
- hits["card number"] = (hits["card number"] ?? 0) + 1;
1639
- out = scrubCardData(out);
1640
- }
1641
- for (const p of compiled) {
1642
- p.re.lastIndex = 0;
1643
- out = out.replace(p.re, (...m) => {
1644
- hits[p.name] = (hits[p.name] ?? 0) + 1;
1645
- return p.replacement.replace(/\$(\d)/g, (_, i) => String(m[Number(i)] ?? ""));
1646
- });
1647
- }
1648
- return { text: out, hits };
1649
- }
1650
- function nameSegments(name) {
1651
- return name.replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/([a-z0-9])([A-Z])/g, "$1 $2").split(/[^A-Za-z0-9]+/).filter(Boolean).map((part) => part.toLowerCase());
1652
- }
1653
- var CREDENTIAL_WORDS = /* @__PURE__ */ new Set([
1654
- "token",
1655
- "secret",
1656
- "secrets",
1657
- "password",
1658
- "passwords",
1659
- "passwd",
1660
- "credential",
1661
- "credentials",
1662
- "authorization",
1663
- "cookie",
1664
- "cookies"
1665
- ]);
1666
- var KEY_OWNERS = /* @__PURE__ */ new Set(["api", "access", "private", "secret", "signing", "encryption"]);
1667
- var COUNT_QUALIFIERS = /* @__PURE__ */ new Set(["max", "min", "num", "total", "input", "output", "cache", "prompt", "completion", "reasoning", "thinking", "used", "remaining", "limit", "budget"]);
1668
- var COUNT_SUFFIXES = /* @__PURE__ */ new Set(["count", "counts", "used", "usage", "remaining", "limit", "limits", "budget", "price", "cost", "total", "size", "length"]);
1669
- var PLAN_LOGIN = /model-subscriptions\/(?:[^\s"'`/?]+\/)?logins\/[^\s"'`/?]+\/code|submit_model_subscription_login_code/;
1670
- var PLAN_LOGIN_ID = /["'\\]login_id["'\\]/;
1671
- function namesPlanLogin(node2) {
1672
- return "login_id" in node2 || Object.values(node2).some((item) => typeof item === "string" && PLAN_LOGIN.test(item));
1673
- }
1674
- function ownsKey(segment) {
1675
- if (!segment) return false;
1676
- for (const owner of KEY_OWNERS) if (segment === owner || segment.endsWith(owner)) return true;
1677
- return false;
1678
- }
1679
- function isCredentialField(name) {
1680
- const segments = nameSegments(name);
1681
- for (let i = 0; i < segments.length; i += 1) {
1682
- const segment = segments[i];
1683
- if (segment === "token") {
1684
- if (!COUNT_QUALIFIERS.has(segments[i - 1] ?? "") && !COUNT_SUFFIXES.has(segments[i + 1] ?? "")) return true;
1685
- continue;
1686
- }
1687
- if (CREDENTIAL_WORDS.has(segment)) return true;
1688
- if ((segment === "key" || segment === "keys") && i > 0 && ownsKey(segments[i - 1])) return true;
1689
- if (segment === "id" && i > 0 && segments[i - 1] === "session") return true;
1690
- if (segment === "sessionid" || segment === "apikey" || segment === "accesskey" || segment === "privatekey") return true;
1691
- }
1692
- return false;
1693
- }
1694
- function redactFieldAssignments(value, onHit, inPlanLogin = false) {
1695
- FIELD_ASSIGNMENTS.lastIndex = 0;
1696
- const planLogin = inPlanLogin || PLAN_LOGIN.test(value) || PLAN_LOGIN_ID.test(value);
1697
- let out = "";
1698
- let copiedThrough = 0;
1699
- for (let match = FIELD_ASSIGNMENTS.exec(value); match; match = FIELD_ASSIGNMENTS.exec(value)) {
1700
- const name = match[2];
1701
- if (!isCredentialField(name) && !(planLogin && name === "code")) continue;
1702
- const valueStart = FIELD_ASSIGNMENTS.lastIndex;
1703
- const quote = match[3];
1704
- const limit = value.length;
1705
- const lineEnd = value.slice(valueStart, limit).search(/[\r\n]/);
1706
- const boundedLineEnd = lineEnd < 0 ? limit : valueStart + lineEnd;
1707
- const boundary = quote ? { end: boundedLineEnd, unsafe: false } : credentialRhsBoundary(value, valueStart, boundedLineEnd);
1708
- const expressionEnd = boundary.end;
1709
- const lineStart = value.lastIndexOf("\n", match.index - 1) + 1;
1710
- const declaration = /(?:^|[;{}]\s*)(?:const|let|var)\s+$/.test(value.slice(lineStart, match.index));
1711
- const expression = quote || boundary.unsafe ? null : rewriteCodeExpression(value.slice(valueStart, expressionEnd), declaration);
1712
- if (expression !== null) {
1713
- if (expression !== value.slice(valueStart, expressionEnd)) {
1714
- out += value.slice(copiedThrough, valueStart) + expression;
1715
- copiedThrough = expressionEnd;
1716
- onHit(value.slice(valueStart, expressionEnd));
1717
- }
1718
- FIELD_ASSIGNMENTS.lastIndex = expressionEnd;
1719
- continue;
1720
- }
1721
- if (!quote) {
1722
- const fieldValue2 = value.slice(valueStart, expressionEnd);
1723
- const trimmed2 = fieldValue2.trim();
1724
- if (!COMPLETE_MASKED_VALUE.test(trimmed2)) {
1725
- out += value.slice(copiedThrough, valueStart) + (JSON_NUMBER.test(trimmed2) ? `"${MASK}"` : MASK);
1726
- copiedThrough = expressionEnd;
1727
- onHit(fieldValue2);
1728
- }
1729
- FIELD_ASSIGNMENTS.lastIndex = expressionEnd;
1730
- continue;
1731
- }
1732
- let valueEnd = valueStart;
1733
- if (quote) {
1734
- let openingSlashes = 0;
1735
- for (let i = match[1].length - 2; i >= 0 && match[1][i] === "\\"; i -= 1) openingSlashes += 1;
1736
- while (valueEnd < limit && value[valueEnd] !== "\r" && value[valueEnd] !== "\n") {
1737
- if (value[valueEnd] === quote) {
1738
- let syntaxStart = valueEnd;
1739
- while (syntaxStart > valueStart && value[syntaxStart - 1] === "\\") syntaxStart -= 1;
1740
- if (valueEnd - syntaxStart === openingSlashes) {
1741
- valueEnd = syntaxStart;
1742
- break;
1743
- }
1744
- }
1745
- valueEnd += 1;
1746
- }
1747
- } else {
1748
- while (valueEnd < limit && !/["'\r\n,}]/.test(value[valueEnd])) valueEnd += 1;
1749
- }
1750
- if (valueEnd === valueStart) continue;
1751
- const fieldValue = value.slice(valueStart, valueEnd);
1752
- const trimmed = fieldValue.trim();
1753
- if (COMPLETE_MASKED_VALUE.test(trimmed)) continue;
1754
- out += value.slice(copiedThrough, valueStart) + (!match[3] && JSON_NUMBER.test(trimmed) ? `"${MASK}"` : MASK);
1755
- copiedThrough = valueEnd;
1756
- onHit(fieldValue);
1757
- FIELD_ASSIGNMENTS.lastIndex = valueEnd;
1758
- }
1759
- return copiedThrough ? out + value.slice(copiedThrough) : value;
1760
- }
1761
- var B64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
1762
- function base64Bytes(value) {
1763
- const clean = value.endsWith("==") ? value.slice(0, -2) : value.endsWith("=") ? value.slice(0, -1) : value;
1764
- const out = [];
1765
- let bits = 0;
1766
- let acc = 0;
1767
- for (const ch of clean) {
1768
- const index = B64.indexOf(ch);
1769
- if (index < 0) throw new Error("not base64");
1770
- acc = acc << 6 | index;
1771
- bits += 6;
1772
- if (bits >= 8) {
1773
- bits -= 8;
1774
- out.push(acc >> bits & 255);
1775
- }
1776
- }
1777
- return Uint8Array.from(out);
1778
- }
1779
- function bytesBase64(bytes) {
1780
- let out = "";
1781
- for (let i = 0; i < bytes.length; i += 3) {
1782
- const a = bytes[i], b = bytes[i + 1], c = bytes[i + 2];
1783
- out += B64[a >> 2] + B64[(a & 3) << 4 | (b ?? 0) >> 4] + (b === void 0 ? "=" : B64[(b & 15) << 2 | (c ?? 0) >> 6]) + (c === void 0 ? "=" : B64[c & 63]);
1784
- }
1785
- return out;
1786
- }
1787
- function redactLine(line, options = {}) {
1788
- const hits = {};
1789
- function traceIdentityPaths(root) {
1790
- if (!options.preserveTraceSessionIds || !root || typeof root !== "object" || Array.isArray(root)) return /* @__PURE__ */ new Set();
1791
- const node2 = root;
1792
- if (typeof node2.type === "string" && /^(?:auth(?:entication|orization)?|login|logout|oauth|credentials?|session[_-]token|cookie)(?:[./:_-]|$)/i.test(node2.type)) return /* @__PURE__ */ new Set();
1793
- const nativeTypes = /* @__PURE__ */ new Set([
1794
- "user",
1795
- "assistant",
1796
- "system",
1797
- "progress",
1798
- "summary",
1799
- "file-history-snapshot",
1800
- "queue-operation",
1801
- "custom-title",
1802
- "last-prompt",
1803
- "agent-name",
1804
- "agent-color",
1805
- "session_meta",
1806
- "response_item",
1807
- "event_msg",
1808
- "turn_context",
1809
- "compacted",
1810
- "session",
1811
- "attachment",
1812
- "atis-latch",
1813
- "api-request-shape",
1814
- "api-request-blob",
1815
- "api-request",
1816
- "bridge-session",
1817
- "relocated",
1818
- "worktree-state",
1819
- "pr-link",
1820
- "cost-state"
1821
- ]);
1822
- const native = node2.format === "trace/v1" || node2.type === void 0 && (Array.isArray(node2.messages) || Array.isArray(node2.history)) || typeof node2.type === "string" && (nativeTypes.has(node2.type) || /^(?:user|assistant|tool|hook|session|turn|reasoning)\//.test(node2.type));
1823
- if (native) return /* @__PURE__ */ new Set(["session_id", "sessionId"]);
1824
- const relationTables = /* @__PURE__ */ new Set(["messages", "session_model_usage", "compression_locks", "intermediate_events"]);
1825
- if (typeof node2.table === "string" && relationTables.has(node2.table) && node2.row && typeof node2.row === "object" && options.expectedTraceSessionId) {
1826
- return /* @__PURE__ */ new Set(["row\0session_id", "row\0sessionId"]);
1827
- }
1828
- return /* @__PURE__ */ new Set();
1829
- }
1830
- function preserveIdentity(identities, path, key, value) {
1831
- return typeof value === "string" && identities.has([...path, key].join("\0")) && (path.length === 0 || value === options.expectedTraceSessionId);
1832
- }
1833
- function fieldCredentials(value, inPlanLogin) {
1834
- return redactFieldAssignments(value, (fieldValue) => {
1835
- const kind = /^[A-Za-z0-9_/+.=-]{12,}$/.test(fieldValue) ? "env assignment" : "secret field";
1836
- hits[kind] = (hits[kind] ?? 0) + 1;
1837
- }, inPlanLogin);
1838
- }
1839
- function redactPatterns(value, inPlanLogin = false) {
1840
- let out = value;
1841
- for (const p of compiled) {
1842
- p.re.lastIndex = 0;
1843
- out = out.replace(p.re, (...m) => {
1844
- hits[p.name] = (hits[p.name] ?? 0) + 1;
1845
- return p.replacement.replace(/\$(\d)/g, (_, i) => String(m[Number(i)] ?? ""));
1846
- });
1847
- }
1848
- return fieldCredentials(out, inPlanLogin);
1849
- }
1850
- function redactDuplicateRecord(value) {
1851
- let at = 0;
1852
- const space = () => {
1853
- while (/[ \t\r\n]/.test(value[at] ?? "") && at < value.length) at += 1;
1854
- };
1855
- const invalid = () => {
1856
- throw new UnsafeImportError("Invalid JSON in a duplicate-key record.");
1857
- };
1858
- const string4 = () => {
1859
- const start = at++;
1860
- while (at < value.length) {
1861
- if (value[at] === "\\") {
1862
- at += 2;
1863
- continue;
1864
- }
1865
- if (value[at++] === '"') {
1866
- try {
1867
- return { start, end: at, kind: "string", text: JSON.parse(value.slice(start, at)) };
1868
- } catch {
1869
- return invalid();
1870
- }
1871
- }
1872
- }
1873
- return invalid();
1874
- };
1875
- const parse3 = () => {
1876
- space();
1877
- const start = at;
1878
- if (value[at] === '"') return string4();
1879
- if (value[at] === "{") {
1880
- at += 1;
1881
- space();
1882
- const properties = [];
1883
- if (value[at] !== "}") while (true) {
1884
- if (value[at] !== '"') return invalid();
1885
- const key = string4();
1886
- space();
1887
- if (value[at++] !== ":") return invalid();
1888
- properties.push({ key, value: parse3() });
1889
- space();
1890
- if (value[at] === "}") break;
1891
- if (value[at++] !== ",") return invalid();
1892
- space();
1893
- }
1894
- at += 1;
1895
- return { start, end: at, kind: "object", properties };
1896
- }
1897
- if (value[at] === "[") {
1898
- at += 1;
1899
- space();
1900
- const items = [];
1901
- if (value[at] !== "]") while (true) {
1902
- items.push(parse3());
1903
- space();
1904
- if (value[at] === "]") break;
1905
- if (value[at++] !== ",") return invalid();
1906
- }
1907
- at += 1;
1908
- return { start, end: at, kind: "array", items };
1909
- }
1910
- const literal2 = /^(?:null|true|false|-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)/.exec(value.slice(at));
1911
- if (!literal2) return invalid();
1912
- at += literal2[0].length;
1913
- return { start, end: at, kind: "literal" };
1914
- };
1915
- const tree = parse3();
1916
- space();
1917
- if (at !== value.length) return invalid();
1918
- const rootContext = /* @__PURE__ */ Object.create(null);
1919
- let ambiguousIdentity = false;
1920
- for (const property of tree.properties ?? []) {
1921
- const key = property.key.text;
1922
- const item = property.value.kind === "string" ? property.value.text : property.value.kind === "array" ? [] : property.value.kind === "object" ? Object.fromEntries(property.value.properties.filter((p) => p.value.kind === "string").map((p) => [p.key.text, p.value.text])) : void 0;
1923
- if (["type", "format", "table", "messages", "history", "row"].includes(key) && key in rootContext && rootContext[key] !== item) ambiguousIdentity = true;
1924
- rootContext[key] = item;
1925
- }
1926
- const identities = ambiguousIdentity ? /* @__PURE__ */ new Set() : traceIdentityPaths(rootContext);
1927
- const replacements = [];
1928
- const replace = (node2, text) => {
1929
- if (node2.kind === "string" && text === node2.text) return;
1930
- replacements.push({ start: node2.start, end: node2.end, text: JSON.stringify(text) });
1931
- };
1932
- const visit2 = (node2, path = [], inPlanLogin = false) => {
1933
- if (node2.kind === "string") {
1934
- replace(node2, redactText(node2.text, inPlanLogin));
1935
- return;
1936
- }
1937
- if (node2.kind === "array") {
1938
- node2.items.forEach((item, index) => visit2(item, [...path, String(index)], inPlanLogin));
1939
- return;
1940
- }
1941
- if (node2.kind !== "object") return;
1942
- const context = /* @__PURE__ */ Object.create(null);
1943
- const attachment = node2.properties.some(({ key, value: child }) => ["media_type", "mime_type"].includes(key.text) || key.text === "type" && ["base64", "import.resource"].includes(child.text ?? ""));
1944
- for (const property of node2.properties) {
1945
- const key = property.key.text;
1946
- const text = property.value.kind === "string" ? property.value.text : void 0;
1947
- if (attachment && ["data", "media_type", "mime_type", "type"].includes(key) && key in context && context[key] !== text) {
1948
- throw new UnsafeImportError("Conflicting attachment metadata in a duplicate-key record.");
1949
- }
1950
- context[key] = text;
1951
- }
1952
- const payload = isFilePayload(context);
1953
- const planLogin = inPlanLogin || namesPlanLogin(context);
1954
- for (const property of node2.properties) {
1955
- const key = property.key.text, child = property.value;
1956
- replace(property.key, redactText(key));
1957
- if (payload && key === "data") {
1958
- replace(child, recodePayload(child.text, context.media_type ?? context.mime_type));
1959
- } else if ((isCredentialField(key) || planLogin && key === "code") && !preserveIdentity(identities, path, key, child.kind === "string" ? child.text : void 0) && value.slice(child.start, child.end) !== "null") {
1960
- if (child.kind !== "string" || child.text !== MASK) {
1961
- hits["secret field"] = (hits["secret field"] ?? 0) + 1;
1962
- replace(child, MASK);
1963
- }
1964
- } else visit2(child, [...path, key], planLogin);
1965
- }
1966
- };
1967
- visit2(tree);
1968
- let out = value;
1969
- for (const replacement of replacements.sort((a, b) => b.start - a.start)) {
1970
- out = out.slice(0, replacement.start) + replacement.text + out.slice(replacement.end);
1971
- }
1972
- return out;
1973
- }
1974
- function restoreHits(snapshot) {
1975
- for (const key of Object.keys(hits)) delete hits[key];
1976
- Object.assign(hits, snapshot);
1977
- }
1978
- function redactText(value, inPlanLogin = false) {
1979
- const uri = BASE64_DATA_URI_PREFIX.exec(value);
1980
- if (uri && isCanonicalBase64(uri[2])) {
1981
- const prefix = uri[1];
1982
- const metadata = redactPlainText(prefix.slice(0, -8));
1983
- for (const [kind, n] of Object.entries(metadata.hits)) hits[kind] = (hits[kind] ?? 0) + n;
1984
- const mediaType = /^data:([^;,]*)/i.exec(prefix)?.[1] || "text/plain";
1985
- return metadata.text + prefix.slice(-8) + recodePayload(uri[2], mediaType);
1986
- }
1987
- const trimmed = value.trim();
1988
- if (trimmed.startsWith("{") && trimmed.endsWith("}") || trimmed.startsWith("[") && trimmed.endsWith("]")) {
1989
- if (hasDuplicateJsonKeys(value)) throw new UnsafeImportError("Duplicate keys in serialized JSON are not safe to import.");
1990
- const snapshot = { ...hits };
1991
- try {
1992
- const json3 = withPreservedNumbers(value);
1993
- if (json3) {
1994
- const parsed = json3.parse();
1995
- const walked = walk(parsed, /* @__PURE__ */ new Set(), [], inPlanLogin);
1996
- if (JSON.stringify(walked) !== JSON.stringify(parsed)) return json3.serialize(walked);
1997
- restoreHits(snapshot);
1998
- return value;
1999
- }
2000
- } catch (error61) {
2001
- if (error61 instanceof UnsafeImportError) throw error61;
2002
- restoreHits(snapshot);
2003
- }
2004
- }
2005
- return redactPatterns(value, inPlanLogin);
2006
- }
2007
- function recodePayload(data, mediaType) {
2008
- const bytes = base64Bytes(data);
2009
- if (!isTextMediaType(mediaType)) return data;
2010
- let content;
2011
- try {
2012
- content = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
2013
- } catch {
2014
- throw new UnsafeImportError("A declared text attachment is not valid UTF-8.");
2015
- }
2016
- const cleaned = redactText(content);
2017
- return cleaned === content ? data : bytesBase64(new TextEncoder().encode(cleaned));
2018
- }
2019
- function maskDescendants(value) {
2020
- if (typeof value === "string") return value === MASK ? value : MASK;
2021
- if (typeof value === "number" || typeof value === "boolean") return MASK;
2022
- if (Array.isArray(value)) return value.map(maskDescendants);
2023
- if (value && typeof value === "object") {
2024
- const result = {};
2025
- for (const [key, item] of Object.entries(value)) {
2026
- const name = redactText(key);
2027
- let at = name;
2028
- for (let n = 2; at in result; n += 1) at = `${name} (${n})`;
2029
- result[at] = maskDescendants(item);
2030
- }
2031
- return result;
2032
- }
2033
- return value;
2034
- }
2035
- function walk(value, identities = /* @__PURE__ */ new Set(), path = [], inPlanLogin = false) {
2036
- if (typeof value === "string") return redactText(value, inPlanLogin);
2037
- if (Array.isArray(value)) return value.map((item, index) => walk(item, identities, [...path, String(index)], inPlanLogin));
2038
- if (!value || typeof value !== "object") return value;
2039
- const node2 = value;
2040
- const payload = isFilePayload(node2);
2041
- const planLogin = inPlanLogin || namesPlanLogin(node2);
2042
- const out = {};
2043
- const place = (name, item) => {
2044
- let at = name;
2045
- for (let n = 2; at in out; n += 1) at = `${name} (${n})`;
2046
- out[at] = item;
2047
- };
2048
- for (const [key, item] of Object.entries(node2)) {
2049
- const name = redactText(key);
2050
- if (payload && key === "data") {
2051
- place(name, recodePayload(item, node2.media_type ?? node2.mime_type));
2052
- continue;
2053
- }
2054
- if ((isCredentialField(key) || planLogin && key === "code") && !preserveIdentity(identities, path, key, item) && item !== null && item !== void 0) {
2055
- const masked = maskDescendants(item);
2056
- if (JSON.stringify(masked) !== JSON.stringify(item)) {
2057
- hits["secret field"] = (hits["secret field"] ?? 0) + 1;
2058
- }
2059
- place(name, masked);
2060
- continue;
2061
- }
2062
- place(name, walk(item, identities, [...path, key], planLogin));
2063
- }
2064
- return out;
2065
- }
2066
- if (hasDuplicateJsonKeys(line)) return { line: redactDuplicateRecord(line), hits };
2067
- const json2 = withPreservedNumbers(line);
2068
- if (!json2) {
2069
- if (options.requireStructured) throw new Error("Could not preserve JSON numbers during redaction.");
2070
- return { line: redactPatterns(line), hits };
2071
- }
2072
- try {
2073
- const parsed = json2.parse();
2074
- const walked = json2.serialize(walk(parsed, traceIdentityPaths(parsed)));
2075
- return { line: Object.keys(hits).length ? walked : line, hits };
2076
- } catch (error61) {
2077
- if (options.requireStructured || error61 instanceof UnsafeImportError) throw error61;
2078
- return { line: redactPatterns(line), hits };
2079
- }
2080
- }
2081
- var BASE64_DATA_URI_PREFIX = /^(data:[^,]*;base64,)([\s\S]*)(?![\s\S])/i;
2082
- function isFilePayload(node2) {
2083
- return typeof node2.data === "string" && node2.data !== "" && (typeof node2.media_type === "string" || typeof node2.mime_type === "string" || node2.type === "import.resource" || node2.type === "base64");
2084
- }
2085
-
2086
1239
  // ../../packages/spec/src/trace-content.ts
2087
1240
  var TRACE_CONTENT_SCOPES = ["prompts", "tool_output", "files"];
2088
1241
  var TRACE_CONTENT_MAX_BYTES = 48 * 1024;
@@ -23993,6 +23146,8 @@ var questionSchema = external_exports.object({
23993
23146
  /** What the platform is asking for when the question is one of its own
23994
23147
  * requests rather than an agent's free question. Absent on an ordinary question. */
23995
23148
  kind: external_exports.enum(QUESTION_REQUEST_KINDS).optional(),
23149
+ /** The answer the platform recommends for an Allow or Deny request, and why in one sentence; absent when it has none. */
23150
+ recommendation: external_exports.object({ option: external_exports.enum(["allow", "deny"]), reason: external_exports.string().trim().min(1).max(300) }).optional(),
23996
23151
  /** What the request is about: the app to connect for `connect_app`, the vendor for `connect_account`, the agent's handle for `spend`, the rule that asks for `start`, the site the agent's browser is on for `browser_handoff`, the skill or lesson a finished task suggests changing for `reflection`, the tool an agent's held call is to for `confirm`, the plugin id to turn on for `plugin_off`, the merchant's host for `purchase`. */
23997
23152
  subject: external_exports.string().trim().min(1).max(200).optional(),
23998
23153
  /** What is being bought; present exactly when `kind` is `purchase`. */
@@ -24081,7 +23236,7 @@ var SLACK_OWN_APP_BOT_SCOPES = [
24081
23236
  ];
24082
23237
  var SLACK_OWN_APP_BOT_EVENTS = ["app_mention", "message.channels", "message.groups", "message.im", "reaction_added"];
24083
23238
  var SLACK_AGENT_BOT_SCOPES = [...SLACK_OWN_APP_BOT_SCOPES, "assistant:write", "groups:read", "mpim:history", "mpim:read", "team:read"];
24084
- var SLACK_AGENT_BOT_EVENTS = [...SLACK_OWN_APP_BOT_EVENTS, "message.mpim", "assistant_thread_started", "assistant_thread_context_changed"];
23239
+ var SLACK_AGENT_BOT_EVENTS = [...SLACK_OWN_APP_BOT_EVENTS, "message.mpim", "assistant_thread_started", "assistant_thread_context_changed", "app_uninstalled", "tokens_revoked"];
24085
23240
 
24086
23241
  // ../../packages/spec/src/session-show.ts
24087
23242
  var SHOW_KINDS = ["artifact", "browser", "pull_request", "changes", "story", "schedules", "notes", "status_update", "background_tasks", "files"];
@@ -24124,6 +23279,7 @@ var goalWaitSchema = external_exports.object({
24124
23279
  (seconds) => Number.isSafeInteger(seconds) && Number.isFinite(new Date(Date.now() + seconds * 1e3).getTime()),
24125
23280
  "resume_in_seconds exceeds the supported date range"
24126
23281
  ),
23282
+ due_at: external_exports.string().datetime({ offset: true }).nullable().optional().describe("Business deadline, independent of the next feedback check. Set null to clear it."),
24127
23283
  context: external_exports.string().trim().min(1).max(4e3).optional().describe("What to check, its feedback source, and relevant evidence or prior attempts")
24128
23284
  });
24129
23285
  var goalAmendmentSchema = external_exports.object({
@@ -25085,11 +24241,6 @@ export {
25085
24241
  REASONING_EFFORT_VALUES,
25086
24242
  isModelEffortSupported,
25087
24243
  reasoningEffortDocLine,
25088
- UnsafeImportError,
25089
- unsafeNumberSpans,
25090
- redactSecretValues,
25091
- redactPlainText,
25092
- redactLine,
25093
24244
  TRACE_CONTENT_SCOPES,
25094
24245
  redactTraceText,
25095
24246
  publicRemote,