@akasecurity/ai-tc-claude-code 0.9.1 → 0.9.3

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.
@@ -491,9 +491,13 @@ var require_ignore = __commonJS({
491
491
  }
492
492
  });
493
493
 
494
+ // ../../packages/plugin-sdk/src/config.ts
495
+ import { existsSync as existsSync4 } from "fs";
496
+ import { join as join6 } from "path";
497
+
494
498
  // ../../packages/persistence/src/database.ts
495
499
  import { randomUUID as randomUUID8 } from "crypto";
496
- import { existsSync, renameSync, rmSync } from "fs";
500
+ import { existsSync, renameSync as renameSync2, rmSync as rmSync2 } from "fs";
497
501
  import { join, sep } from "path";
498
502
  import { DatabaseSync } from "node:sqlite";
499
503
 
@@ -15182,7 +15186,12 @@ var FindingFacets = external_exports.object({
15182
15186
  severity: external_exports.array(FindingFacetItem),
15183
15187
  subtype: external_exports.array(FindingFacetItem),
15184
15188
  provider: external_exports.array(FindingFacetItem),
15185
- action: external_exports.array(FindingFacetItem)
15189
+ action: external_exports.array(FindingFacetItem),
15190
+ // Counts by the group's derived status. The SQLite store derives a status
15191
+ // for every instance, so every group lands in a bucket; a status-less
15192
+ // group (possible only for callers whose rows carry no statuses) is
15193
+ // counted under no value.
15194
+ status: external_exports.array(FindingFacetItem)
15186
15195
  }).meta({ id: "FindingFacets" });
