@akasecurity/ai-tc-copilot 0.9.20 → 0.9.22

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.
@@ -8531,6 +8531,12 @@ var CaptureSighting = object({
8531
8531
  ruleId: string2().min(1),
8532
8532
  category: DetectionCategory
8533
8533
  }).meta({ id: "CaptureSighting" });
8534
+ var REVIEW_VALUES_MAX = 16;
8535
+ var REVIEW_VALUE_MAX_CHARS = 1024;
8536
+ var ReviewValue = object({
8537
+ ruleId: string2().min(1).max(256),
8538
+ value: string2().min(1).max(REVIEW_VALUE_MAX_CHARS)
8539
+ }).meta({ id: "ReviewValue" });
8534
8540
  var EventMetadata = object({
8535
8541
  sessionId: string2().optional(),
8536
8542
  repo: string2().optional(),
@@ -8638,7 +8644,14 @@ var EventMetadata = object({
8638
8644
  scanIncomplete: _enum(["timeout", "unavailable"]).optional(),
8639
8645
  // The sighting tokens in `content`, one entry per distinct token and rule.
8640
8646
  // Set only on a forwarded capture; the locally stored copy holds the values.
8641
- sightings: array(CaptureSighting).optional()
8647
+ sightings: array(CaptureSighting).optional(),
8648
+ // The length of the text this capture was cut from, when its content holds only the first
8649
+ // part of it. Absent when the content is the whole text.
8650
+ contentTruncatedFrom: number2().int().nonnegative().optional(),
8651
+ // The raw value of each finding in this capture, for review by the deployment. Set only on
8652
+ // a forwarded capture from a repository the organization's capture settings name; the
8653
+ // locally stored copy never carries it.
8654
+ reviewValues: array(ReviewValue).max(REVIEW_VALUES_MAX).optional()
8642
8655
  }).meta({ id: "EventMetadata" });
8643
8656
  var Event = object({
8644
8657
  id: guid2(),
@@ -9489,6 +9502,7 @@ var AssetType = _enum(["project", "skill", "mcp", "hook", "config"]).meta({ id:
9489
9502
  var AccessLevel = _enum(["open", "approved", "blocked"]).meta({ id: "AccessLevel" });
9490
9503
  var Origin = _enum(["source", "public-dep", "vendored", "config", "data", "docs", "generated"]).meta({ id: "Origin" });
9491
9504
  var TrustLevel = _enum(["known-good", "risky", "unapproved"]).meta({ id: "TrustLevel" });
9505
+ var ATTENTION_TRUST_LEVELS = ["unapproved", "risky"];
9492
9506
  var Flag = _enum(["update", "stale", "conflict", "unknown", "change", "untracked", "risk", "findings"]).meta({ id: "Flag" });
9493
9507
  var Visibility = _enum(["public", "private"]).meta({ id: "Visibility" });
9494
9508
  var HarnessEventKind = _enum(["block", "redact", "warn"]).meta({ id: "HarnessEventKind" });
@@ -9631,7 +9645,7 @@ var McpTool = object({
9631
9645
  signature: string2(),
9632
9646
  description: string2(),
9633
9647
  write: boolean2(),
9634
- /** Non-null string when tool is dangerous / blocked; null otherwise. */
9648
+ /** What makes the tool dangerous; null when nothing does. */
9635
9649
  risk: string2().nullable()
9636
9650
  }).meta({ id: "McpTool" });
9637
9651
  var AssetFindingRef = object({
@@ -9678,8 +9692,9 @@ var ProjectSensitiveData = object({ items: array(SensitiveDataClass) }).meta({ i
9678
9692
  var ListProjectsResponse = object({ items: array(ProjectSummary) }).meta({ id: "ListProjectsResponse" });
9679
9693
  var InventoryStats = object({
9680
9694
  /**
9681
- * Assets with a flag, plus projects with a finding in the last
9682
- * `PROJECT_FINDINGS_WINDOW_DAYS` days (drives the attention header chip).
9695
+ * Assets with a flag or with an `ATTENTION_TRUST_LEVELS` effective trust,
9696
+ * plus projects with a finding in the last `PROJECT_FINDINGS_WINDOW_DAYS`
9697
+ * days (drives the attention header chip). An asset counts once.
9683
9698
  */
9684
9699
  attention: number2().int().nonnegative(),
9685
9700
  byType: object({
@@ -10202,6 +10217,10 @@ var EgressIngestHit = object({
10202
10217
  */
10203
10218
  credentialRefs: EgressCredentialRefs.optional()
10204
10219
  }).meta({ id: "EgressIngestHit" });
10220
+ var SUPERSEDED_PROJECT_KEYS_MAX = 4;
10221
+ var SupersededProjectKeys = array(
10222
+ string2().regex(/^[0-9a-f]{64}$/, "a superseded key must be a 64-character lowercase hex digest")
10223
+ ).max(SUPERSEDED_PROJECT_KEYS_MAX);
10205
10224
  var EgressIngestRequest = object({
10206
10225
  /**
10207
10226
  * Hash digest of the local `projectKey`, never the plaintext.
@@ -10214,6 +10233,7 @@ var EgressIngestRequest = object({
10214
10233
  * that still has the plaintext to not send.
10215
10234
  */
10216
10235
  projectKey: string2().regex(/^[0-9a-f]{64}$/, "projectKey must be a 64-character lowercase hex digest"),
10236
+ supersededProjectKeys: SupersededProjectKeys.optional(),
10217
10237
  /** Display name only — never keys reconciliation. */
10218
10238
  project: string2(),
10219
10239
  reconcile: EgressReconcile,
@@ -10323,6 +10343,10 @@ var DeviceCommand = object({
10323
10343
  expiresAt: printable(64).min(1)
10324
10344
  }).strict();
10325
10345
  var DeviceCommandPollResponse = object({ command: DeviceCommand.nullable() });
10346
+ var SessionHoldResponse = object({
10347
+ held: boolean2(),
10348
+ reason: printable(500).optional()
10349
+ });
10326
10350
  var DeviceCommandFailureReason = _enum(["scan_failed", "no_projects", "expired"]);
10327
10351
  var DeviceCommandAckBody = discriminatedUnion("outcome", [
10328
10352
  object({
@@ -10385,7 +10409,9 @@ var CredentialSighting = object({
10385
10409
  }).strict().meta({ id: "CredentialSighting" });
10386
10410
  var CredentialSightingsRequest = object({
10387
10411
  sightings: array(CredentialSighting).min(1).max(CREDENTIAL_SIGHTINGS_BATCH_MAX),
10388
- scanId: uuid2().optional()
10412
+ scanId: uuid2().optional(),
10413
+ /** The earlier digests of the one project every sighting in the request names. */
10414
+ supersededProjectKeys: SupersededProjectKeys.optional()
10389
10415
  }).strict().meta({ id: "CredentialSightingsRequest" });
10390
10416
  var CredentialSightingsAck = object({
10391
10417
  accepted: number2().int().nonnegative()
@@ -10516,6 +10542,18 @@ var ModelPolicy = object({
10516
10542
  mode: literal("allowlist"),
10517
10543
  approved: array(string2().min(1).max(512)).max(1e3)
10518
10544
  }).meta({ id: "ModelPolicy" });
10545
+ var TOOL_OUTPUT_FORWARD_MIN_CHARS = 2;
10546
+ var TOOL_OUTPUT_FORWARD_MAX_CHARS = 65536;
10547
+ var CAPTURE_REPOS_MAX = 1e3;
10548
+ var CaptureRepos = array(string2().min(1).max(512)).max(CAPTURE_REPOS_MAX);
10549
+ var CaptureSettings = object({
10550
+ toolOutput: object({
10551
+ maxChars: number2().int().min(TOOL_OUTPUT_FORWARD_MIN_CHARS).max(TOOL_OUTPUT_FORWARD_MAX_CHARS),
10552
+ repos: CaptureRepos.optional()
10553
+ }).optional(),
10554
+ reviewValueRepos: CaptureRepos.optional(),
10555
+ sessionHold: boolean2().optional()
10556
+ }).meta({ id: "CaptureSettings" });
10519
10557
  var PolicyBundle = object({
10520
10558
  version: string2(),
10521
10559
  policies: array(Policy),
@@ -10579,6 +10617,9 @@ var PolicyBundle = object({
10579
10617
  // absent leaves the device's own setting in force, which is the behaviour
10580
10618
  // that predates the field and the safe direction to default.
10581
10619
  redactFallback: RedactFallback.optional(),
10620
+ // Optional so an older backend, and an older on-disk cache, still parses; absent sends what
10621
+ // the machine sent before the field existed.
10622
+ capture: CaptureSettings.optional(),
10582
10623
  customKeywords: array(string2()),
10583
10624
  fetchedAt: iso_exports.datetime()
10584
10625
  }).meta({ id: "PolicyBundle" });
@@ -10587,7 +10628,8 @@ var POLICY_BUNDLE_SHAPE_ID = [
10587
10628
  ...Object.keys(Policy.shape).map((key) => `policies.${key}`),
10588
10629
  ...PolicyTarget.options.flatMap((member) => "shape" in member ? Object.keys(member.shape) : []).map((key) => `policies.target.${key}`),
10589
10630
  ...Object.keys(ExceptionBundleEntry.shape).map((key) => `exceptions.${key}`),
10590
- ...Object.keys(ModelPolicy.shape).map((key) => `modelPolicy.${key}`)
10631
+ ...Object.keys(ModelPolicy.shape).map((key) => `modelPolicy.${key}`),
10632
+ ...Object.keys(CaptureSettings.shape).map((key) => `capture.${key}`)
10591
10633
  ].sort().join(",");
10592
10634
  var OBSERVE_ONLY_CATEGORIES = ["config"];
10593
10635
  var ENFORCEABLE_CATEGORIES = DetectionCategory.options.filter((c) => !OBSERVE_ONLY_CATEGORIES.includes(c));
@@ -10948,7 +10990,7 @@ var DetectedWebAccounts = object({
10948
10990
  var DetectedWebAccountsEnvelope = DetectedWebAccounts.extend({ accounts: array(unknown()) });
10949
10991
 
10950
10992
  // ../../packages/schema/src/zod/local.ts
10951
- var WORKSPACE_SETTINGS_SPEC_VERSION = 10;
10993
+ var WORKSPACE_SETTINGS_SPEC_VERSION = 11;
10952
10994
  var RunMode = _enum(["standalone", "attached"]);
10953
10995
  var ControlPlaneConnection = object({
10954
10996
  endpoint: string2().min(1),
@@ -11050,6 +11092,15 @@ var BodyRetention = object({
11050
11092
  // candidate set that is already bounded by "delivered, or never owed".
11051
11093
  retainDays: number2().int().min(1).max(3650).default(BODY_RETENTION_DEFAULT_DAYS)
11052
11094
  }).meta({ id: "BodyRetention" });
11095
+ var MAX_PROTECTED_PATH_ENTRIES = 256;
11096
+ var MAX_PROTECTED_PATH_ENTRY_CHARS = 1024;
11097
+ var ProtectedPathEntry = string2().trim().min(1).max(MAX_PROTECTED_PATH_ENTRY_CHARS);
11098
+ var ProtectedPaths = array(unknown()).transform(
11099
+ (entries) => entries.flatMap((entry) => {
11100
+ const parsed = ProtectedPathEntry.safeParse(entry);
11101
+ return parsed.success ? [parsed.data] : [];
11102
+ }).slice(0, MAX_PROTECTED_PATH_ENTRIES)
11103
+ );
11053
11104
  var WorkspaceSettings = object({
11054
11105
  specVersion: number2().int().positive().default(WORKSPACE_SETTINGS_SPEC_VERSION),
11055
11106
  runMode: RunMode.default("standalone"),
@@ -11140,7 +11191,18 @@ var WorkspaceSettings = object({
11140
11191
  bodyRetention: BodyRetention.default({
11141
11192
  enabled: false,
11142
11193
  retainDays: BODY_RETENTION_DEFAULT_DAYS
11143
- })
11194
+ }),
11195
+ // Folders and file name globs whose files a tool call may not touch
11196
+ // unflagged: a Read, Grep, Glob or Bash naming one becomes a finding under
11197
+ // the command-risk pack's policy. Absent means none are protected, and
11198
+ // protectedPathsOf is the one reader.
11199
+ //
11200
+ // A bad entry is dropped on its own (see ProtectedPaths); `.catch(undefined)`
11201
+ // reads a value that is not a list at all as no list. A settings.json that
11202
+ // fails this schema reads as the unonboarded defaults, and the next save
11203
+ // writes those back over it, so a malformed value must not cost every other
11204
+ // setting. Not a ManagedSettingKey.
11205
+ protectedPaths: ProtectedPaths.optional().catch(void 0)
11144
11206
  });
11145
11207
 
11146
11208
  // ../../packages/schema/src/zod/agent-scope.ts
@@ -11304,6 +11366,9 @@ var ConfigInventoryAck = object({
11304
11366
  accepted: number2().int().nonnegative()
11305
11367
  });
11306
11368
 
11369
+ // ../../packages/schema/src/zod/credential-status.ts
11370
+ var CredentialStatus = _enum(["rotation_overdue", "exposed"]).meta({ id: "CredentialStatus" });
11371
+
11307
11372
  // ../../packages/schema/src/zod/registry.ts
11308
11373
  var Namespace = string2().regex(/^[a-z][a-z0-9-]*$/);
11309
11374
  var PackId = string2().regex(/^[a-z][a-z0-9-]*$/);
@@ -13280,6 +13345,11 @@ var CODING_AGENT_PROVIDERS = new Set(
13280
13345
  )
13281
13346
  );
13282
13347
 
13348
+ // ../../packages/persistence/src/repo-key.ts
13349
+ import { createHash as createHash2 } from "crypto";
13350
+ var SLASH = "/".charCodeAt(0);
13351
+ var SCOPE_KEY = printable(ATTACHMENT_SCOPE_IDENTITY_MAX_LENGTH);
13352
+
13283
13353
  // ../../packages/persistence/src/capture-id-key.ts
13284
13354
  import { randomBytes } from "crypto";
13285
13355
  import { readFileSync as readFileSync4 } from "fs";
@@ -13290,16 +13360,9 @@ import { createHash as createHash4, randomUUID as randomUUID3 } from "crypto";
13290
13360
  import { homedir as homedir2 } from "os";
13291
13361
  import { isAbsolute as isAbsolute2, relative as relative2, sep as sep2 } from "path";
13292
13362
 
13293
- // ../../packages/persistence/src/egress-wire.ts
13294
- import { createHash as createHash2 } from "crypto";
13295
-
13296
13363
  // ../../packages/persistence/src/repositories/shares.ts
13297
13364
  import { randomUUID as randomUUID2 } from "crypto";
13298
13365
 
13299
- // ../../packages/persistence/src/egress-wire.ts
13300
- var SLASH = "/".charCodeAt(0);
13301
- var SCOPE_KEY = printable(ATTACHMENT_SCOPE_IDENTITY_MAX_LENGTH);
13302
-
13303
13366
  // ../../packages/persistence/src/git-index.ts
13304
13367
  import { readFileSync as readFileSync5, statSync as statSync3 } from "fs";
13305
13368
  import { dirname, isAbsolute, join as join6, relative, resolve, sep } from "path";
@@ -13539,6 +13602,7 @@ var HARNESS_LABELS = {
13539
13602
  [HARNESS.Copilot]: "GitHub Copilot"
13540
13603
  };
13541
13604
  var HARNESS_LIVENESS_WINDOW_MS = 30 * 24 * 60 * 60 * 1e3;
13605
+ var ATTENTION_TRUST_SQL = ATTENTION_TRUST_LEVELS.map((t) => `'${t}'`).join(", ");
13542
13606
  var PROJECT_FINDINGS_WINDOW_MS = PROJECT_FINDINGS_WINDOW_DAYS * 24 * 60 * 60 * 1e3;
13543
13607
  var MCP_TOOLS_USED_WINDOW_MS = MCP_TOOLS_USED_WINDOW_DAYS * 24 * 60 * 60 * 1e3;
13544
13608
  var CATEGORY_OF_DEFINITION = `CASE WHEN d.category IN (${DetectionCategory.options.map((c) => `'${c}'`).join(", ")}) THEN d.category ELSE 'custom' END`;