@akasecurity/ai-tc-claude-code 0.9.4 → 0.9.5
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/.claude-plugin/plugin.json +1 -1
- package/README.md +4 -0
- package/package.json +4 -3
- package/scripts/apply-suppressions.js +1607 -534
- package/scripts/backfill.js +1969 -390
- package/scripts/filescan.js +1863 -346
- package/scripts/firstrun.js +1307 -223
- package/scripts/intro.js +370 -54
- package/scripts/message-display.js +1406 -297
- package/scripts/onboard.js +1532 -245
- package/scripts/post-tool-use.js +1885 -356
- package/scripts/pre-tool-use.js +1900 -365
- package/scripts/query.js +1306 -222
- package/scripts/reconcile.js +1435 -326
- package/scripts/remediate.js +2121 -546
- package/scripts/scan-worker.js +18006 -0
- package/scripts/session-start.js +1350 -312
- package/scripts/start-light.js +390 -74
- package/scripts/statusline.js +1306 -222
- package/scripts/stop.js +352 -79
- package/scripts/user-prompt-submit.js +1897 -368
package/scripts/start-light.js
CHANGED
|
@@ -492,13 +492,12 @@ var require_ignore = __commonJS({
|
|
|
492
492
|
});
|
|
493
493
|
|
|
494
494
|
// ../../packages/plugin-sdk/src/config.ts
|
|
495
|
-
import { existsSync as
|
|
496
|
-
import { join as
|
|
495
|
+
import { existsSync as existsSync5 } from "fs";
|
|
496
|
+
import { join as join8 } from "path";
|
|
497
497
|
|
|
498
498
|
// ../../packages/persistence/src/database.ts
|
|
499
|
-
import { randomUUID as
|
|
500
|
-
import {
|
|
501
|
-
import { join, sep } from "path";
|
|
499
|
+
import { randomUUID as randomUUID10 } from "crypto";
|
|
500
|
+
import { join as join2, sep } from "path";
|
|
502
501
|
import { DatabaseSync } from "node:sqlite";
|
|
503
502
|
|
|
504
503
|
// ../../packages/schema/src/exception-scope.ts
|
|
@@ -15093,7 +15092,17 @@ var Finding = external_exports.object({
|
|
|
15093
15092
|
}).meta({ id: "Finding" });
|
|
15094
15093
|
var DetectedFinding = Finding.meta({ id: "DetectedFinding" });
|
|
15095
15094
|
var FindingAction = external_exports.enum(["blocked", "redacted", "warned", "allowed", "quarantined", "monitored"]).meta({ id: "FindingAction" });
|
|
15096
|
-
var FindingProvider = external_exports.enum([
|
|
15095
|
+
var FindingProvider = external_exports.enum([
|
|
15096
|
+
"claudecode",
|
|
15097
|
+
"claudedesktop",
|
|
15098
|
+
"cursor",
|
|
15099
|
+
"copilot",
|
|
15100
|
+
"chatgpt",
|
|
15101
|
+
"claudeai",
|
|
15102
|
+
"codex",
|
|
15103
|
+
"antigravity",
|
|
15104
|
+
"api"
|
|
15105
|
+
]).meta({ id: "FindingProvider" });
|
|
15097
15106
|
var FindingCategory = external_exports.enum([
|
|
15098
15107
|
"secret",
|
|
15099
15108
|
"pii",
|
|
@@ -15147,7 +15156,16 @@ var FindingInstance = external_exports.object({
|
|
|
15147
15156
|
confidence: external_exports.number().min(0).max(1),
|
|
15148
15157
|
// Lifecycle status (see FindingStatus). Optional so legacy callers/rows
|
|
15149
15158
|
// that predate the resolution feature stay valid.
|
|
15150
|
-
status: FindingStatus.optional()
|
|
15159
|
+
status: FindingStatus.optional(),
|
|
15160
|
+
// The audit event this finding was captured from. Optional so callers that
|
|
15161
|
+
// do not project it stay valid. An at-rest finding is content-addressed by
|
|
15162
|
+
// finding_key and its row is upserted on re-detection, so this names the
|
|
15163
|
+
// MOST RECENT detection event, not the first.
|
|
15164
|
+
eventId: external_exports.string().optional(),
|
|
15165
|
+
// The session that event belongs to, when it has one — the seam a
|
|
15166
|
+
// per-instance "view session" link needs. Absent for events captured
|
|
15167
|
+
// outside a session.
|
|
15168
|
+
sessionId: external_exports.string().optional()
|
|
15151
15169
|
}).meta({ id: "FindingInstance" });
|
|
15152
15170
|
var FindingGroup = external_exports.object({
|
|
15153
15171
|
id: external_exports.string(),
|
|
@@ -15191,7 +15209,11 @@ var FindingFacets = external_exports.object({
|
|
|
15191
15209
|
// for every instance, so every group lands in a bucket; a status-less
|
|
15192
15210
|
// group (possible only for callers whose rows carry no statuses) is
|
|
15193
15211
|
// counted under no value.
|
|
15194
|
-
status: external_exports.array(FindingFacetItem)
|
|
15212
|
+
status: external_exports.array(FindingFacetItem),
|
|
15213
|
+
// Host tool (attributes.tool_name). Present only on the instance-level
|
|
15214
|
+
// reads, which can filter by it; the grouped read omits the dimension
|
|
15215
|
+
// because a group spans tools.
|
|
15216
|
+
tool: external_exports.array(FindingFacetItem).optional()
|
|
15195
15217
|
}).meta({ id: "FindingFacets" });
|
|
15196
15218
|
var ListGroupedFindingsQuery = external_exports.object({
|
|
15197
15219
|
// NOTE: severity filters by Severity (critical/high/medium/low), not by
|
|
@@ -15208,6 +15230,16 @@ var ListGroupedFindingsQuery = external_exports.object({
|
|
|
15208
15230
|
// Scope to findings whose event carries this session id (the Activity page's
|
|
15209
15231
|
// session → findings drilldown). Findings without a session never match.
|
|
15210
15232
|
sessionId: external_exports.string().optional(),
|
|
15233
|
+
// Inclusive lower bound on the parent event's timestamp, so a caller arriving
|
|
15234
|
+
// from a time-scoped page (Activity's range) can carry that scope. Absent
|
|
15235
|
+
// means all time — this list has no default window.
|
|
15236
|
+
from: external_exports.iso.datetime().optional(),
|
|
15237
|
+
// A group or instance id that must appear in the page even when the cursor
|
|
15238
|
+
// has already advanced past its sort position. This is what keeps the
|
|
15239
|
+
// Findings page's one-shot ?finding= deep link resolving once the list
|
|
15240
|
+
// paginates: the target group is appended out of sort order rather than
|
|
15241
|
+
// scanning forward for it. Never affects totals, facets or the cursor.
|
|
15242
|
+
includeId: external_exports.string().optional(),
|
|
15211
15243
|
groupBy: external_exports.literal("type").optional(),
|
|
15212
15244
|
limit: external_exports.coerce.number().int().min(1).max(100).optional(),
|
|
15213
15245
|
cursor: external_exports.string().optional()
|
|
@@ -15252,9 +15284,100 @@ var FindingInstanceDetail = FindingInstance.extend({
|
|
|
15252
15284
|
detection: FindingDetectionRef,
|
|
15253
15285
|
policy: FindingPolicyRef
|
|
15254
15286
|
}).meta({ id: "FindingInstanceDetail" });
|
|
15287
|
+
var ListFindingInstancesQuery = external_exports.object({
|
|
15288
|
+
severity: external_exports.array(Severity).optional(),
|
|
15289
|
+
// Rule ids, the same vocabulary the grouped list's `subtype` carries.
|
|
15290
|
+
subtype: external_exports.array(external_exports.string()).optional(),
|
|
15291
|
+
provider: external_exports.array(FindingProvider).optional(),
|
|
15292
|
+
action: external_exports.array(FindingAction).optional(),
|
|
15293
|
+
// Matches each instance's OWN derived status (deriveFindingStatus), unlike
|
|
15294
|
+
// the grouped query's group-level fold.
|
|
15295
|
+
status: external_exports.array(FindingStatus).optional(),
|
|
15296
|
+
// Exact host-tool names (attributes.tool_name, e.g. 'Bash'). A real filter,
|
|
15297
|
+
// where the free-text `q` can only match the rendered "via Bash" label.
|
|
15298
|
+
tool: external_exports.array(external_exports.string()).optional(),
|
|
15299
|
+
// Exact repository / file-path matches, for the drill-down out of the
|
|
15300
|
+
// locations view. A row whose event carries no repo/file matches neither.
|
|
15301
|
+
repo: external_exports.string().optional(),
|
|
15302
|
+
file: external_exports.string().optional(),
|
|
15303
|
+
q: external_exports.string().optional(),
|
|
15304
|
+
sessionId: external_exports.string().optional(),
|
|
15305
|
+
from: external_exports.iso.datetime().optional(),
|
|
15306
|
+
limit: external_exports.coerce.number().int().min(1).max(200).optional(),
|
|
15307
|
+
cursor: external_exports.string().optional()
|
|
15308
|
+
});
|
|
15309
|
+
var ListFindingInstancesResponse = external_exports.object({
|
|
15310
|
+
// Instances matching the filters across the whole scope, not just this
|
|
15311
|
+
// page — cursor-independent, like the grouped list's totals.
|
|
15312
|
+
totals: external_exports.object({ findings: external_exports.number().int().nonnegative() }),
|
|
15313
|
+
// Counts in INSTANCES here, where the grouped response counts groups. Each
|
|
15314
|
+
// dimension still excludes its own filter.
|
|
15315
|
+
facets: FindingFacets,
|
|
15316
|
+
items: external_exports.array(FindingInstanceDetail),
|
|
15317
|
+
nextCursor: external_exports.string().nullable()
|
|
15318
|
+
}).meta({ id: "ListFindingInstancesResponse" });
|
|
15319
|
+
var FindingLocationFile = external_exports.object({
|
|
15320
|
+
// Empty when the instances carried no file path (a prompt or a tool call
|
|
15321
|
+
// with no file attribution).
|
|
15322
|
+
file: external_exports.string(),
|
|
15323
|
+
instanceCount: external_exports.number().int().nonnegative(),
|
|
15324
|
+
maxSeverity: Severity,
|
|
15325
|
+
latestDetectedAt: external_exports.iso.datetime(),
|
|
15326
|
+
// Folded from the instances' derived statuses with the same
|
|
15327
|
+
// open-dominates precedence a group uses.
|
|
15328
|
+
status: FindingStatus.optional(),
|
|
15329
|
+
// Distinct rules seen at this location, capped — the row shows them as
|
|
15330
|
+
// chips, and the count is what conveys scale.
|
|
15331
|
+
ruleIds: external_exports.array(external_exports.string())
|
|
15332
|
+
}).meta({ id: "FindingLocationFile" });
|
|
15333
|
+
var FindingLocationRepo = external_exports.object({
|
|
15334
|
+
/** Empty when the instances carried no repo attribute. */
|
|
15335
|
+
repo: external_exports.string(),
|
|
15336
|
+
instanceCount: external_exports.number().int().nonnegative(),
|
|
15337
|
+
maxSeverity: Severity,
|
|
15338
|
+
latestDetectedAt: external_exports.iso.datetime(),
|
|
15339
|
+
status: FindingStatus.optional(),
|
|
15340
|
+
files: external_exports.array(FindingLocationFile)
|
|
15341
|
+
}).meta({ id: "FindingLocationRepo" });
|
|
15342
|
+
var ListFindingLocationsQuery = external_exports.object({
|
|
15343
|
+
severity: external_exports.array(Severity).optional(),
|
|
15344
|
+
subtype: external_exports.array(external_exports.string()).optional(),
|
|
15345
|
+
provider: external_exports.array(FindingProvider).optional(),
|
|
15346
|
+
action: external_exports.array(FindingAction).optional(),
|
|
15347
|
+
// Per-instance, as in ListFindingInstancesQuery: a location keeps the
|
|
15348
|
+
// instances that match, and folds its status from those.
|
|
15349
|
+
status: external_exports.array(FindingStatus).optional(),
|
|
15350
|
+
tool: external_exports.array(external_exports.string()).optional(),
|
|
15351
|
+
q: external_exports.string().optional(),
|
|
15352
|
+
sessionId: external_exports.string().optional(),
|
|
15353
|
+
from: external_exports.iso.datetime().optional(),
|
|
15354
|
+
limit: external_exports.coerce.number().int().min(1).max(500).optional()
|
|
15355
|
+
});
|
|
15356
|
+
var ListFindingLocationsResponse = external_exports.object({
|
|
15357
|
+
totals: external_exports.object({
|
|
15358
|
+
findings: external_exports.number().int().nonnegative(),
|
|
15359
|
+
repos: external_exports.number().int().nonnegative(),
|
|
15360
|
+
files: external_exports.number().int().nonnegative()
|
|
15361
|
+
}),
|
|
15362
|
+
/** Sorted by max severity, then most recent. */
|
|
15363
|
+
items: external_exports.array(FindingLocationRepo),
|
|
15364
|
+
/** Whether `limit` truncated the repo list. */
|
|
15365
|
+
hasMore: external_exports.boolean()
|
|
15366
|
+
}).meta({ id: "ListFindingLocationsResponse" });
|
|
15255
15367
|
|
|
15256
15368
|
// ../../packages/schema/src/zod/harness-map.ts
|
|
15257
|
-
var Harness = external_exports.enum([
|
|
15369
|
+
var Harness = external_exports.enum([
|
|
15370
|
+
"claudecode",
|
|
15371
|
+
"cursor",
|
|
15372
|
+
"copilot",
|
|
15373
|
+
"codex",
|
|
15374
|
+
"antigravity",
|
|
15375
|
+
"windsurf",
|
|
15376
|
+
"claudedesktop",
|
|
15377
|
+
"chatgpt",
|
|
15378
|
+
"claudeai",
|
|
15379
|
+
"api"
|
|
15380
|
+
]).meta({ id: "Harness" });
|
|
15258
15381
|
|
|
15259
15382
|
// ../../packages/schema/src/zod/meta.ts
|
|
15260
15383
|
var InventoryObjectType = external_exports.enum(["host", "harness", "user", "skill", "hook", "mcp_server", "config_file"]).meta({ id: "InventoryObjectType" });
|
|
@@ -15708,7 +15831,18 @@ var ActivityOverviewResponse = external_exports.object({
|
|
|
15708
15831
|
// ../../packages/schema/src/zod/event.ts
|
|
15709
15832
|
var EventKind = external_exports.enum(["prompt", "response", "code_change", "tool_use"]).meta({ id: "EventKind" });
|
|
15710
15833
|
var CAPTURE_EVENT_TYPES_SQL = EventKind.options.map((k) => `'${k}'`).join(",");
|
|
15711
|
-
var SourceTool = external_exports.enum([
|
|
15834
|
+
var SourceTool = external_exports.enum([
|
|
15835
|
+
"claude-code",
|
|
15836
|
+
"claude-desktop",
|
|
15837
|
+
"cursor",
|
|
15838
|
+
"chatgpt",
|
|
15839
|
+
"claude-ai",
|
|
15840
|
+
"github-copilot",
|
|
15841
|
+
"codex",
|
|
15842
|
+
"antigravity",
|
|
15843
|
+
"cli",
|
|
15844
|
+
"unknown"
|
|
15845
|
+
]).meta({ id: "SourceTool" });
|
|
15712
15846
|
var EventMetadata = external_exports.object({
|
|
15713
15847
|
sessionId: external_exports.string().optional(),
|
|
15714
15848
|
repo: external_exports.string().optional(),
|
|
@@ -15779,7 +15913,7 @@ var TrustLevel = external_exports.enum(["known-good", "risky", "unapproved"]).me
|
|
|
15779
15913
|
var Flag = external_exports.enum(["update", "stale", "conflict", "unknown", "change", "untracked", "risk", "findings"]).meta({ id: "Flag" });
|
|
15780
15914
|
var Visibility = external_exports.enum(["public", "private"]).meta({ id: "Visibility" });
|
|
15781
15915
|
var HarnessEventKind = external_exports.enum(["block", "redact", "warn"]).meta({ id: "HarnessEventKind" });
|
|
15782
|
-
var HarnessId = external_exports.enum(["claudecode", "cursor", "codex"]).meta({ id: "HarnessId" });
|
|
15916
|
+
var HarnessId = external_exports.enum(["claudecode", "cursor", "codex", "antigravity"]).meta({ id: "HarnessId" });
|
|
15783
15917
|
var AccessCounts = external_exports.object({
|
|
15784
15918
|
open: external_exports.number().int().nonnegative(),
|
|
15785
15919
|
approved: external_exports.number().int().nonnegative(),
|
|
@@ -16048,6 +16182,7 @@ var ExceptionBundleEntry = DetectionException.pick({
|
|
|
16048
16182
|
useCount: true,
|
|
16049
16183
|
conditions: true
|
|
16050
16184
|
});
|
|
16185
|
+
var ExceptionDescriptor = DetectionException.omit({ valueFingerprint: true });
|
|
16051
16186
|
|
|
16052
16187
|
// ../../packages/schema/src/zod/rule.ts
|
|
16053
16188
|
var MatcherType = external_exports.enum(["keyword", "regex", "validator"]).meta({ id: "MatcherType" });
|
|
@@ -16779,6 +16914,35 @@ var EgressWriteSummary = external_exports.object({
|
|
|
16779
16914
|
droppedFiles: external_exports.array(external_exports.string()).default([])
|
|
16780
16915
|
}).meta({ id: "EgressWriteSummary" });
|
|
16781
16916
|
|
|
16917
|
+
// ../../packages/schema/src/zod/exception-action.ts
|
|
16918
|
+
var confirmation = external_exports.string().optional();
|
|
16919
|
+
var ApproveBlockedInput = external_exports.object({
|
|
16920
|
+
reference: external_exports.string(),
|
|
16921
|
+
scope: external_exports.string(),
|
|
16922
|
+
reason: external_exports.string(),
|
|
16923
|
+
confirmation
|
|
16924
|
+
});
|
|
16925
|
+
var AddExceptionInput = external_exports.object({
|
|
16926
|
+
ruleId: external_exports.string(),
|
|
16927
|
+
value: external_exports.string(),
|
|
16928
|
+
scope: external_exports.string(),
|
|
16929
|
+
reason: external_exports.string(),
|
|
16930
|
+
confirmation
|
|
16931
|
+
});
|
|
16932
|
+
var GrantRevealInput = external_exports.object({
|
|
16933
|
+
pointer: external_exports.string(),
|
|
16934
|
+
scope: external_exports.string(),
|
|
16935
|
+
justification: external_exports.string(),
|
|
16936
|
+
confirmation
|
|
16937
|
+
});
|
|
16938
|
+
var RevokeExceptionInput = external_exports.object({
|
|
16939
|
+
id: external_exports.string(),
|
|
16940
|
+
reason: external_exports.string()
|
|
16941
|
+
});
|
|
16942
|
+
var RotateKeyInput = external_exports.object({
|
|
16943
|
+
confirmation: external_exports.string()
|
|
16944
|
+
});
|
|
16945
|
+
|
|
16782
16946
|
// ../../packages/schema/src/zod/installed-pack.ts
|
|
16783
16947
|
var InstalledPack = external_exports.object({
|
|
16784
16948
|
id: external_exports.guid(),
|
|
@@ -16910,6 +17074,48 @@ var VaultInventoryEntry = external_exports.object({
|
|
|
16910
17074
|
revealGrantId: external_exports.string().nullable(),
|
|
16911
17075
|
sightings: external_exports.array(VaultSighting)
|
|
16912
17076
|
});
|
|
17077
|
+
var MAX_VAULT_PAGE_LIMIT = 200;
|
|
17078
|
+
var ListVaultInventoryQuery = external_exports.object({
|
|
17079
|
+
limit: external_exports.coerce.number().int().min(1).max(MAX_VAULT_PAGE_LIMIT).optional(),
|
|
17080
|
+
// Opaque; names the last row of the page just served.
|
|
17081
|
+
cursor: external_exports.string().optional()
|
|
17082
|
+
});
|
|
17083
|
+
var ListVaultInventoryResponse = external_exports.object({
|
|
17084
|
+
// Vaulted values across the whole store, not just this page — cursor-
|
|
17085
|
+
// independent, so paging never changes what the count claims.
|
|
17086
|
+
totals: external_exports.object({ values: external_exports.number().int().nonnegative() }),
|
|
17087
|
+
items: external_exports.array(VaultInventoryEntry),
|
|
17088
|
+
// `null` once the last page is reached.
|
|
17089
|
+
nextCursor: external_exports.string().nullable()
|
|
17090
|
+
});
|
|
17091
|
+
var ListVaultReuseQuery = external_exports.object({
|
|
17092
|
+
limit: external_exports.coerce.number().int().min(1).max(MAX_VAULT_PAGE_LIMIT).optional(),
|
|
17093
|
+
cursor: external_exports.string().optional()
|
|
17094
|
+
});
|
|
17095
|
+
var ListVaultReuseResponse = external_exports.object({
|
|
17096
|
+
// Reused values across the whole store — the number the section's claim
|
|
17097
|
+
// ("values detected in more than one place") is about.
|
|
17098
|
+
totals: external_exports.object({ reused: external_exports.number().int().nonnegative() }),
|
|
17099
|
+
items: external_exports.array(VaultInventoryEntry),
|
|
17100
|
+
nextCursor: external_exports.string().nullable()
|
|
17101
|
+
});
|
|
17102
|
+
var ListVaultDerefsQuery = external_exports.object({
|
|
17103
|
+
// Include the batched, high-volume reasons (display, view-render). Omitted
|
|
17104
|
+
// hides them and counts them into `hiddenBatched` instead, so the model
|
|
17105
|
+
// crossings stay visible. A real boolean, not `z.stringbool()`: this arrives
|
|
17106
|
+
// over a Server Action, which preserves the type, never as a URL param.
|
|
17107
|
+
includeBatched: external_exports.boolean().optional(),
|
|
17108
|
+
limit: external_exports.coerce.number().int().min(1).max(MAX_VAULT_PAGE_LIMIT).optional(),
|
|
17109
|
+
cursor: external_exports.string().optional()
|
|
17110
|
+
});
|
|
17111
|
+
var ListVaultDerefsResponse = external_exports.object({
|
|
17112
|
+
items: external_exports.array(VaultDeref),
|
|
17113
|
+
nextCursor: external_exports.string().nullable(),
|
|
17114
|
+
// Display/view-render rows the query hid, over the WHOLE trail rather than
|
|
17115
|
+
// this page — it is the count the "N hidden" line and its toggle speak for.
|
|
17116
|
+
// Always 0 when `includeBatched` was set, since nothing was hidden.
|
|
17117
|
+
hiddenBatched: external_exports.number().int().nonnegative()
|
|
17118
|
+
});
|
|
16913
17119
|
var VaultKeyCustody = external_exports.string();
|
|
16914
17120
|
var VaultInlineReveal = external_exports.enum(["masked", "full", "off"]);
|
|
16915
17121
|
var VaultConsent = external_exports.object({
|
|
@@ -17166,7 +17372,7 @@ var TopSourcesQuery = external_exports.object({
|
|
|
17166
17372
|
// Omit for both kinds.
|
|
17167
17373
|
kind: external_exports.enum(SOURCE_KINDS).optional()
|
|
17168
17374
|
});
|
|
17169
|
-
var Provider = external_exports.enum(["claudecode", "cursor", "codex", "chatgpt", "copilot", "api"]).meta({ id: "Provider" });
|
|
17375
|
+
var Provider = external_exports.enum(["claudecode", "cursor", "codex", "antigravity", "claudeai", "chatgpt", "copilot", "api"]).meta({ id: "Provider" });
|
|
17170
17376
|
var ScanCoverageProvider = external_exports.object({
|
|
17171
17377
|
provider: Provider,
|
|
17172
17378
|
// Percent of that provider's traffic scanned in the window. 0 when unsupported.
|
|
@@ -17334,14 +17540,31 @@ var SetupHandoffOffer = external_exports.object({
|
|
|
17334
17540
|
// ../../packages/persistence/src/ids.ts
|
|
17335
17541
|
import { createHash } from "crypto";
|
|
17336
17542
|
|
|
17543
|
+
// ../../packages/persistence/src/internal/snapshot.ts
|
|
17544
|
+
import { randomUUID } from "crypto";
|
|
17545
|
+
import { existsSync, readdirSync, renameSync as renameSync2, rmSync as rmSync2, statSync } from "fs";
|
|
17546
|
+
import { basename, dirname, join } from "path";
|
|
17547
|
+
|
|
17337
17548
|
// ../../packages/persistence/src/paths.ts
|
|
17338
|
-
import {
|
|
17549
|
+
import {
|
|
17550
|
+
chmodSync,
|
|
17551
|
+
linkSync,
|
|
17552
|
+
lstatSync,
|
|
17553
|
+
mkdirSync,
|
|
17554
|
+
renameSync,
|
|
17555
|
+
rmSync,
|
|
17556
|
+
writeFileSync
|
|
17557
|
+
} from "fs";
|
|
17558
|
+
import { threadId } from "worker_threads";
|
|
17559
|
+
|
|
17560
|
+
// ../../packages/persistence/src/internal/snapshot.ts
|
|
17561
|
+
var STALE_PARTIAL_MS = 5 * 6e4;
|
|
17339
17562
|
|
|
17340
17563
|
// ../../packages/persistence/src/repositories/activity.ts
|
|
17341
17564
|
var LIVE_ACTIVITY_WINDOW_MS = 30 * 6e4;
|
|
17342
17565
|
|
|
17343
17566
|
// ../../packages/persistence/src/repositories/exceptions.ts
|
|
17344
|
-
import { randomUUID } from "crypto";
|
|
17567
|
+
import { randomUUID as randomUUID2 } from "crypto";
|
|
17345
17568
|
var BLOCKED_DETECTIONS_TTL_MS = 30 * 60 * 1e3;
|
|
17346
17569
|
var BLOCKED_DETECTIONS_RETENTION_MS = 24 * 60 * 60 * 1e3;
|
|
17347
17570
|
var ACTIVE_PREDICATE = `revoked_at IS NULL
|
|
@@ -17352,46 +17575,60 @@ var ACTIVE_REVEAL_GRANT_PREDICATE = `capability = 'reveal_to_model'
|
|
|
17352
17575
|
AND ${ACTIVE_PREDICATE}`;
|
|
17353
17576
|
|
|
17354
17577
|
// ../../packages/persistence/src/repositories/installed-packs.ts
|
|
17355
|
-
import { createHash as createHash2, randomUUID as
|
|
17578
|
+
import { createHash as createHash2, randomUUID as randomUUID3 } from "crypto";
|
|
17356
17579
|
|
|
17357
17580
|
// ../../packages/persistence/src/repositories/inventory-assets.ts
|
|
17358
|
-
import { randomUUID as
|
|
17581
|
+
import { randomUUID as randomUUID4 } from "crypto";
|
|
17359
17582
|
var VALID_HARNESS_IDS = new Set(HarnessId.options);
|
|
17360
17583
|
var HARNESS_LIVENESS_WINDOW_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
17361
17584
|
|
|
17362
17585
|
// ../../packages/persistence/src/repositories/policies.ts
|
|
17363
|
-
import { randomUUID as
|
|
17586
|
+
import { randomUUID as randomUUID5 } from "crypto";
|
|
17364
17587
|
|
|
17365
17588
|
// ../../packages/persistence/src/repositories/project-files.ts
|
|
17366
|
-
import { randomUUID as
|
|
17589
|
+
import { randomUUID as randomUUID6 } from "crypto";
|
|
17367
17590
|
|
|
17368
17591
|
// ../../packages/persistence/src/repositories/resolutions.ts
|
|
17369
|
-
import { randomUUID as
|
|
17592
|
+
import { randomUUID as randomUUID7 } from "crypto";
|
|
17370
17593
|
|
|
17371
17594
|
// ../../packages/persistence/src/repositories/secret-vault.ts
|
|
17372
|
-
import { randomUUID as
|
|
17595
|
+
import { randomUUID as randomUUID8 } from "crypto";
|
|
17373
17596
|
|
|
17374
17597
|
// ../../packages/persistence/src/repositories/shares.ts
|
|
17375
|
-
import { randomUUID as
|
|
17598
|
+
import { randomUUID as randomUUID9 } from "crypto";
|
|
17599
|
+
|
|
17600
|
+
// ../../packages/persistence/src/file-lock.ts
|
|
17601
|
+
import { randomUUID as randomUUID11 } from "crypto";
|
|
17602
|
+
import {
|
|
17603
|
+
closeSync,
|
|
17604
|
+
existsSync as existsSync2,
|
|
17605
|
+
openSync,
|
|
17606
|
+
readFileSync,
|
|
17607
|
+
rmSync as rmSync3,
|
|
17608
|
+
statSync as statSync2,
|
|
17609
|
+
writeFileSync as writeFileSync2
|
|
17610
|
+
} from "fs";
|
|
17611
|
+
import { hostname as hostname3 } from "os";
|
|
17612
|
+
var PARK = new Int32Array(new SharedArrayBuffer(4));
|
|
17376
17613
|
|
|
17377
17614
|
// ../../packages/persistence/src/finding-key.ts
|
|
17378
17615
|
import { createHash as createHash3 } from "crypto";
|
|
17379
17616
|
|
|
17380
17617
|
// ../../packages/persistence/src/fingerprint.ts
|
|
17381
17618
|
import { createHmac, randomBytes } from "crypto";
|
|
17382
|
-
import { existsSync as
|
|
17383
|
-
import { join as
|
|
17619
|
+
import { existsSync as existsSync3, readFileSync as readFileSync2 } from "fs";
|
|
17620
|
+
import { join as join3 } from "path";
|
|
17384
17621
|
import { DatabaseSync as DatabaseSync2 } from "node:sqlite";
|
|
17385
17622
|
|
|
17386
17623
|
// ../../packages/persistence/src/local-layout.ts
|
|
17387
17624
|
import { renameSync as renameSync3 } from "fs";
|
|
17388
17625
|
import { mkdir } from "fs/promises";
|
|
17389
17626
|
import { homedir } from "os";
|
|
17390
|
-
import { join as
|
|
17627
|
+
import { join as join4 } from "path";
|
|
17391
17628
|
|
|
17392
17629
|
// ../../packages/persistence/src/settings.ts
|
|
17393
|
-
import { readFileSync as
|
|
17394
|
-
import { join as
|
|
17630
|
+
import { readFileSync as readFileSync3 } from "fs";
|
|
17631
|
+
import { join as join5 } from "path";
|
|
17395
17632
|
|
|
17396
17633
|
// ../../packages/persistence/src/vault/crypto.ts
|
|
17397
17634
|
import {
|
|
@@ -17408,20 +17645,20 @@ import { randomBytes as randomBytes2 } from "crypto";
|
|
|
17408
17645
|
import {
|
|
17409
17646
|
chmodSync as chmodSync2,
|
|
17410
17647
|
mkdirSync as mkdirSync2,
|
|
17411
|
-
readFileSync as
|
|
17648
|
+
readFileSync as readFileSync4,
|
|
17412
17649
|
renameSync as renameSync4,
|
|
17413
|
-
rmSync as
|
|
17414
|
-
statSync,
|
|
17415
|
-
writeFileSync as
|
|
17650
|
+
rmSync as rmSync4,
|
|
17651
|
+
statSync as statSync3,
|
|
17652
|
+
writeFileSync as writeFileSync3
|
|
17416
17653
|
} from "fs";
|
|
17417
|
-
import { join as
|
|
17654
|
+
import { join as join6 } from "path";
|
|
17418
17655
|
|
|
17419
17656
|
// ../../packages/persistence/src/vault/vault.ts
|
|
17420
|
-
import { randomBytes as randomBytes3, randomUUID as
|
|
17657
|
+
import { randomBytes as randomBytes3, randomUUID as randomUUID12 } from "crypto";
|
|
17421
17658
|
|
|
17422
17659
|
// ../../packages/persistence/src/warn-era-cap.ts
|
|
17423
|
-
import { existsSync as
|
|
17424
|
-
import { join as
|
|
17660
|
+
import { existsSync as existsSync4, writeFileSync as writeFileSync4 } from "fs";
|
|
17661
|
+
import { join as join7 } from "path";
|
|
17425
17662
|
|
|
17426
17663
|
// ../../packages/plugin-sdk/src/provider-env.ts
|
|
17427
17664
|
var booleanish = external_exports.string().optional().transform((v) => {
|
|
@@ -17442,9 +17679,9 @@ var providerEnvShape = {
|
|
|
17442
17679
|
var ProviderEnvSchema = external_exports.object(providerEnvShape);
|
|
17443
17680
|
|
|
17444
17681
|
// ../../packages/plugin-sdk/src/config-inventory.ts
|
|
17445
|
-
import { readdirSync, readFileSync as
|
|
17682
|
+
import { readdirSync as readdirSync2, readFileSync as readFileSync6, realpathSync, statSync as statSync5 } from "fs";
|
|
17446
17683
|
import { homedir as homedir2 } from "os";
|
|
17447
|
-
import { basename as
|
|
17684
|
+
import { basename as basename3, join as join10 } from "path";
|
|
17448
17685
|
|
|
17449
17686
|
// ../../packages/detections/src/egress/registry.ts
|
|
17450
17687
|
var EXTRACTOR_VERSION = "1";
|
|
@@ -18155,39 +18392,70 @@ var POLYNOMIAL_PROBES = ["abc-", "a.", "a ", "a=", "x", "0", "a@", "a/", "ab"].m
|
|
|
18155
18392
|
);
|
|
18156
18393
|
|
|
18157
18394
|
// ../../packages/plugin-sdk/src/repo.ts
|
|
18158
|
-
import { existsSync as
|
|
18159
|
-
import { basename, dirname, isAbsolute, join as
|
|
18395
|
+
import { existsSync as existsSync6, readFileSync as readFileSync5, statSync as statSync4 } from "fs";
|
|
18396
|
+
import { basename as basename2, dirname as dirname2, isAbsolute, join as join9, sep as sep2 } from "path";
|
|
18160
18397
|
|
|
18161
18398
|
// ../../packages/plugin-sdk/src/events.ts
|
|
18162
|
-
import { createHash as createHash4, randomUUID as
|
|
18399
|
+
import { createHash as createHash4, randomUUID as randomUUID13 } from "crypto";
|
|
18400
|
+
|
|
18401
|
+
// ../../packages/plugin-sdk/src/isolated-scan.ts
|
|
18402
|
+
import { existsSync as existsSync7 } from "fs";
|
|
18403
|
+
import { fileURLToPath } from "url";
|
|
18404
|
+
import { Worker } from "worker_threads";
|
|
18163
18405
|
|
|
18164
18406
|
// ../../packages/plugin-sdk/src/inventory-resolver.ts
|
|
18165
|
-
import { arch, hostname as
|
|
18407
|
+
import { arch, hostname as hostname4, platform, release } from "os";
|
|
18166
18408
|
|
|
18167
18409
|
// ../../packages/plugin-sdk/src/nudge.ts
|
|
18168
|
-
import { mkdirSync as mkdirSync3, readFileSync as
|
|
18169
|
-
import { join as
|
|
18410
|
+
import { mkdirSync as mkdirSync3, readFileSync as readFileSync7, writeFileSync as writeFileSync5 } from "fs";
|
|
18411
|
+
import { join as join11 } from "path";
|
|
18170
18412
|
|
|
18171
18413
|
// ../../packages/plugin-sdk/src/paths.ts
|
|
18172
|
-
import { readdirSync as
|
|
18173
|
-
import { basename as
|
|
18414
|
+
import { readdirSync as readdirSync3, realpathSync as realpathSync2 } from "fs";
|
|
18415
|
+
import { basename as basename4, dirname as dirname3, sep as sep3 } from "path";
|
|
18174
18416
|
|
|
18175
18417
|
// ../../packages/plugin-sdk/src/project-files.ts
|
|
18176
18418
|
var import_ignore = __toESM(require_ignore(), 1);
|
|
18177
|
-
import { existsSync as
|
|
18178
|
-
import { basename as
|
|
18419
|
+
import { existsSync as existsSync8, readdirSync as readdirSync4, readFileSync as readFileSync8 } from "fs";
|
|
18420
|
+
import { basename as basename5, join as join12, relative, sep as sep4 } from "path";
|
|
18421
|
+
|
|
18422
|
+
// ../../packages/plugin-sdk/src/provider-env-antigravity.ts
|
|
18423
|
+
var optionalBaseUrl2 = external_exports.preprocess((v) => {
|
|
18424
|
+
if (typeof v === "string" && v.trim() === "") return void 0;
|
|
18425
|
+
return v;
|
|
18426
|
+
}, external_exports.string().optional()).catch(void 0);
|
|
18427
|
+
var optionalFlag = external_exports.preprocess((v) => {
|
|
18428
|
+
if (typeof v !== "string") return false;
|
|
18429
|
+
const normalized = v.trim().toLowerCase();
|
|
18430
|
+
return normalized !== "" && normalized !== "0" && normalized !== "false";
|
|
18431
|
+
}, external_exports.boolean()).catch(false);
|
|
18432
|
+
var antigravityProviderEnvShape = {
|
|
18433
|
+
GOOGLE_GENAI_USE_VERTEXAI: optionalFlag,
|
|
18434
|
+
GOOGLE_GEMINI_BASE_URL: optionalBaseUrl2
|
|
18435
|
+
};
|
|
18436
|
+
var AntigravityProviderEnvSchema = external_exports.object(antigravityProviderEnvShape);
|
|
18437
|
+
|
|
18438
|
+
// ../../packages/plugin-sdk/src/provider-env-codex.ts
|
|
18439
|
+
var optionalBaseUrl3 = external_exports.preprocess((v) => {
|
|
18440
|
+
if (typeof v === "string" && v.trim() === "") return void 0;
|
|
18441
|
+
return v;
|
|
18442
|
+
}, external_exports.string().optional()).catch(void 0);
|
|
18443
|
+
var codexProviderEnvShape = {
|
|
18444
|
+
OPENAI_BASE_URL: optionalBaseUrl3
|
|
18445
|
+
};
|
|
18446
|
+
var CodexProviderEnvSchema = external_exports.object(codexProviderEnvShape);
|
|
18179
18447
|
|
|
18180
18448
|
// ../../packages/plugin-sdk/src/runtime.ts
|
|
18181
|
-
import { randomUUID as
|
|
18449
|
+
import { randomUUID as randomUUID14 } from "crypto";
|
|
18182
18450
|
|
|
18183
18451
|
// ../../packages/plugin-sdk/src/suppressions.ts
|
|
18184
18452
|
var THIRTY_DAYS_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
18185
18453
|
|
|
18186
18454
|
// ../../packages/plugin-sdk/src/throttle.ts
|
|
18187
|
-
import { mkdirSync as mkdirSync4, statSync as
|
|
18188
|
-
import { join as
|
|
18455
|
+
import { mkdirSync as mkdirSync4, statSync as statSync6, writeFileSync as writeFileSync6 } from "fs";
|
|
18456
|
+
import { join as join13 } from "path";
|
|
18189
18457
|
|
|
18190
|
-
// src/onboard-posture.ts
|
|
18458
|
+
// ../../packages/setup-wizard/src/onboard-posture.ts
|
|
18191
18459
|
function parsePosture(json2) {
|
|
18192
18460
|
const raw = JSON.parse(json2);
|
|
18193
18461
|
if (typeof raw !== "object" || raw === null) throw new Error("posture must be a JSON object");
|
|
@@ -18222,6 +18490,73 @@ function parseCurrent(json2) {
|
|
|
18222
18490
|
return out;
|
|
18223
18491
|
}
|
|
18224
18492
|
|
|
18493
|
+
// ../../packages/setup-wizard/src/remediation/rotation-checklist.ts
|
|
18494
|
+
import { writeFileSync as writeFileSync7 } from "fs";
|
|
18495
|
+
import { join as join14 } from "path";
|
|
18496
|
+
|
|
18497
|
+
// ../../packages/setup-wizard/src/triage/gate-display.ts
|
|
18498
|
+
var ACTION_RANK = {
|
|
18499
|
+
allow: 0,
|
|
18500
|
+
log: 1,
|
|
18501
|
+
warn: 2,
|
|
18502
|
+
redact: 3,
|
|
18503
|
+
block: 4
|
|
18504
|
+
};
|
|
18505
|
+
function isDowngrade(planned, current) {
|
|
18506
|
+
if (current === void 0) return false;
|
|
18507
|
+
return ACTION_RANK[builtinPolicyToAction(planned)] < ACTION_RANK[current];
|
|
18508
|
+
}
|
|
18509
|
+
function downgradeWarning(downgrades) {
|
|
18510
|
+
if (downgrades.length === 0) return "";
|
|
18511
|
+
return `
|
|
18512
|
+
|
|
18513
|
+
Heads up \u2014 this would lower ${String(downgrades.length)} detection level${downgrades.length === 1 ? "" : "s"} (${downgrades.join(", ")}) below what you've already set. Confirm you mean to lower ${downgrades.length === 1 ? "it" : "them"} before I apply.`;
|
|
18514
|
+
}
|
|
18515
|
+
|
|
18516
|
+
// ../../packages/setup-wizard/src/triage/plan-file.ts
|
|
18517
|
+
import { mkdtempSync, readFileSync as readFileSync9, rmdirSync, rmSync as rmSync5, writeFileSync as writeFileSync8 } from "fs";
|
|
18518
|
+
import { tmpdir } from "os";
|
|
18519
|
+
import { basename as basename6, dirname as dirname4, join as join15 } from "path";
|
|
18520
|
+
var SuppressionEntrySchema = external_exports.object({
|
|
18521
|
+
ruleId: external_exports.string(),
|
|
18522
|
+
category: DetectionCategory,
|
|
18523
|
+
valueFingerprint: external_exports.string(),
|
|
18524
|
+
keyVersion: external_exports.number(),
|
|
18525
|
+
maskedValue: external_exports.string(),
|
|
18526
|
+
justification: external_exports.string()
|
|
18527
|
+
});
|
|
18528
|
+
var ShowcaseCategorySchema = external_exports.object({
|
|
18529
|
+
category: DetectionCategory,
|
|
18530
|
+
action: BuiltinPolicyId,
|
|
18531
|
+
genuineCount: external_exports.number(),
|
|
18532
|
+
fpCount: external_exports.number(),
|
|
18533
|
+
reasoning: external_exports.string()
|
|
18534
|
+
});
|
|
18535
|
+
var JoinEntrySchema = external_exports.object({
|
|
18536
|
+
id: external_exports.string(),
|
|
18537
|
+
ruleId: external_exports.string(),
|
|
18538
|
+
category: DetectionCategory,
|
|
18539
|
+
valueFingerprint: external_exports.string().optional(),
|
|
18540
|
+
keyVersion: external_exports.number().optional(),
|
|
18541
|
+
maskedMatch: external_exports.string(),
|
|
18542
|
+
maskedContext: external_exports.string()
|
|
18543
|
+
});
|
|
18544
|
+
var PLAN_FILE_VERSION = 3;
|
|
18545
|
+
var PersistedPlanSchema = external_exports.object({
|
|
18546
|
+
version: external_exports.literal(PLAN_FILE_VERSION),
|
|
18547
|
+
// partialRecord (not record): a posture only covers the categories present in
|
|
18548
|
+
// the evidence, so an exhaustive-key record would reject every real plan.
|
|
18549
|
+
posture: external_exports.partialRecord(DetectionCategory, BuiltinPolicyId),
|
|
18550
|
+
entries: external_exports.array(SuppressionEntrySchema),
|
|
18551
|
+
showcase: external_exports.array(ShowcaseCategorySchema),
|
|
18552
|
+
join: external_exports.array(JoinEntrySchema),
|
|
18553
|
+
notes: external_exports.string(),
|
|
18554
|
+
// The store's per-category action at preview time. The downgrade view is
|
|
18555
|
+
// rendered from it at PREVIEW (renderPosturePlan); confirm reads it back ONLY to
|
|
18556
|
+
// compare against the live store and reject a stale plan (runConfirm's drift gate).
|
|
18557
|
+
current: external_exports.partialRecord(DetectionCategory, ActionTaken)
|
|
18558
|
+
});
|
|
18559
|
+
|
|
18225
18560
|
// src/setup-show.ts
|
|
18226
18561
|
var SHOW_BEGIN = "<<<AKA_SHOW";
|
|
18227
18562
|
var SHOW_END = "AKA_SHOW>>>";
|
|
@@ -18306,28 +18641,9 @@ function show(body) {
|
|
|
18306
18641
|
}
|
|
18307
18642
|
|
|
18308
18643
|
// src/command-registry.ts
|
|
18309
|
-
import { readdirSync as
|
|
18310
|
-
import { fileURLToPath } from "url";
|
|
18311
|
-
var COMMANDS_DIR =
|
|
18312
|
-
|
|
18313
|
-
// src/triage/gate-display.ts
|
|
18314
|
-
var ACTION_RANK = {
|
|
18315
|
-
allow: 0,
|
|
18316
|
-
log: 1,
|
|
18317
|
-
warn: 2,
|
|
18318
|
-
redact: 3,
|
|
18319
|
-
block: 4
|
|
18320
|
-
};
|
|
18321
|
-
function isDowngrade(planned, current) {
|
|
18322
|
-
if (current === void 0) return false;
|
|
18323
|
-
return ACTION_RANK[builtinPolicyToAction(planned)] < ACTION_RANK[current];
|
|
18324
|
-
}
|
|
18325
|
-
function downgradeWarning(downgrades) {
|
|
18326
|
-
if (downgrades.length === 0) return "";
|
|
18327
|
-
return `
|
|
18328
|
-
|
|
18329
|
-
Heads up \u2014 this would lower ${String(downgrades.length)} detection level${downgrades.length === 1 ? "" : "s"} (${downgrades.join(", ")}) below what you've already set. Confirm you mean to lower ${downgrades.length === 1 ? "it" : "them"} before I apply.`;
|
|
18330
|
-
}
|
|
18644
|
+
import { readdirSync as readdirSync5 } from "fs";
|
|
18645
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
18646
|
+
var COMMANDS_DIR = fileURLToPath2(new URL("../commands", import.meta.url));
|
|
18331
18647
|
|
|
18332
18648
|
// src/render.ts
|
|
18333
18649
|
var SEVERITY_GLYPH = {
|
|
@@ -18419,7 +18735,7 @@ function postureArg() {
|
|
|
18419
18735
|
if (value === void 0) throw new Error("--adjust-confirm requires --posture <json>");
|
|
18420
18736
|
return value;
|
|
18421
18737
|
}
|
|
18422
|
-
function
|
|
18738
|
+
function recommendedPosture2() {
|
|
18423
18739
|
const raw = jsonArg("--recommended");
|
|
18424
18740
|
return raw === void 0 ? severityFloorPosture() : parsePosture(raw);
|
|
18425
18741
|
}
|
|
@@ -18428,7 +18744,7 @@ function currentPosture() {
|
|
|
18428
18744
|
return raw === void 0 ? {} : parseCurrent(raw);
|
|
18429
18745
|
}
|
|
18430
18746
|
try {
|
|
18431
|
-
const card = argv.includes("--adjust-confirm") ? renderAdjustConfirm(
|
|
18747
|
+
const card = argv.includes("--adjust-confirm") ? renderAdjustConfirm(recommendedPosture2(), parsePosture(postureArg()), currentPosture()) : renderStartLight(severityFloorPosture());
|
|
18432
18748
|
process.stdout.write(show(fenced(card)));
|
|
18433
18749
|
} catch (err) {
|
|
18434
18750
|
const message = err instanceof Error ? err.message : String(err);
|