15187
15196
  var ListGroupedFindingsQuery = external_exports.object({
15188
15197
  // NOTE: severity filters by Severity (critical/high/medium/low), not by
@@ -15191,6 +15200,10 @@ var ListGroupedFindingsQuery = external_exports.object({
15191
15200
  subtype: external_exports.array(external_exports.string()).optional(),
15192
15201
  provider: external_exports.array(FindingProvider).optional(),
15193
15202
  action: external_exports.array(FindingAction).optional(),
15203
+ // Matches a group's DERIVED status (see FindingGroup.status), not its
15204
+ // individual instances' — so a filtered group's Status column always reads
15205
+ // one of the requested values.
15206
+ status: external_exports.array(FindingStatus).optional(),
15194
15207
  q: external_exports.string().optional(),
15195
15208
  // Scope to findings whose event carries this session id (the Activity page's
15196
15209
  // session → findings drilldown). Findings without a session never match.
@@ -15371,6 +15384,33 @@ var ToolCallAttributes = external_exports.object({
15371
15384
  parent_uuid: external_exports.string().optional(),
15372
15385
  run_key: external_exports.string().optional()
15373
15386
  }).catchall(external_exports.unknown());
15387
+ var CaptureAttributes = external_exports.object({
15388
+ // The harness/tool that produced the capture (`claude-code`, `cli`, …). A
15389
+ // column on the legacy `events` table; here it rides the bag because a
15390
+ // capture-typed audit row has no equivalent column of its own.
15391
+ source_tool: external_exports.string().optional(),
15392
+ file_path: external_exports.string().optional(),
15393
+ repo: external_exports.string().optional(),
15394
+ // The host tool whose input/output was scanned (e.g. 'Bash', 'WebFetch') —
15395
+ // gives a non-file capture a display location ("via Bash") when file_path
15396
+ // is absent. The tool NAME only, never its arguments/output.
15397
+ tool_name: external_exports.string().optional(),
15398
+ // Presence-only provenance flag: set when the file is excluded by the
15399
+ // repo's .gitignore. Omitted (not false) for tracked files.
15400
+ gitignored: external_exports.boolean().optional(),
15401
+ // Set ONLY when the capture is a COMPLETE file snapshot (a worktree scan
15402
+ // reading from disk), never a partial fragment (a hook-captured edit).
15403
+ whole_file: external_exports.boolean().optional(),
15404
+ // Distributed-tracing correlation: `correlation_id` ties the capture back to
15405
+ // the request that produced it; `trace_id` is the originating span's W3C
15406
+ // trace id when telemetry is enabled.
15407
+ correlation_id: external_exports.uuid().optional(),
15408
+ trace_id: external_exports.string().regex(/^[0-9a-f]{32}$/).optional(),
15409
+ // Ids of the detection exceptions that downgraded findings in this capture
15410
+ // to 'allow' — the enforcement audit trail's link back to the grant that
15411
+ // authorized the bypass.
15412
+ exception_ids: external_exports.array(external_exports.guid()).optional()
15413
+ }).catchall(external_exports.unknown());
15374
15414
  var ToolCallInspection = external_exports.object({
15375
15415
  ruleId: external_exports.string().min(1),
15376
15416
  ruleName: external_exports.string(),
@@ -15457,7 +15497,18 @@ var InspectionFindingInput = external_exports.object({
15457
15497
  span: Span,
15458
15498
  maskedMatch: external_exports.string(),
15459
15499
  actionTaken: ActionTaken,
15460
- confidence: external_exports.number().min(0).max(1)
15500
+ confidence: external_exports.number().min(0).max(1),
15501
+ // Stable, content-addressed key correlating this finding across re-detections
15502
+ // — mirrors the legacy `findings.finding_key` (uq_inspection_findings_key is
15503
+ // its unique index). Optional: only an at-rest/re-scannable finding carries
15504
+ // one; an in-flight capture (prompt/response) has nothing to re-detect
15505
+ // against and leaves it unset, so every insert is a fresh row.
15506
+ findingKey: external_exports.string().optional(),
15507
+ // The ORIGINAL detection time, preserved across a later re-detection of the
15508
+ // same findingKey — mirrors the legacy `findings.first_detected_at`.
15509
+ // Optional: when omitted, the writer derives it from the referenced audit
15510
+ // event's startedAt on first insert (see SqliteInspectionFindingsRepository).
15511
+ firstDetectedAt: external_exports.iso.datetime().optional()
15461
15512
  });
15462
15513
  var InventoryContext = external_exports.object({
15463
15514
  host: InventoryInput.optional(),
@@ -15656,6 +15707,7 @@ var ActivityOverviewResponse = external_exports.object({
15656
15707
 
15657
15708
  // ../../packages/schema/src/zod/event.ts
15658
15709
  var EventKind = external_exports.enum(["prompt", "response", "code_change", "tool_use"]).meta({ id: "EventKind" });
15710
+ var CAPTURE_EVENT_TYPES_SQL = EventKind.options.map((k) => `'${k}'`).join(",");
15659
15711
  var SourceTool = external_exports.enum(["claude-code", "claude-desktop", "cursor", "chatgpt", "github-copilot", "cli", "unknown"]).meta({ id: "SourceTool" });
15660
15712
  var EventMetadata = external_exports.object({
15661
15713
  sessionId: external_exports.string().optional(),
@@ -16145,6 +16197,12 @@ var PolicyBundle = external_exports.object({
16145
16197
  // on-disk caches — that omit the field still parse; consumers read
16146
16198
  // `bundle.exceptions ?? []`.
16147
16199
  exceptions: external_exports.array(ExceptionBundleEntry).optional(),
16200
+ // Installed pack version, keyed by ruleId, for rules in `rules` that came
16201
+ // from a versioned installed pack. Optional so older backends — and older
16202
+ // on-disk caches — that omit the field still parse; consumers fall back to
16203
+ // the rule's own spec version. NOT the bundle version above — see
16204
+ // installedRuleset's ruleVersions for the source of truth.
16205
+ ruleVersions: external_exports.record(external_exports.string(), external_exports.string()).optional(),
16148
16206
  customKeywords: external_exports.array(external_exports.string()),
16149
16207
  fetchedAt: external_exports.iso.datetime()
16150
16208
  }).meta({ id: "PolicyBundle" });
@@ -16749,10 +16807,14 @@ var PatchInstalledPackRequest = external_exports.object({
16749
16807
  }).meta({ id: "PatchInstalledPackRequest" });
16750
16808
 
16751
16809
  // ../../packages/schema/src/zod/local.ts
16752
- var WORKSPACE_SETTINGS_SPEC_VERSION = 3;
16810
+ var WORKSPACE_SETTINGS_SPEC_VERSION = 4;
16753
16811
  var RunMode = external_exports.enum(["standalone"]);
16754
16812
  var SimpleDetectionPolicy = external_exports.enum(["redact", "warn"]);
16755
16813
  var HistoricalAccess = external_exports.enum(["full", "session-only"]);
16814
+ var ModelJudgeConsent = external_exports.object({
16815
+ acknowledgedAt: external_exports.iso.datetime(),
16816
+ payloadVersion: external_exports.number().int().positive()
16817
+ });
16756
16818
  var WorkspaceSettings = external_exports.object({
16757
16819
  specVersion: external_exports.number().int().positive().default(WORKSPACE_SETTINGS_SPEC_VERSION),
16758
16820
  // Settings files written by earlier releases may carry the retired 'attached'
@@ -16768,7 +16830,12 @@ var WorkspaceSettings = external_exports.object({
16768
16830
  // Shares writes.
16769
16831
  dataSharesInPlace: external_exports.boolean().default(true),
16770
16832
  // Absent until /aka:setup completes; its presence is what "onboarded" means.
16771
- onboardedAt: external_exports.iso.datetime().optional()
16833
+ onboardedAt: external_exports.iso.datetime().optional(),
16834
+ // Records that the user consented to sending findings to the model API for
16835
+ // the /aka:setup judge, along with the payload-shape version they agreed to.
16836
+ // Absent until granted; a stale payloadVersion means the consent no longer
16837
+ // covers the current payload and must be re-granted.
16838
+ modelJudgeConsent: ModelJudgeConsent.optional()
16772
16839
  });
16773
16840
 
16774
16841
  // ../../packages/schema/src/zod/project-files.ts
@@ -17147,7 +17214,7 @@ var SetupHandoffOffer = external_exports.object({
17147
17214
  import { createHash } from "crypto";
17148
17215
 
17149
17216
  // ../../packages/persistence/src/paths.ts
17150
- import { chmodSync, mkdirSync } from "fs";
17217
+ import { chmodSync, lstatSync, mkdirSync, renameSync, rmSync, writeFileSync } from "fs";
17151
17218
 
17152
17219
  // ../../packages/persistence/src/repositories/activity.ts
17153
17220
  var LIVE_ACTIVITY_WINDOW_MS = 30 * 6e4;
@@ -17177,23 +17244,27 @@ import { randomUUID as randomUUID6 } from "crypto";
17177
17244
  // ../../packages/persistence/src/repositories/shares.ts
17178
17245
  import { randomUUID as randomUUID7 } from "crypto";
17179
17246
 
17247
+ // ../../packages/persistence/src/finding-key.ts
17248
+ import { createHash as createHash3 } from "crypto";
17249
+
17180
17250
  // ../../packages/persistence/src/fingerprint.ts
17181
17251
  import { createHmac, randomBytes } from "crypto";
17182
- import { chmodSync as chmodSync2, readFileSync, renameSync as renameSync2, writeFileSync } from "fs";
17252
+ import { existsSync as existsSync2, readFileSync } from "fs";
17183
17253
  import { join as join2 } from "path";
17254
+ import { DatabaseSync as DatabaseSync2 } from "node:sqlite";
17184
17255
 
17185
17256
  // ../../packages/persistence/src/local-layout.ts
17186
- import { chmodSync as chmodSync3, mkdirSync as mkdirSync2, renameSync as renameSync3 } from "fs";
17187
- import { chmod, mkdir } from "fs/promises";
17257
+ import { renameSync as renameSync3 } from "fs";
17258
+ import { mkdir } from "fs/promises";
17188
17259
  import { homedir } from "os";
17189
17260
  import { join as join3 } from "path";
17190
17261
 
17191
17262
  // ../../packages/persistence/src/settings.ts
17192
- import { readFileSync as readFileSync2, renameSync as renameSync4, writeFileSync as writeFileSync2 } from "fs";
17263
+ import { readFileSync as readFileSync2 } from "fs";
17193
17264
  import { join as join4 } from "path";
17194
17265
 
17195
17266
  // ../../packages/persistence/src/warn-era-cap.ts
17196
- import { existsSync as existsSync2, writeFileSync as writeFileSync3 } from "fs";
17267
+ import { existsSync as existsSync3, writeFileSync as writeFileSync2 } from "fs";
17197
17268
  import { join as join5 } from "path";
17198
17269
 
17199
17270
  // ../../packages/plugin-sdk/src/provider-env.ts
@@ -17217,7 +17288,7 @@ var ProviderEnvSchema = external_exports.object(providerEnvShape);
17217
17288
  // ../../packages/plugin-sdk/src/config-inventory.ts
17218
17289
  import { readdirSync, readFileSync as readFileSync4, realpathSync, statSync as statSync2 } from "fs";
17219
17290
  import { homedir as homedir2 } from "os";
17220
- import { basename as basename2, join as join7 } from "path";
17291
+ import { basename as basename2, join as join8 } from "path";
17221
17292
 
17222
17293
  // ../../packages/detections/src/egress/registry.ts
17223
17294
  var EXTRACTOR_VERSION = "1";
@@ -17928,21 +17999,18 @@ var POLYNOMIAL_PROBES = ["abc-", "a.", "a ", "a=", "x", "0", "a@", "a/", "ab"].m
17928
17999
  );
17929
18000
 
17930
18001
  // ../../packages/plugin-sdk/src/repo.ts
17931
- import { existsSync as existsSync3, readFileSync as readFileSync3, statSync } from "fs";
17932
- import { basename, dirname, isAbsolute, join as join6, sep as sep2 } from "path";
18002
+ import { existsSync as existsSync5, readFileSync as readFileSync3, statSync } from "fs";
18003
+ import { basename, dirname, isAbsolute, join as join7, sep as sep2 } from "path";
17933
18004
 
17934
18005
  // ../../packages/plugin-sdk/src/events.ts
17935
- import { createHash as createHash3, randomUUID as randomUUID9 } from "crypto";
17936
-
17937
- // ../../packages/plugin-sdk/src/finding-key.ts
17938
- import { createHash as createHash4 } from "crypto";
18006
+ import { createHash as createHash4, randomUUID as randomUUID9 } from "crypto";
17939
18007
 
17940
18008
  // ../../packages/plugin-sdk/src/inventory-resolver.ts
17941
18009
  import { arch, hostname as hostname3, platform, release } from "os";
17942
18010
 
17943
18011
  // ../../packages/plugin-sdk/src/nudge.ts
17944
- import { mkdirSync as mkdirSync3, readFileSync as readFileSync5, writeFileSync as writeFileSync4 } from "fs";
17945
- import { join as join8 } from "path";
18012
+ import { mkdirSync as mkdirSync2, readFileSync as readFileSync5, writeFileSync as writeFileSync3 } from "fs";
18013
+ import { join as join9 } from "path";
17946
18014
 
17947
18015
  // ../../packages/plugin-sdk/src/paths.ts
17948
18016
  import { readdirSync as readdirSync2, realpathSync as realpathSync2 } from "fs";
@@ -17950,8 +18018,8 @@ import { basename as basename3, dirname as dirname2, sep as sep3 } from "path";
17950
18018
 
17951
18019
  // ../../packages/plugin-sdk/src/project-files.ts
17952
18020
  var import_ignore = __toESM(require_ignore(), 1);
17953
- import { existsSync as existsSync4, readdirSync as readdirSync3, readFileSync as readFileSync6 } from "fs";
17954
- import { basename as basename4, join as join9, relative, sep as sep4 } from "path";
18021
+ import { existsSync as existsSync6, readdirSync as readdirSync3, readFileSync as readFileSync6 } from "fs";
18022
+ import { basename as basename4, join as join10, relative, sep as sep4 } from "path";
17955
18023
 
17956
18024
  // ../../packages/plugin-sdk/src/runtime.ts
17957
18025
  import { randomUUID as randomUUID10 } from "crypto";
@@ -17960,8 +18028,8 @@ import { randomUUID as randomUUID10 } from "crypto";
17960
18028
  var THIRTY_DAYS_MS = 30 * 24 * 60 * 60 * 1e3;
17961
18029
 
17962
18030
  // ../../packages/plugin-sdk/src/throttle.ts
17963
- import { mkdirSync as mkdirSync4, statSync as statSync3, writeFileSync as writeFileSync5 } from "fs";
17964
- import { join as join10 } from "path";
18031
+ import { mkdirSync as mkdirSync3, statSync as statSync3, writeFileSync as writeFileSync4 } from "fs";
18032
+ import { join as join11 } from "path";
17965
18033
 
17966
18034
  // src/onboard-posture.ts
17967
18035
  function parsePosture(json2) {