@akasecurity/ai-tc-antigravity 0.9.21 → 0.9.23

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.
@@ -8545,6 +8545,12 @@ var CaptureSighting = object({
8545
8545
  ruleId: string2().min(1),
8546
8546
  category: DetectionCategory
8547
8547
  }).meta({ id: "CaptureSighting" });
8548
+ var REVIEW_VALUES_MAX = 16;
8549
+ var REVIEW_VALUE_MAX_CHARS = 1024;
8550
+ var ReviewValue = object({
8551
+ ruleId: string2().min(1).max(256),
8552
+ value: string2().min(1).max(REVIEW_VALUE_MAX_CHARS)
8553
+ }).meta({ id: "ReviewValue" });
8548
8554
  var EventMetadata = object({
8549
8555
  sessionId: string2().optional(),
8550
8556
  repo: string2().optional(),
@@ -8652,7 +8658,14 @@ var EventMetadata = object({
8652
8658
  scanIncomplete: _enum(["timeout", "unavailable"]).optional(),
8653
8659
  // The sighting tokens in `content`, one entry per distinct token and rule.
8654
8660
  // Set only on a forwarded capture; the locally stored copy holds the values.
8655
- sightings: array(CaptureSighting).optional()
8661
+ sightings: array(CaptureSighting).optional(),
8662
+ // The length of the text this capture was cut from, when its content holds only the first
8663
+ // part of it. Absent when the content is the whole text.
8664
+ contentTruncatedFrom: number2().int().nonnegative().optional(),
8665
+ // The raw value of each finding in this capture, for review by the deployment. Set only on
8666
+ // a forwarded capture from a repository the organization's capture settings name; the
8667
+ // locally stored copy never carries it.
8668
+ reviewValues: array(ReviewValue).max(REVIEW_VALUES_MAX).optional()
8656
8669
  }).meta({ id: "EventMetadata" });
8657
8670
  var Event = object({
8658
8671
  id: guid2(),
@@ -9503,6 +9516,7 @@ var AssetType = _enum(["project", "skill", "mcp", "hook", "config"]).meta({ id:
9503
9516
  var AccessLevel = _enum(["open", "approved", "blocked"]).meta({ id: "AccessLevel" });
9504
9517
  var Origin = _enum(["source", "public-dep", "vendored", "config", "data", "docs", "generated"]).meta({ id: "Origin" });
9505
9518
  var TrustLevel = _enum(["known-good", "risky", "unapproved"]).meta({ id: "TrustLevel" });
9519
+ var ATTENTION_TRUST_LEVELS = ["unapproved", "risky"];
9506
9520
  var Flag = _enum(["update", "stale", "conflict", "unknown", "change", "untracked", "risk", "findings"]).meta({ id: "Flag" });
9507
9521
  var Visibility = _enum(["public", "private"]).meta({ id: "Visibility" });
9508
9522
  var HarnessEventKind = _enum(["block", "redact", "warn"]).meta({ id: "HarnessEventKind" });
@@ -9645,7 +9659,7 @@ var McpTool = object({
9645
9659
  signature: string2(),
9646
9660
  description: string2(),
9647
9661
  write: boolean2(),
9648
- /** Non-null string when tool is dangerous / blocked; null otherwise. */
9662
+ /** What makes the tool dangerous; null when nothing does. */
9649
9663
  risk: string2().nullable()
9650
9664
  }).meta({ id: "McpTool" });
9651
9665
  var AssetFindingRef = object({
@@ -9692,8 +9706,9 @@ var ProjectSensitiveData = object({ items: array(SensitiveDataClass) }).meta({ i
9692
9706
  var ListProjectsResponse = object({ items: array(ProjectSummary) }).meta({ id: "ListProjectsResponse" });
9693
9707
  var InventoryStats = object({
9694
9708
  /**
9695
- * Assets with a flag, plus projects with a finding in the last
9696
- * `PROJECT_FINDINGS_WINDOW_DAYS` days (drives the attention header chip).
9709
+ * Assets with a flag or with an `ATTENTION_TRUST_LEVELS` effective trust,
9710
+ * plus projects with a finding in the last `PROJECT_FINDINGS_WINDOW_DAYS`
9711
+ * days (drives the attention header chip). An asset counts once.
9697
9712
  */
9698
9713
  attention: number2().int().nonnegative(),
9699
9714
  byType: object({
@@ -10216,6 +10231,10 @@ var EgressIngestHit = object({
10216
10231
  */
10217
10232
  credentialRefs: EgressCredentialRefs.optional()
10218
10233
  }).meta({ id: "EgressIngestHit" });
10234
+ var SUPERSEDED_PROJECT_KEYS_MAX = 4;
10235
+ var SupersededProjectKeys = array(
10236
+ string2().regex(/^[0-9a-f]{64}$/, "a superseded key must be a 64-character lowercase hex digest")
10237
+ ).max(SUPERSEDED_PROJECT_KEYS_MAX);
10219
10238
  var EgressIngestRequest = object({
10220
10239
  /**
10221
10240
  * Hash digest of the local `projectKey`, never the plaintext.
@@ -10228,6 +10247,7 @@ var EgressIngestRequest = object({
10228
10247
  * that still has the plaintext to not send.
10229
10248
  */
10230
10249
  projectKey: string2().regex(/^[0-9a-f]{64}$/, "projectKey must be a 64-character lowercase hex digest"),
10250
+ supersededProjectKeys: SupersededProjectKeys.optional(),
10231
10251
  /** Display name only — never keys reconciliation. */
10232
10252
  project: string2(),
10233
10253
  reconcile: EgressReconcile,
@@ -10337,6 +10357,10 @@ var DeviceCommand = object({
10337
10357
  expiresAt: printable(64).min(1)
10338
10358
  }).strict();
10339
10359
  var DeviceCommandPollResponse = object({ command: DeviceCommand.nullable() });
10360
+ var SessionHoldResponse = object({
10361
+ held: boolean2(),
10362
+ reason: printable(500).optional()
10363
+ });
10340
10364
  var DeviceCommandFailureReason = _enum(["scan_failed", "no_projects", "expired"]);
10341
10365
  var DeviceCommandAckBody = discriminatedUnion("outcome", [
10342
10366
  object({
@@ -10399,7 +10423,9 @@ var CredentialSighting = object({
10399
10423
  }).strict().meta({ id: "CredentialSighting" });
10400
10424
  var CredentialSightingsRequest = object({
10401
10425
  sightings: array(CredentialSighting).min(1).max(CREDENTIAL_SIGHTINGS_BATCH_MAX),
10402
- scanId: uuid2().optional()
10426
+ scanId: uuid2().optional(),
10427
+ /** The earlier digests of the one project every sighting in the request names. */
10428
+ supersededProjectKeys: SupersededProjectKeys.optional()
10403
10429
  }).strict().meta({ id: "CredentialSightingsRequest" });
10404
10430
  var CredentialSightingsAck = object({
10405
10431
  accepted: number2().int().nonnegative()
@@ -10530,6 +10556,18 @@ var ModelPolicy = object({
10530
10556
  mode: literal("allowlist"),
10531
10557
  approved: array(string2().min(1).max(512)).max(1e3)
10532
10558
  }).meta({ id: "ModelPolicy" });
10559
+ var TOOL_OUTPUT_FORWARD_MIN_CHARS = 2;
10560
+ var TOOL_OUTPUT_FORWARD_MAX_CHARS = 65536;
10561
+ var CAPTURE_REPOS_MAX = 1e3;
10562
+ var CaptureRepos = array(string2().min(1).max(512)).max(CAPTURE_REPOS_MAX);
10563
+ var CaptureSettings = object({
10564
+ toolOutput: object({
10565
+ maxChars: number2().int().min(TOOL_OUTPUT_FORWARD_MIN_CHARS).max(TOOL_OUTPUT_FORWARD_MAX_CHARS),
10566
+ repos: CaptureRepos.optional()
10567
+ }).optional(),
10568
+ reviewValueRepos: CaptureRepos.optional(),
10569
+ sessionHold: boolean2().optional()
10570
+ }).meta({ id: "CaptureSettings" });
10533
10571
  var PolicyBundle = object({
10534
10572
  version: string2(),
10535
10573
  policies: array(Policy),
@@ -10593,6 +10631,9 @@ var PolicyBundle = object({
10593
10631
  // absent leaves the device's own setting in force, which is the behaviour
10594
10632
  // that predates the field and the safe direction to default.
10595
10633
  redactFallback: RedactFallback.optional(),
10634
+ // Optional so an older backend, and an older on-disk cache, still parses; absent sends what
10635
+ // the machine sent before the field existed.
10636
+ capture: CaptureSettings.optional(),
10596
10637
  customKeywords: array(string2()),
10597
10638
  fetchedAt: iso_exports.datetime()
10598
10639
  }).meta({ id: "PolicyBundle" });
@@ -10601,7 +10642,8 @@ var POLICY_BUNDLE_SHAPE_ID = [
10601
10642
  ...Object.keys(Policy.shape).map((key) => `policies.${key}`),
10602
10643
  ...PolicyTarget.options.flatMap((member) => "shape" in member ? Object.keys(member.shape) : []).map((key) => `policies.target.${key}`),
10603
10644
  ...Object.keys(ExceptionBundleEntry.shape).map((key) => `exceptions.${key}`),
10604
- ...Object.keys(ModelPolicy.shape).map((key) => `modelPolicy.${key}`)
10645
+ ...Object.keys(ModelPolicy.shape).map((key) => `modelPolicy.${key}`),
10646
+ ...Object.keys(CaptureSettings.shape).map((key) => `capture.${key}`)
10605
10647
  ].sort().join(",");
10606
10648
  var OBSERVE_ONLY_CATEGORIES = ["config"];
10607
10649
  var ENFORCEABLE_CATEGORIES = DetectionCategory.options.filter((c) => !OBSERVE_ONLY_CATEGORIES.includes(c));
@@ -13690,6 +13732,7 @@ var HARNESS_LABELS = {
13690
13732
  [HARNESS.Copilot]: "GitHub Copilot"
13691
13733
  };
13692
13734
  var HARNESS_LIVENESS_WINDOW_MS = 30 * 24 * 60 * 60 * 1e3;
13735
+ var ATTENTION_TRUST_SQL = ATTENTION_TRUST_LEVELS.map((t) => `'${t}'`).join(", ");
13693
13736
  var PROJECT_FINDINGS_WINDOW_MS = PROJECT_FINDINGS_WINDOW_DAYS * 24 * 60 * 60 * 1e3;
13694
13737
  var MCP_TOOLS_USED_WINDOW_MS = MCP_TOOLS_USED_WINDOW_DAYS * 24 * 60 * 60 * 1e3;
13695
13738
  var CATEGORY_OF_DEFINITION = `CASE WHEN d.category IN (${DetectionCategory.options.map((c) => `'${c}'`).join(", ")}) THEN d.category ELSE 'custom' END`;
@@ -14140,8 +14183,8 @@ function parseReconcileTrigger(input) {
14140
14183
  }
14141
14184
 
14142
14185
  // src/hooks/store-health.ts
14143
- import { mkdirSync as mkdirSync4, readFileSync as readFileSync23, writeFileSync as writeFileSync7 } from "fs";
14144
- import { dirname as dirname9, join as join38 } from "path";
14186
+ import { mkdirSync as mkdirSync4, readFileSync as readFileSync24, writeFileSync as writeFileSync7 } from "fs";
14187
+ import { dirname as dirname10, join as join39 } from "path";
14145
14188
 
14146
14189
  // ../../packages/plugin-runtime/src/attached/factory.ts
14147
14190
  import { hostname as hostname3 } from "os";
@@ -14166,8 +14209,8 @@ import { dirname as dirname6 } from "path";
14166
14209
 
14167
14210
  // ../../packages/plugin-runtime/src/attached/config-inventory-sync.ts
14168
14211
  import { createHash as createHash11 } from "crypto";
14169
- import { readFileSync as readFileSync17 } from "fs";
14170
- import { join as join30 } from "path";
14212
+ import { readFileSync as readFileSync18 } from "fs";
14213
+ import { join as join31 } from "path";
14171
14214
 
14172
14215
  // ../../packages/plugin-runtime/src/attached/history-sync.ts
14173
14216
  import { createHash as createHash10 } from "crypto";
@@ -14181,9 +14224,9 @@ var REDACT_DEGRADED_TO = EventMetadata.shape.redactDegradedTo.unwrap();
14181
14224
  var SCAN_INCOMPLETE = EventMetadata.shape.scanIncomplete.unwrap();
14182
14225
 
14183
14226
  // ../../packages/plugin-runtime/src/attached/policy-store.ts
14184
- import { randomUUID as randomUUID15 } from "crypto";
14185
- import { readFile as readFile2, rm, writeFile as writeFile2 } from "fs/promises";
14186
- import { join as join29 } from "path";
14227
+ import { randomUUID as randomUUID16 } from "crypto";
14228
+ import { readFile as readFile2, rm as rm2, writeFile as writeFile3 } from "fs/promises";
14229
+ import { join as join30 } from "path";
14187
14230
 
14188
14231
  // ../../packages/plugin-runtime/src/attached/atomic-publish.ts
14189
14232
  import { rename as rename2 } from "fs/promises";
@@ -14191,6 +14234,16 @@ var IMMEDIATE_RETRIES = 8;
14191
14234
  var TIMED_RETRIES = 4;
14192
14235
  var ATTEMPTS = 1 + IMMEDIATE_RETRIES + TIMED_RETRIES;
14193
14236
 
14237
+ // ../../packages/plugin-runtime/src/attached/capture-settings.ts
14238
+ import { randomUUID as randomUUID15 } from "crypto";
14239
+ import { readFileSync as readFileSync17 } from "fs";
14240
+ import { rm, writeFile as writeFile2 } from "fs/promises";
14241
+ import { join as join29 } from "path";
14242
+ var HookCaptureSettingsSchema = CaptureSettings.pick({
14243
+ toolOutput: true,
14244
+ sessionHold: true
14245
+ });
14246
+
14194
14247
  // ../../packages/plugin-runtime/src/attached/history-sync.ts
14195
14248
  var CAPTURE_BATCH_BYTES = 1024 * 1024;
14196
14249
 
@@ -14200,22 +14253,22 @@ var CONFIG_INVENTORY_STAGED_MAX_AGE_MS = 30 * 24 * 60 * 60 * 1e3;
14200
14253
  var CONFIG_INVENTORY_STAGED_MAX_BYTES = 8 * 1024 * 1024;
14201
14254
 
14202
14255
  // ../../packages/plugin-runtime/src/attached/forward-drops.ts
14203
- import { readFileSync as readFileSync18 } from "fs";
14204
- import { join as join31 } from "path";
14256
+ import { readFileSync as readFileSync19 } from "fs";
14257
+ import { join as join32 } from "path";
14205
14258
 
14206
14259
  // ../../packages/plugin-runtime/src/attached/plugin-block.ts
14207
- import { readFileSync as readFileSync19 } from "fs";
14260
+ import { readFileSync as readFileSync20 } from "fs";
14208
14261
 
14209
14262
  // ../../packages/plugin-runtime/src/attached/install-record.ts
14210
14263
  import { readFile as readFile3, stat } from "fs/promises";
14211
- import { basename as basename2, dirname as dirname7, join as join32, resolve as resolve3 } from "path";
14264
+ import { basename as basename2, dirname as dirname7, join as join33, resolve as resolve3 } from "path";
14212
14265
 
14213
14266
  // ../../packages/plugin-runtime/src/attached/plugin-block.ts
14214
14267
  var INSTALL_RECORD_READ_TIMEOUT_MS = REQUEST_TIMEOUT_MS / 2;
14215
14268
 
14216
14269
  // ../../packages/plugin-runtime/src/attached/posture-report-state.ts
14217
- import { readFileSync as readFileSync20 } from "fs";
14218
- import { join as join33 } from "path";
14270
+ import { readFileSync as readFileSync21 } from "fs";
14271
+ import { join as join34 } from "path";
14219
14272
  var OUTCOME_KEYS = {
14220
14273
  ok: true,
14221
14274
  unauthorized: true,
@@ -14236,18 +14289,18 @@ import { statSync as statSync8 } from "fs";
14236
14289
  import { DatabaseSync as DatabaseSync3 } from "node:sqlite";
14237
14290
 
14238
14291
  // ../../packages/plugin-runtime/src/attached/posture-store.ts
14239
- import { randomUUID as randomUUID16 } from "crypto";
14240
- import { readFile as readFile4, rm as rm2, writeFile as writeFile3 } from "fs/promises";
14241
- import { join as join34 } from "path";
14242
-
14243
- // ../../packages/plugin-runtime/src/attached/label-drops.ts
14244
- import { readFileSync as readFileSync21 } from "fs";
14292
+ import { randomUUID as randomUUID17 } from "crypto";
14293
+ import { readFile as readFile4, rm as rm3, writeFile as writeFile4 } from "fs/promises";
14245
14294
  import { join as join35 } from "path";
14246
14295
 
14247
- // ../../packages/plugin-runtime/src/attached/sync-state.ts
14296
+ // ../../packages/plugin-runtime/src/attached/label-drops.ts
14248
14297
  import { readFileSync as readFileSync22 } from "fs";
14249
14298
  import { join as join36 } from "path";
14250
14299
 
14300
+ // ../../packages/plugin-runtime/src/attached/sync-state.ts
14301
+ import { readFileSync as readFileSync23 } from "fs";
14302
+ import { join as join37 } from "path";
14303
+
14251
14304
  // ../../packages/plugin-runtime/src/attached/status.ts
14252
14305
  var REFUSAL_LINES = {
14253
14306
  unauthorized: "KEY REJECTED \u2014 re-attach with a valid plugin key",
@@ -14277,10 +14330,13 @@ var WORK_LINES = {
14277
14330
  // ../../packages/plugin-runtime/src/attached/history-sync-trigger.ts
14278
14331
  import { spawn as spawn3 } from "child_process";
14279
14332
  import { existsSync as existsSync9, statSync as statSync9 } from "fs";
14280
- import { join as join37 } from "path";
14333
+ import { join as join38 } from "path";
14281
14334
  import { fileURLToPath as fileURLToPath3 } from "url";
14282
14335
  var HISTORY_SYNC_THROTTLE_MS = 5 * 60 * 1e3;
14283
14336
 
14337
+ // ../../packages/plugin-runtime/src/attached/session-hold.ts
14338
+ import { dirname as dirname8 } from "path";
14339
+
14284
14340
  // ../../packages/plugin-runtime/src/attached/sighting-key-sync.ts
14285
14341
  var SIGHTING_KEY_MAX_AGE_MS = 24 * 60 * 60 * 1e3;
14286
14342
 
@@ -14298,10 +14354,10 @@ import { fileURLToPath as fileURLToPath5 } from "url";
14298
14354
  var CONTENT_RETENTION_THROTTLE_MS = 60 * 60 * 1e3;
14299
14355
 
14300
14356
  // ../../packages/plugin-runtime/src/handle-session-start.ts
14301
- import { randomUUID as randomUUID17 } from "crypto";
14357
+ import { randomUUID as randomUUID18 } from "crypto";
14302
14358
 
14303
14359
  // ../../packages/plugin-runtime/src/attached/forwarding-line.ts
14304
- import { dirname as dirname8 } from "path";
14360
+ import { dirname as dirname9 } from "path";
14305
14361
 
14306
14362
  // ../../packages/plugin-runtime/src/handle-session-start.ts
14307
14363
  var EXCEPTION_RETENTION_MS = 90 * 24 * 60 * 60 * 1e3;
@@ -14317,7 +14373,7 @@ function hasControlChar(text) {
14317
14373
  return false;
14318
14374
  }
14319
14375
  function markerDirs(dataDir2) {
14320
- return [dataDir2, dirname9(dataDir2)];
14376
+ return [dataDir2, dirname10(dataDir2)];
14321
14377
  }
14322
14378
  function alreadyClaimed(dirs, marker, sessionId) {
14323
14379
  if (hasControlChar(sessionId)) return false;
@@ -14325,7 +14381,7 @@ function alreadyClaimed(dirs, marker, sessionId) {
14325
14381
  }
14326
14382
  function readRecent(dir, marker) {
14327
14383
  try {
14328
- return readFileSync23(join38(dir, marker), "utf8").split("\n").filter(Boolean);
14384
+ return readFileSync24(join39(dir, marker), "utf8").split("\n").filter(Boolean);
14329
14385
  } catch {
14330
14386
  return [];
14331
14387
  }
@@ -14336,7 +14392,7 @@ function recordClaim(dirs, marker, sessionId) {
14336
14392
  try {
14337
14393
  mkdirSync4(dir, { recursive: true, mode: DATA_DIR_MODE });
14338
14394
  const recent = [...readRecent(dir, marker), sessionId].slice(-RECENT_SESSIONS);
14339
- writeFileSync7(join38(dir, marker), recent.join("\n"), { mode: DATA_FILE_MODE });
14395
+ writeFileSync7(join39(dir, marker), recent.join("\n"), { mode: DATA_FILE_MODE });
14340
14396
  return;
14341
14397
  } catch {
14342
14398
  }
@@ -14361,7 +14417,7 @@ function formatMode(mode) {
14361
14417
  }
14362
14418
  function warnIfStoreRedirected(config2, sessionId, write = (message) => void process.stderr.write(message)) {
14363
14419
  try {
14364
- const paths = symlinkedStorePaths(dirname9(config2.dataDir));
14420
+ const paths = symlinkedStorePaths(dirname10(config2.dataDir));
14365
14421
  if (paths.length === 0) return;
14366
14422
  if (!sessionId) {
14367
14423
  write(storeRedirectedMessage(paths));