@akasecurity/ai-tc-claude-code 0.8.1 → 0.8.2

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/scripts/intro.js CHANGED
@@ -15289,6 +15289,11 @@ var AuditEventType = external_exports.enum([
15289
15289
  "prompt",
15290
15290
  "response",
15291
15291
  "code_change",
15292
+ // The events.kind of a scanned tool call, widened in to keep this a
15293
+ // superset. Narrower than 'tool_call' above and not a duplicate of it:
15294
+ // 'tool_call' is the reconciler's structural row for every call, while
15295
+ // 'tool_use' exists only where a hook enforced against the arguments.
15296
+ "tool_use",
15292
15297
  // One row per config-inventory scan, hung off the session root. It is the
15293
15298
  // fact the posture inspection findings reference (findings require an
15294
15299
  // audit_event_id), and its started_at is the "scanned Nm ago" the read
@@ -15677,7 +15682,7 @@ var ActivityOverviewResponse = external_exports.object({
15677
15682
  }).meta({ id: "ActivityOverviewResponse" });
15678
15683
 
15679
15684
  // ../../packages/schema/src/zod/event.ts
15680
- var EventKind = external_exports.enum(["prompt", "response", "code_change"]).meta({ id: "EventKind" });
15685
+ var EventKind = external_exports.enum(["prompt", "response", "code_change", "tool_use"]).meta({ id: "EventKind" });
15681
15686
  var SourceTool = external_exports.enum(["claude-code", "claude-desktop", "cursor", "chatgpt", "github-copilot", "cli", "unknown"]).meta({ id: "SourceTool" });
15682
15687
  var EventMetadata = external_exports.object({
15683
15688
  sessionId: external_exports.string().optional(),
@@ -15990,7 +15995,7 @@ var DetectionException = external_exports.object({
15990
15995
  justification: external_exports.string().min(1),
15991
15996
  conditions: ExceptionConditions.nullable(),
15992
15997
  createdBy: external_exports.string(),
15993
- createdVia: external_exports.enum(["cli-approve", "cli-add", "web-approve", "web-add", "api"]),
15998
+ createdVia: external_exports.enum(["cli-approve", "cli-add", "web-approve", "web-add", "api", "setup-triage"]),
15994
15999
  createdAt: external_exports.iso.datetime(),
15995
16000
  updatedAt: external_exports.iso.datetime(),
15996
16001
  // Revocation is terminal and retained — consumed/expired/revoked rows are
@@ -16161,6 +16166,24 @@ var PolicyBundle = external_exports.object({
16161
16166
  }).meta({ id: "PolicyBundle" });
16162
16167
  var OBSERVE_ONLY_CATEGORIES = ["config"];
16163
16168
  var ENFORCEABLE_CATEGORIES = DetectionCategory.options.filter((c) => !OBSERVE_ONLY_CATEGORIES.includes(c));
16169
+ var CATEGORY_PEAK_SEVERITY = {
16170
+ secret: "critical",
16171
+ financial: "critical",
16172
+ // core-financial/credit-card
16173
+ code_flaw: "critical",
16174
+ pii: "high",
16175
+ phi: "high",
16176
+ custom: "high",
16177
+ // user-defined; conservative
16178
+ code_context: "low",
16179
+ config: "low"
16180
+ // observe-only; floors to monitor regardless
16181
+ };
16182
+ function severityFloorPolicy(category) {
16183
+ if (OBSERVE_ONLY_CATEGORIES.includes(category)) return "monitor";
16184
+ const peak = CATEGORY_PEAK_SEVERITY[category];
16185
+ return peak === "critical" || peak === "high" ? "warn" : "monitor";
16186
+ }
16164
16187
  var PolicyKind = external_exports.enum(["builtin", "custom"]).meta({ id: "PolicyKind" });
16165
16188
  var KNOWN_BUILTIN_IDS = ["monitor", "warn", "redact", "block"];
16166
16189
  var BuiltinPolicyId = external_exports.enum(KNOWN_BUILTIN_IDS).meta({ id: "BuiltinPolicyId" });
@@ -16186,6 +16209,12 @@ var BUILTIN_POLICY_SPECS = {
16186
16209
  description: "Refuse the request entirely whenever any rule in this detection matches."
16187
16210
  }
16188
16211
  };
16212
+ function builtinPolicyToAction(id) {
16213
+ return BUILTIN_POLICY_SPECS[id].action;
16214
+ }
16215
+ var DEFAULT_ACTIONS = Object.fromEntries(
16216
+ DetectionCategory.options.map((c) => [c, builtinPolicyToAction(severityFloorPolicy(c))])
16217
+ );
16189
16218
  var BUILTIN_POLICIES = Object.fromEntries(
16190
16219
  KNOWN_BUILTIN_IDS.map((id) => [id, { id, ...BUILTIN_POLICY_SPECS[id] }])
16191
16220
  );
@@ -16885,6 +16914,36 @@ var ExportSharesQuery = external_exports.object({
16885
16914
  kind: external_exports.array(DestinationKind).optional()
16886
16915
  });
16887
16916
 
16917
+ // ../../packages/schema/src/zod/triage.ts
16918
+ var TriageHit = external_exports.object({
16919
+ ruleId: external_exports.string(),
16920
+ category: DetectionCategory,
16921
+ severity: Severity,
16922
+ maskedMatch: external_exports.string(),
16923
+ rawMatch: external_exports.string(),
16924
+ context: external_exports.string(),
16925
+ filePath: external_exports.string().optional(),
16926
+ confidence: external_exports.number().min(0).max(1),
16927
+ id: external_exports.string().optional(),
16928
+ valueFingerprint: external_exports.string().optional(),
16929
+ keyVersion: external_exports.number().int().nonnegative().optional()
16930
+ });
16931
+ var TriagePolicy = BuiltinPolicyId;
16932
+ var TriageCategoryRec = external_exports.object({
16933
+ category: DetectionCategory,
16934
+ action: TriagePolicy,
16935
+ reasoning: external_exports.string(),
16936
+ genuineCount: external_exports.number().int().nonnegative(),
16937
+ fpCount: external_exports.number().int().nonnegative(),
16938
+ // TriageHit ids judged false-positive in this category. fpCount must equal
16939
+ // this array's length — enforced by the consumer, not this schema.
16940
+ fpIds: external_exports.array(external_exports.string())
16941
+ });
16942
+ var TriageRecommendation = external_exports.object({
16943
+ perCategory: external_exports.array(TriageCategoryRec),
16944
+ notes: external_exports.string()
16945
+ });
16946
+
16888
16947
  // ../../packages/persistence/src/ids.ts
16889
16948
  import { createHash } from "crypto";
16890
16949
 
@@ -16934,6 +16993,10 @@ import { join as join3 } from "path";
16934
16993
  import { readFileSync as readFileSync2, renameSync as renameSync4, writeFileSync as writeFileSync2 } from "fs";
16935
16994
  import { join as join4 } from "path";
16936
16995
 
16996
+ // ../../packages/persistence/src/warn-era-cap.ts
16997
+ import { existsSync as existsSync2, writeFileSync as writeFileSync3 } from "fs";
16998
+ import { join as join5 } from "path";
16999
+
16937
17000
  // ../../packages/plugin-sdk/src/provider-env.ts
16938
17001
  var booleanish = external_exports.string().optional().transform((v) => {
16939
17002
  if (v === void 0) return void 0;
@@ -16955,7 +17018,7 @@ var ProviderEnvSchema = external_exports.object(providerEnvShape);
16955
17018
  // ../../packages/plugin-sdk/src/config-inventory.ts
16956
17019
  import { readdirSync, readFileSync as readFileSync4, realpathSync, statSync as statSync2 } from "fs";
16957
17020
  import { homedir as homedir2 } from "os";
16958
- import { basename as basename2, join as join6 } from "path";
17021
+ import { basename as basename2, join as join7 } from "path";
16959
17022
 
16960
17023
  // ../../packages/detections/src/matchers/keyword.ts
16961
17024
  var KeywordMatcher2 = class {
@@ -17063,8 +17126,8 @@ var CONFIG_POSTURE_RULES = [
17063
17126
  ];
17064
17127
 
17065
17128
  // ../../packages/plugin-sdk/src/repo.ts
17066
- import { existsSync as existsSync2, readFileSync as readFileSync3, statSync } from "fs";
17067
- import { basename, dirname, isAbsolute, join as join5, sep as sep2 } from "path";
17129
+ import { existsSync as existsSync3, readFileSync as readFileSync3, statSync } from "fs";
17130
+ import { basename, dirname, isAbsolute, join as join6, sep as sep2 } from "path";
17068
17131
 
17069
17132
  // ../../packages/plugin-sdk/src/events.ts
17070
17133
  import { createHash as createHash3, randomUUID as randomUUID9 } from "crypto";
@@ -17076,20 +17139,23 @@ import { createHash as createHash4 } from "crypto";
17076
17139
  import { arch, hostname as hostname3, platform, release } from "os";
17077
17140
 
17078
17141
  // ../../packages/plugin-sdk/src/nudge.ts
17079
- import { mkdirSync as mkdirSync3, readFileSync as readFileSync5, writeFileSync as writeFileSync3 } from "fs";
17080
- import { join as join7 } from "path";
17142
+ import { mkdirSync as mkdirSync3, readFileSync as readFileSync5, writeFileSync as writeFileSync4 } from "fs";
17143
+ import { join as join8 } from "path";
17081
17144
 
17082
17145
  // ../../packages/plugin-sdk/src/project-files.ts
17083
17146
  var import_ignore = __toESM(require_ignore(), 1);
17084
- import { existsSync as existsSync3, readdirSync as readdirSync2, readFileSync as readFileSync6 } from "fs";
17085
- import { basename as basename3, join as join8, relative, sep as sep3 } from "path";
17147
+ import { existsSync as existsSync4, readdirSync as readdirSync2, readFileSync as readFileSync6 } from "fs";
17148
+ import { basename as basename3, join as join9, relative, sep as sep3 } from "path";
17086
17149
 
17087
17150
  // ../../packages/plugin-sdk/src/runtime.ts
17088
17151
  import { randomUUID as randomUUID10 } from "crypto";
17089
17152
 
17153
+ // ../../packages/plugin-sdk/src/suppressions.ts
17154
+ var THIRTY_DAYS_MS = 30 * 24 * 60 * 60 * 1e3;
17155
+
17090
17156
  // ../../packages/plugin-sdk/src/throttle.ts
17091
- import { mkdirSync as mkdirSync4, statSync as statSync3, writeFileSync as writeFileSync4 } from "fs";
17092
- import { join as join9 } from "path";
17157
+ import { mkdirSync as mkdirSync4, statSync as statSync3, writeFileSync as writeFileSync5 } from "fs";
17158
+ import { join as join10 } from "path";
17093
17159
 
17094
17160
  // src/render.ts
17095
17161
  var SEVERITY_GLYPH = {
@@ -17098,6 +17164,7 @@ var SEVERITY_GLYPH = {
17098
17164
  medium: SHADE.medium,
17099
17165
  low: SHADE.light
17100
17166
  };
17167
+ var CATEGORY_ORDER = DetectionCategory.options;
17101
17168
  function renderSetupIntro(meta3) {
17102
17169
  const heading = `\u25CF Found ${meta3.name} \u2014 ${meta3.tagline}`;
17103
17170
  const details = defList([