@akasecurity/ai-tc-claude-code 0.9.9 → 0.9.10
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 +2 -2
- package/hooks/hooks.json +1 -1
- package/package.json +5 -5
- package/scripts/apply-suppressions.js +1200 -671
- package/scripts/backfill.js +2299 -1434
- package/scripts/filescan.js +2053 -1249
- package/scripts/firstrun.js +1961 -1188
- package/scripts/history-sync.js +1882 -1029
- package/scripts/intro.js +363 -238
- package/scripts/message-display.js +1212 -662
- package/scripts/onboard.js +1598 -1066
- package/scripts/post-model-switch.js +447 -311
- package/scripts/post-tool-use.js +2101 -1274
- package/scripts/pre-model-switch.js +1981 -1204
- package/scripts/pre-tool-use.js +2113 -1102
- package/scripts/query.js +1961 -1188
- package/scripts/reconcile.js +2082 -1242
- package/scripts/remediate.js +2152 -1279
- package/scripts/scan-worker.js +278 -176
- package/scripts/session-start.js +2050 -1277
- package/scripts/start-light.js +366 -241
- package/scripts/statusline.js +1961 -1188
- package/scripts/stop.js +448 -315
- package/scripts/sync.js +17422 -2018
- package/scripts/user-prompt-submit.js +2110 -1279
package/scripts/intro.js
CHANGED
|
@@ -492,7 +492,7 @@ var require_ignore = __commonJS({
|
|
|
492
492
|
});
|
|
493
493
|
|
|
494
494
|
// src/intro.ts
|
|
495
|
-
import { readFileSync as
|
|
495
|
+
import { readFileSync as readFileSync14 } from "fs";
|
|
496
496
|
|
|
497
497
|
// ../../packages/schema/src/exception-scope.ts
|
|
498
498
|
var MINUTE_MS = 6e4;
|
|
@@ -21792,6 +21792,26 @@ var AttachTokenResponse = external_exports.union([
|
|
|
21792
21792
|
AttachTokenExpired,
|
|
21793
21793
|
external_exports.object({ status: printable(64) })
|
|
21794
21794
|
]);
|
|
21795
|
+
var DeviceCommandKind = external_exports.enum(["shares_rescan"]);
|
|
21796
|
+
var DeviceCommand = external_exports.object({
|
|
21797
|
+
id: printable(128).min(1),
|
|
21798
|
+
kind: DeviceCommandKind,
|
|
21799
|
+
issuedAt: printable(64).min(1),
|
|
21800
|
+
expiresAt: printable(64).min(1)
|
|
21801
|
+
}).strict();
|
|
21802
|
+
var DeviceCommandPollResponse = external_exports.object({ command: DeviceCommand.nullable() });
|
|
21803
|
+
var DeviceCommandFailureReason = external_exports.enum(["scan_failed", "no_projects", "expired"]);
|
|
21804
|
+
var DeviceCommandAckBody = external_exports.discriminatedUnion("outcome", [
|
|
21805
|
+
external_exports.object({
|
|
21806
|
+
outcome: external_exports.literal("reported"),
|
|
21807
|
+
projectsScanned: external_exports.number().int().nonnegative()
|
|
21808
|
+
}).strict(),
|
|
21809
|
+
external_exports.object({
|
|
21810
|
+
outcome: external_exports.literal("failed"),
|
|
21811
|
+
reason: DeviceCommandFailureReason,
|
|
21812
|
+
projectsScanned: external_exports.number().int().nonnegative()
|
|
21813
|
+
}).strict()
|
|
21814
|
+
]);
|
|
21795
21815
|
|
|
21796
21816
|
// ../../packages/schema/src/zod/registry.ts
|
|
21797
21817
|
var Namespace = external_exports.string().regex(/^[a-z][a-z0-9-]*$/);
|
|
@@ -21958,7 +21978,7 @@ var PackManifest = external_exports.object({
|
|
|
21958
21978
|
}).meta({ id: "PackManifest" });
|
|
21959
21979
|
|
|
21960
21980
|
// ../../packages/schema/src/zod/detection.ts
|
|
21961
|
-
var OriginEnum = external_exports.enum(["library"]).meta({ id: "OriginEnum" });
|
|
21981
|
+
var OriginEnum = external_exports.enum(["library", "custom"]).meta({ id: "OriginEnum" });
|
|
21962
21982
|
var DetectionFilterEnum = external_exports.enum(["all", "library", "custom", "customized", "updates"]);
|
|
21963
21983
|
var LibraryStateEnum = external_exports.enum(["new", "imported", "update"]).meta({ id: "LibraryStateEnum" });
|
|
21964
21984
|
var DetectionCounts = external_exports.object({
|
|
@@ -22153,8 +22173,9 @@ var Event = external_exports.object({
|
|
|
22153
22173
|
metadata: EventMetadata.optional()
|
|
22154
22174
|
}).meta({ id: "Event" });
|
|
22155
22175
|
var IngestEvent = Event.meta({ id: "IngestEvent" });
|
|
22176
|
+
var INGEST_BATCH_MAX = 100;
|
|
22156
22177
|
var IngestBatch = external_exports.object({
|
|
22157
|
-
events: external_exports.array(IngestEvent).min(1).max(
|
|
22178
|
+
events: external_exports.array(IngestEvent).min(1).max(INGEST_BATCH_MAX),
|
|
22158
22179
|
// Dedup policy for this batch. Id-dedup ALWAYS applies. 'content-hash'
|
|
22159
22180
|
// additionally rejects any event whose contentHash the store has already
|
|
22160
22181
|
// recorded — for re-runnable bulk ingest (worktree scan, transcript
|
|
@@ -22280,6 +22301,225 @@ var PatchInstalledPackRequest = external_exports.object({
|
|
|
22280
22301
|
message: "At least one field must be provided"
|
|
22281
22302
|
}).meta({ id: "PatchInstalledPackRequest" });
|
|
22282
22303
|
|
|
22304
|
+
// ../../packages/schema/src/zod/policy.ts
|
|
22305
|
+
var PolicyScope = external_exports.enum(["global", "repo", "user"]).meta({ id: "PolicyScope" });
|
|
22306
|
+
var PolicyTarget = external_exports.union([external_exports.object({ ruleId: external_exports.string() }), external_exports.object({ category: DetectionCategory })]).meta({ id: "PolicyTarget" });
|
|
22307
|
+
var PolicyKind = external_exports.enum(["builtin", "custom"]).meta({ id: "PolicyKind" });
|
|
22308
|
+
var PolicyProvenance = external_exports.enum(["builtin", "authored"]).meta({ id: "PolicyProvenance" });
|
|
22309
|
+
var Policy = external_exports.object({
|
|
22310
|
+
id: external_exports.guid(),
|
|
22311
|
+
scope: PolicyScope,
|
|
22312
|
+
target: PolicyTarget,
|
|
22313
|
+
action: ActionTaken,
|
|
22314
|
+
enabled: external_exports.boolean().default(true),
|
|
22315
|
+
customKeywords: external_exports.array(external_exports.string()).optional(),
|
|
22316
|
+
// Display name — optional so older policy rows without name still parse.
|
|
22317
|
+
// Added for the findings API (policy.name column migration).
|
|
22318
|
+
name: external_exports.string().optional(),
|
|
22319
|
+
// Whether an AUTHORED policy governs this row's target — not a claim about
|
|
22320
|
+
// which row this is. A producer that collapses several rows onto one target
|
|
22321
|
+
// must carry the marker onto whichever row survives, or the collapse decides
|
|
22322
|
+
// the answer; a survivor may therefore be a built-in expansion still marked
|
|
22323
|
+
// 'authored' because an authored sibling targeted the same thing.
|
|
22324
|
+
// Optional so an older producer — and an older on-disk cache — still parses;
|
|
22325
|
+
// absent reads as 'builtin', which is the behaviour that predates the field.
|
|
22326
|
+
//
|
|
22327
|
+
// Deliberately NOT `kind`/PolicyKind: that name and that enum answer which
|
|
22328
|
+
// built-in archetype catalog entry a policy is, which every catalog surface
|
|
22329
|
+
// reads and which a caller may state. This one is a statement the PRODUCER
|
|
22330
|
+
// of a bundle makes about a row, and only the bundle builder ever stamps it
|
|
22331
|
+
// — the CRUD routes neither accept nor set it.
|
|
22332
|
+
//
|
|
22333
|
+
// A device consumes this in exactly one direction: an 'authored' policy
|
|
22334
|
+
// arriving from a control plane marks the rules it targets as not
|
|
22335
|
+
// locally re-assignable. That can only ever ADD a refusal, never relax one,
|
|
22336
|
+
// which is what makes it safe to honour from an unsigned cache — the same
|
|
22337
|
+
// test `prohibitedModels` passes and `reversibleRuleIds` fails.
|
|
22338
|
+
provenance: PolicyProvenance.optional()
|
|
22339
|
+
}).meta({ id: "Policy" });
|
|
22340
|
+
var PolicyBundle = external_exports.object({
|
|
22341
|
+
version: external_exports.string(),
|
|
22342
|
+
policies: external_exports.array(Policy),
|
|
22343
|
+
// Rules from the installed marketplace packs (snapshotted by the
|
|
22344
|
+
// control plane). The plugin registers these in addition to its bundled
|
|
22345
|
+
// packs. Optional so older backends — and older on-disk caches — that omit
|
|
22346
|
+
// the field still parse; consumers read `bundle.rules ?? []`.
|
|
22347
|
+
rules: external_exports.array(Rule).optional(),
|
|
22348
|
+
// When true, `rules` IS the complete effective ruleset and the runtime must
|
|
22349
|
+
// NOT merge its compiled-in bundled packs — the standalone gateway sets this
|
|
22350
|
+
// after reading the user's installed snapshot (installed_packs, enabled
|
|
22351
|
+
// packs only), which is how detection updates stay manual: new bundled
|
|
22352
|
+
// rules run only after the user applies the pack update. Absent/false keeps
|
|
22353
|
+
// the historical composition (bundled packs + rules) — older caches.
|
|
22354
|
+
rulesComplete: external_exports.boolean().optional(),
|
|
22355
|
+
// Active detection exceptions, evaluation subset only (see
|
|
22356
|
+
// ExceptionBundleEntry). Optional so older bundle producers — and older
|
|
22357
|
+
// on-disk caches — that omit the field still parse; consumers read
|
|
22358
|
+
// `bundle.exceptions ?? []`.
|
|
22359
|
+
exceptions: external_exports.array(ExceptionBundleEntry).optional(),
|
|
22360
|
+
// Rule ids whose pack is assigned a REVERSIBLE archetype (Redact & Vault).
|
|
22361
|
+
// A second axis over the same `redact` action, carried beside the policies
|
|
22362
|
+
// rather than on them: nothing writes ruleId-targeted policies to disk, so
|
|
22363
|
+
// widening Policy itself would change a persisted shape to express something
|
|
22364
|
+
// only the in-memory bundle needs. Optional so an older producer — or an
|
|
22365
|
+
// older on-disk cache — still parses; consumers read `?? []` and get the
|
|
22366
|
+
// pre-existing one-way behaviour, which is the safe direction to default.
|
|
22367
|
+
reversibleRuleIds: external_exports.array(external_exports.string()).optional(),
|
|
22368
|
+
// Installed pack version, keyed by ruleId, for rules in `rules` that came
|
|
22369
|
+
// from a versioned installed pack. Optional so older backends — and older
|
|
22370
|
+
// on-disk caches — that omit the field still parse; consumers fall back to
|
|
22371
|
+
// the rule's own spec version. NOT the bundle version above — see
|
|
22372
|
+
// installedRuleset's ruleVersions for the source of truth.
|
|
22373
|
+
ruleVersions: external_exports.record(external_exports.string(), external_exports.string()).optional(),
|
|
22374
|
+
// Model ids (the raw `model` string a harness reports, e.g.
|
|
22375
|
+
// `claude-opus-4-1`) the tenant has PROHIBITED. The plugin refuses to switch
|
|
22376
|
+
// a session onto one (PreModelSwitch) and refuses a turn that would run on
|
|
22377
|
+
// one (UserPromptSubmit). Optional so an older backend — and an older
|
|
22378
|
+
// on-disk cache — still parses; consumers read `?? []`, which is the
|
|
22379
|
+
// unenforced behaviour that predates this field and the safe direction to
|
|
22380
|
+
// default.
|
|
22381
|
+
//
|
|
22382
|
+
// Ids, not display names: the governance decision is keyed on the exact
|
|
22383
|
+
// string the harness reports (`model_status_override.versionId` in the
|
|
22384
|
+
// control plane), so no name resolution stands between the decision and the
|
|
22385
|
+
// comparison.
|
|
22386
|
+
prohibitedModels: external_exports.array(external_exports.string()).optional(),
|
|
22387
|
+
customKeywords: external_exports.array(external_exports.string()),
|
|
22388
|
+
fetchedAt: external_exports.iso.datetime()
|
|
22389
|
+
}).meta({ id: "PolicyBundle" });
|
|
22390
|
+
var POLICY_BUNDLE_SHAPE_ID = [
|
|
22391
|
+
...Object.keys(PolicyBundle.shape),
|
|
22392
|
+
...Object.keys(Policy.shape).map((key) => `policies.${key}`),
|
|
22393
|
+
...PolicyTarget.options.flatMap((member) => "shape" in member ? Object.keys(member.shape) : []).map((key) => `policies.target.${key}`),
|
|
22394
|
+
...Object.keys(ExceptionBundleEntry.shape).map((key) => `exceptions.${key}`)
|
|
22395
|
+
].sort().join(",");
|
|
22396
|
+
var OBSERVE_ONLY_CATEGORIES = ["config"];
|
|
22397
|
+
var ENFORCEABLE_CATEGORIES = DetectionCategory.options.filter((c) => !OBSERVE_ONLY_CATEGORIES.includes(c));
|
|
22398
|
+
var CATEGORY_PEAK_SEVERITY = {
|
|
22399
|
+
secret: "critical",
|
|
22400
|
+
financial: "critical",
|
|
22401
|
+
// core-financial/credit-card
|
|
22402
|
+
code_flaw: "critical",
|
|
22403
|
+
pii: "high",
|
|
22404
|
+
phi: "high",
|
|
22405
|
+
custom: "high",
|
|
22406
|
+
// user-defined; conservative
|
|
22407
|
+
code_context: "low",
|
|
22408
|
+
config: "low"
|
|
22409
|
+
// observe-only; floors to monitor regardless
|
|
22410
|
+
};
|
|
22411
|
+
function severityFloorPolicy(category) {
|
|
22412
|
+
if (OBSERVE_ONLY_CATEGORIES.includes(category)) return "monitor";
|
|
22413
|
+
const peak = CATEGORY_PEAK_SEVERITY[category];
|
|
22414
|
+
return peak === "critical" || peak === "high" ? "warn" : "monitor";
|
|
22415
|
+
}
|
|
22416
|
+
var KNOWN_BUILTIN_IDS = ["monitor", "warn", "redact", "vault", "block"];
|
|
22417
|
+
var BuiltinPolicyId = external_exports.enum(KNOWN_BUILTIN_IDS).meta({ id: "BuiltinPolicyId" });
|
|
22418
|
+
var RedactFallback = BuiltinPolicyId.extract(["monitor", "warn", "block"]).meta({
|
|
22419
|
+
id: "RedactFallback"
|
|
22420
|
+
});
|
|
22421
|
+
var BUILTIN_POLICY_SPECS = {
|
|
22422
|
+
monitor: {
|
|
22423
|
+
name: "Monitor",
|
|
22424
|
+
action: "log",
|
|
22425
|
+
reversible: false,
|
|
22426
|
+
description: "Log every match for audit. The request is allowed through untouched."
|
|
22427
|
+
},
|
|
22428
|
+
warn: {
|
|
22429
|
+
name: "Warn",
|
|
22430
|
+
action: "warn",
|
|
22431
|
+
reversible: false,
|
|
22432
|
+
description: "Allow the request, but warn the user inline before it is sent."
|
|
22433
|
+
},
|
|
22434
|
+
redact: {
|
|
22435
|
+
name: "Redact",
|
|
22436
|
+
action: "redact",
|
|
22437
|
+
reversible: false,
|
|
22438
|
+
description: "Strip the matched value from the request and destroy it, then continue. What was removed cannot be recovered."
|
|
22439
|
+
},
|
|
22440
|
+
vault: {
|
|
22441
|
+
name: "Redact & Vault",
|
|
22442
|
+
action: "redact",
|
|
22443
|
+
reversible: true,
|
|
22444
|
+
description: "Strip the matched value from the request and keep an encrypted, recoverable copy in the local vault, leaving a pointer in its place. Needs the vault consent granted under Settings; without it this behaves as Redact."
|
|
22445
|
+
},
|
|
22446
|
+
block: {
|
|
22447
|
+
name: "Block",
|
|
22448
|
+
action: "block",
|
|
22449
|
+
reversible: false,
|
|
22450
|
+
description: "Refuse the request entirely whenever any rule in this detection matches."
|
|
22451
|
+
}
|
|
22452
|
+
};
|
|
22453
|
+
function builtinPolicyToAction(id) {
|
|
22454
|
+
return BUILTIN_POLICY_SPECS[id].action;
|
|
22455
|
+
}
|
|
22456
|
+
var PALETTE_WEAKEST_FIRST = [
|
|
22457
|
+
...new Set(KNOWN_BUILTIN_IDS.map(builtinPolicyToAction))
|
|
22458
|
+
];
|
|
22459
|
+
var BELOW_PALETTE = ACTION_TAKEN_KEYS.filter(
|
|
22460
|
+
(action) => !PALETTE_WEAKEST_FIRST.includes(action)
|
|
22461
|
+
);
|
|
22462
|
+
var ACTION_STRENGTH_ORDER = [
|
|
22463
|
+
...BELOW_PALETTE,
|
|
22464
|
+
...PALETTE_WEAKEST_FIRST
|
|
22465
|
+
];
|
|
22466
|
+
var PackPolicyFloor = external_exports.object({
|
|
22467
|
+
/**
|
|
22468
|
+
* The weakest archetype the device may assign. Stated as a BuiltinPolicyId
|
|
22469
|
+
* rather than a raw ActionTaken because that is the vocabulary the user
|
|
22470
|
+
* picks from — a floor a UI cannot name is one it cannot explain.
|
|
22471
|
+
*/
|
|
22472
|
+
floor: BuiltinPolicyId,
|
|
22473
|
+
/**
|
|
22474
|
+
* True when the organization AUTHORED a policy governing this pack rather
|
|
22475
|
+
* than stating a minimum: it gave the answer, so the pack is not
|
|
22476
|
+
* re-assignable locally in either direction.
|
|
22477
|
+
*/
|
|
22478
|
+
locked: external_exports.boolean()
|
|
22479
|
+
}).describe("PackPolicyFloor");
|
|
22480
|
+
var CATEGORY_EXPRESSIBLE_IDS = KNOWN_BUILTIN_IDS.filter(
|
|
22481
|
+
(id) => !BUILTIN_POLICY_SPECS[id].reversible
|
|
22482
|
+
);
|
|
22483
|
+
var CATEGORY_INEXPRESSIBLE_IDS = KNOWN_BUILTIN_IDS.filter(
|
|
22484
|
+
(id) => BUILTIN_POLICY_SPECS[id].reversible
|
|
22485
|
+
);
|
|
22486
|
+
var CategoryPolicyId = external_exports.enum(CATEGORY_EXPRESSIBLE_IDS).meta({ id: "CategoryPolicyId" });
|
|
22487
|
+
var DEFAULT_ACTIONS = Object.fromEntries(
|
|
22488
|
+
DetectionCategory.options.map((c) => [c, builtinPolicyToAction(severityFloorPolicy(c))])
|
|
22489
|
+
);
|
|
22490
|
+
var BUILTIN_POLICIES = Object.fromEntries(
|
|
22491
|
+
KNOWN_BUILTIN_IDS.map((id) => [id, { id, ...BUILTIN_POLICY_SPECS[id] }])
|
|
22492
|
+
);
|
|
22493
|
+
var UsedByItem = external_exports.object({
|
|
22494
|
+
id: external_exports.string(),
|
|
22495
|
+
name: external_exports.string(),
|
|
22496
|
+
ruleCount: external_exports.number().int().nonnegative(),
|
|
22497
|
+
enabled: external_exports.boolean()
|
|
22498
|
+
}).meta({ id: "UsedByItem" });
|
|
22499
|
+
var PolicyListItem = external_exports.object({
|
|
22500
|
+
id: external_exports.string(),
|
|
22501
|
+
kind: PolicyKind,
|
|
22502
|
+
name: external_exports.string(),
|
|
22503
|
+
enabled: external_exports.boolean(),
|
|
22504
|
+
usedByCount: external_exports.number().int().nonnegative()
|
|
22505
|
+
}).meta({ id: "PolicyListItem" });
|
|
22506
|
+
var ListPoliciesResponse = external_exports.object({ items: external_exports.array(PolicyListItem) }).meta({ id: "ListPoliciesResponse" });
|
|
22507
|
+
var PolicyDetail = external_exports.object({
|
|
22508
|
+
specVersion: external_exports.literal(1),
|
|
22509
|
+
id: external_exports.string(),
|
|
22510
|
+
kind: PolicyKind,
|
|
22511
|
+
name: external_exports.string(),
|
|
22512
|
+
enabled: external_exports.boolean(),
|
|
22513
|
+
description: external_exports.string(),
|
|
22514
|
+
usedBy: external_exports.array(UsedByItem)
|
|
22515
|
+
}).meta({ id: "PolicyDetail" });
|
|
22516
|
+
var PolicyStatsResponse = external_exports.object({
|
|
22517
|
+
policies: external_exports.number().int().nonnegative(),
|
|
22518
|
+
builtin: external_exports.number().int().nonnegative(),
|
|
22519
|
+
custom: external_exports.number().int().nonnegative(),
|
|
22520
|
+
detectionsGoverned: external_exports.number().int().nonnegative()
|
|
22521
|
+
}).meta({ id: "PolicyStatsResponse" });
|
|
22522
|
+
|
|
22283
22523
|
// ../../packages/schema/src/zod/vault.ts
|
|
22284
22524
|
var CATEGORY_ALTERNATION = DetectionCategory.options.join("|");
|
|
22285
22525
|
var POINTER_TOKEN_PATTERN = new RegExp(
|
|
@@ -22316,6 +22556,14 @@ var VaultEntry = external_exports.object({
|
|
|
22316
22556
|
// How many times this value has been detected on this machine — the reuse
|
|
22317
22557
|
// signal the vault dashboard reads. Distinct from VaultDeref.pointerCount.
|
|
22318
22558
|
occurrenceCount: external_exports.number().int().nonnegative(),
|
|
22559
|
+
// True when a PERSON asked for this value to be replaced — the surfaced-
|
|
22560
|
+
// secrets strike — rather than a pack enforcing its assignment. One value is
|
|
22561
|
+
// one row however many paths vault it, so this is what tells a policy sweep
|
|
22562
|
+
// that the row carries somebody's own instruction and not just an assignment
|
|
22563
|
+
// that has since been lowered. STICKY and MONOTONIC: a later automatic
|
|
22564
|
+
// vaulting of the same value must never clear it — what the user said about
|
|
22565
|
+
// the value does not expire.
|
|
22566
|
+
userAuthorized: external_exports.boolean(),
|
|
22319
22567
|
firstSeen: external_exports.string(),
|
|
22320
22568
|
lastSeen: external_exports.string()
|
|
22321
22569
|
});
|
|
@@ -22431,7 +22679,7 @@ var VaultConsent = external_exports.object({
|
|
|
22431
22679
|
});
|
|
22432
22680
|
|
|
22433
22681
|
// ../../packages/schema/src/zod/local.ts
|
|
22434
|
-
var WORKSPACE_SETTINGS_SPEC_VERSION =
|
|
22682
|
+
var WORKSPACE_SETTINGS_SPEC_VERSION = 7;
|
|
22435
22683
|
var RunMode = external_exports.enum(["standalone", "attached"]);
|
|
22436
22684
|
var ControlPlaneConnection = external_exports.object({
|
|
22437
22685
|
endpoint: external_exports.string().min(1),
|
|
@@ -22472,6 +22720,19 @@ var WorkspaceSettings = external_exports.object({
|
|
|
22472
22720
|
vaultKeyCustody: VaultKeyCustody.default("file"),
|
|
22473
22721
|
// How a pointer renders in assistant prose on screen (see VaultInlineReveal).
|
|
22474
22722
|
vaultInlineReveal: VaultInlineReveal.default("masked"),
|
|
22723
|
+
// What a `redact` policy degrades to on a FIELD the host cannot rewrite in
|
|
22724
|
+
// place. Not a handling policy: the policy has already resolved to redact,
|
|
22725
|
+
// and this only says what happens when the host offers no channel to carry it
|
|
22726
|
+
// out — Antigravity's PreToolUse has no updatedInput at all, and Codex and
|
|
22727
|
+
// Claude Code decline to mask a field that EXECUTES because masking would
|
|
22728
|
+
// change what runs. Per FIELD rather than per host, so a host that can
|
|
22729
|
+
// rewrite some inputs keeps true redaction on those.
|
|
22730
|
+
//
|
|
22731
|
+
// Spelled in the built-in policy vocabulary rather than as a fresh enum, so
|
|
22732
|
+
// an attached machine's merge is `strongerAction` over the one action ladder
|
|
22733
|
+
// and no second rank order exists to drift from it. 'deny' is a host wire
|
|
22734
|
+
// word and stays out of the stored value.
|
|
22735
|
+
redactFallback: RedactFallback.default("warn"),
|
|
22475
22736
|
// Absent until /aka:setup completes; its presence is what "onboarded" means.
|
|
22476
22737
|
onboardedAt: external_exports.iso.datetime().optional(),
|
|
22477
22738
|
// Records that the user consented to sending findings to the model API for
|
|
@@ -22479,10 +22740,12 @@ var WorkspaceSettings = external_exports.object({
|
|
|
22479
22740
|
// Absent until granted; a stale payloadVersion means the consent no longer
|
|
22480
22741
|
// covers the current payload and must be re-granted.
|
|
22481
22742
|
modelJudgeConsent: ModelJudgeConsent.optional(),
|
|
22482
|
-
// Records that the user consented to
|
|
22483
|
-
//
|
|
22484
|
-
//
|
|
22485
|
-
//
|
|
22743
|
+
// Records that the user consented to the DEFERRED send — the outbox — along
|
|
22744
|
+
// with the payload shape and the endpoint they agreed to. Since payload v2
|
|
22745
|
+
// that covers both the pre-attach backlog and undelivered captures (which
|
|
22746
|
+
// carry prompt/reply text in `content`); the key name predates the widening.
|
|
22747
|
+
// Absent until granted, and a grant for a different endpoint or an older
|
|
22748
|
+
// payload no longer counts.
|
|
22486
22749
|
historySyncConsent: HistorySyncConsent.optional()
|
|
22487
22750
|
});
|
|
22488
22751
|
|
|
@@ -22495,7 +22758,8 @@ var ManagedSettingKey = external_exports.enum([
|
|
|
22495
22758
|
"vaultKeyCustody",
|
|
22496
22759
|
"vaultInlineReveal",
|
|
22497
22760
|
"modelJudgeConsent",
|
|
22498
|
-
"dataSharesInPlace"
|
|
22761
|
+
"dataSharesInPlace",
|
|
22762
|
+
"redactFallback"
|
|
22499
22763
|
]).meta({ id: "ManagedSettingKey" });
|
|
22500
22764
|
var ManagedSettingsValues = external_exports.object({
|
|
22501
22765
|
runMode: external_exports.enum(["standalone", "attached"]).optional(),
|
|
@@ -22508,7 +22772,8 @@ var ManagedSettingsValues = external_exports.object({
|
|
|
22508
22772
|
vaultKeyCustody: external_exports.enum(["file", "keychain"]).optional(),
|
|
22509
22773
|
vaultInlineReveal: external_exports.enum(["masked", "full", "off"]).optional(),
|
|
22510
22774
|
modelJudgeConsent: external_exports.boolean().optional(),
|
|
22511
|
-
dataSharesInPlace: external_exports.boolean().optional()
|
|
22775
|
+
dataSharesInPlace: external_exports.boolean().optional(),
|
|
22776
|
+
redactFallback: RedactFallback.optional()
|
|
22512
22777
|
}).meta({ id: "ManagedSettingsValues" });
|
|
22513
22778
|
var ManagedSettings = external_exports.object({
|
|
22514
22779
|
specVersion: external_exports.number().int().positive().default(MANAGED_SETTINGS_SPEC_VERSION),
|
|
@@ -22523,171 +22788,6 @@ var ManagedSettings = external_exports.object({
|
|
|
22523
22788
|
lockedFields: external_exports.array(ManagedSettingKey).default([])
|
|
22524
22789
|
}).meta({ id: "ManagedSettings" });
|
|
22525
22790
|
|
|
22526
|
-
// ../../packages/schema/src/zod/policy.ts
|
|
22527
|
-
var PolicyScope = external_exports.enum(["global", "repo", "user"]).meta({ id: "PolicyScope" });
|
|
22528
|
-
var PolicyTarget = external_exports.union([external_exports.object({ ruleId: external_exports.string() }), external_exports.object({ category: DetectionCategory })]).meta({ id: "PolicyTarget" });
|
|
22529
|
-
var Policy = external_exports.object({
|
|
22530
|
-
id: external_exports.guid(),
|
|
22531
|
-
scope: PolicyScope,
|
|
22532
|
-
target: PolicyTarget,
|
|
22533
|
-
action: ActionTaken,
|
|
22534
|
-
enabled: external_exports.boolean().default(true),
|
|
22535
|
-
customKeywords: external_exports.array(external_exports.string()).optional(),
|
|
22536
|
-
// Display name — optional so older policy rows without name still parse.
|
|
22537
|
-
// Added for the findings API (policy.name column migration).
|
|
22538
|
-
name: external_exports.string().optional()
|
|
22539
|
-
}).meta({ id: "Policy" });
|
|
22540
|
-
var PolicyBundle = external_exports.object({
|
|
22541
|
-
version: external_exports.string(),
|
|
22542
|
-
policies: external_exports.array(Policy),
|
|
22543
|
-
// Rules from the installed marketplace packs (snapshotted by the
|
|
22544
|
-
// control plane). The plugin registers these in addition to its bundled
|
|
22545
|
-
// packs. Optional so older backends — and older on-disk caches — that omit
|
|
22546
|
-
// the field still parse; consumers read `bundle.rules ?? []`.
|
|
22547
|
-
rules: external_exports.array(Rule).optional(),
|
|
22548
|
-
// When true, `rules` IS the complete effective ruleset and the runtime must
|
|
22549
|
-
// NOT merge its compiled-in bundled packs — the standalone gateway sets this
|
|
22550
|
-
// after reading the user's installed snapshot (installed_packs, enabled
|
|
22551
|
-
// packs only), which is how detection updates stay manual: new bundled
|
|
22552
|
-
// rules run only after the user applies the pack update. Absent/false keeps
|
|
22553
|
-
// the historical composition (bundled packs + rules) — older caches.
|
|
22554
|
-
rulesComplete: external_exports.boolean().optional(),
|
|
22555
|
-
// Active detection exceptions, evaluation subset only (see
|
|
22556
|
-
// ExceptionBundleEntry). Optional so older bundle producers — and older
|
|
22557
|
-
// on-disk caches — that omit the field still parse; consumers read
|
|
22558
|
-
// `bundle.exceptions ?? []`.
|
|
22559
|
-
exceptions: external_exports.array(ExceptionBundleEntry).optional(),
|
|
22560
|
-
// Rule ids whose pack is assigned a REVERSIBLE archetype (Redact & Vault).
|
|
22561
|
-
// A second axis over the same `redact` action, carried beside the policies
|
|
22562
|
-
// rather than on them: nothing writes ruleId-targeted policies to disk, so
|
|
22563
|
-
// widening Policy itself would change a persisted shape to express something
|
|
22564
|
-
// only the in-memory bundle needs. Optional so an older producer — or an
|
|
22565
|
-
// older on-disk cache — still parses; consumers read `?? []` and get the
|
|
22566
|
-
// pre-existing one-way behaviour, which is the safe direction to default.
|
|
22567
|
-
reversibleRuleIds: external_exports.array(external_exports.string()).optional(),
|
|
22568
|
-
// Installed pack version, keyed by ruleId, for rules in `rules` that came
|
|
22569
|
-
// from a versioned installed pack. Optional so older backends — and older
|
|
22570
|
-
// on-disk caches — that omit the field still parse; consumers fall back to
|
|
22571
|
-
// the rule's own spec version. NOT the bundle version above — see
|
|
22572
|
-
// installedRuleset's ruleVersions for the source of truth.
|
|
22573
|
-
ruleVersions: external_exports.record(external_exports.string(), external_exports.string()).optional(),
|
|
22574
|
-
// Model ids (the raw `model` string a harness reports, e.g.
|
|
22575
|
-
// `claude-opus-4-1`) the tenant has PROHIBITED. The plugin refuses to switch
|
|
22576
|
-
// a session onto one (PreModelSwitch) and refuses a turn that would run on
|
|
22577
|
-
// one (UserPromptSubmit). Optional so an older backend — and an older
|
|
22578
|
-
// on-disk cache — still parses; consumers read `?? []`, which is the
|
|
22579
|
-
// unenforced behaviour that predates this field and the safe direction to
|
|
22580
|
-
// default.
|
|
22581
|
-
//
|
|
22582
|
-
// Ids, not display names: the governance decision is keyed on the exact
|
|
22583
|
-
// string the harness reports (`model_status_override.versionId` in the
|
|
22584
|
-
// control plane), so no name resolution stands between the decision and the
|
|
22585
|
-
// comparison.
|
|
22586
|
-
prohibitedModels: external_exports.array(external_exports.string()).optional(),
|
|
22587
|
-
customKeywords: external_exports.array(external_exports.string()),
|
|
22588
|
-
fetchedAt: external_exports.iso.datetime()
|
|
22589
|
-
}).meta({ id: "PolicyBundle" });
|
|
22590
|
-
var OBSERVE_ONLY_CATEGORIES = ["config"];
|
|
22591
|
-
var ENFORCEABLE_CATEGORIES = DetectionCategory.options.filter((c) => !OBSERVE_ONLY_CATEGORIES.includes(c));
|
|
22592
|
-
var CATEGORY_PEAK_SEVERITY = {
|
|
22593
|
-
secret: "critical",
|
|
22594
|
-
financial: "critical",
|
|
22595
|
-
// core-financial/credit-card
|
|
22596
|
-
code_flaw: "critical",
|
|
22597
|
-
pii: "high",
|
|
22598
|
-
phi: "high",
|
|
22599
|
-
custom: "high",
|
|
22600
|
-
// user-defined; conservative
|
|
22601
|
-
code_context: "low",
|
|
22602
|
-
config: "low"
|
|
22603
|
-
// observe-only; floors to monitor regardless
|
|
22604
|
-
};
|
|
22605
|
-
function severityFloorPolicy(category) {
|
|
22606
|
-
if (OBSERVE_ONLY_CATEGORIES.includes(category)) return "monitor";
|
|
22607
|
-
const peak = CATEGORY_PEAK_SEVERITY[category];
|
|
22608
|
-
return peak === "critical" || peak === "high" ? "warn" : "monitor";
|
|
22609
|
-
}
|
|
22610
|
-
var PolicyKind = external_exports.enum(["builtin", "custom"]).meta({ id: "PolicyKind" });
|
|
22611
|
-
var KNOWN_BUILTIN_IDS = ["monitor", "warn", "redact", "vault", "block"];
|
|
22612
|
-
var BuiltinPolicyId = external_exports.enum(KNOWN_BUILTIN_IDS).meta({ id: "BuiltinPolicyId" });
|
|
22613
|
-
var BUILTIN_POLICY_SPECS = {
|
|
22614
|
-
monitor: {
|
|
22615
|
-
name: "Monitor",
|
|
22616
|
-
action: "log",
|
|
22617
|
-
reversible: false,
|
|
22618
|
-
description: "Log every match for audit. The request is allowed through untouched."
|
|
22619
|
-
},
|
|
22620
|
-
warn: {
|
|
22621
|
-
name: "Warn",
|
|
22622
|
-
action: "warn",
|
|
22623
|
-
reversible: false,
|
|
22624
|
-
description: "Allow the request, but warn the user inline before it is sent."
|
|
22625
|
-
},
|
|
22626
|
-
redact: {
|
|
22627
|
-
name: "Redact",
|
|
22628
|
-
action: "redact",
|
|
22629
|
-
reversible: false,
|
|
22630
|
-
description: "Strip the matched value from the request and destroy it, then continue. What was removed cannot be recovered."
|
|
22631
|
-
},
|
|
22632
|
-
vault: {
|
|
22633
|
-
name: "Redact & Vault",
|
|
22634
|
-
action: "redact",
|
|
22635
|
-
reversible: true,
|
|
22636
|
-
description: "Strip the matched value from the request and keep an encrypted, recoverable copy in the local vault, leaving a pointer in its place. Needs the vault consent granted under Settings; without it this behaves as Redact."
|
|
22637
|
-
},
|
|
22638
|
-
block: {
|
|
22639
|
-
name: "Block",
|
|
22640
|
-
action: "block",
|
|
22641
|
-
reversible: false,
|
|
22642
|
-
description: "Refuse the request entirely whenever any rule in this detection matches."
|
|
22643
|
-
}
|
|
22644
|
-
};
|
|
22645
|
-
function builtinPolicyToAction(id) {
|
|
22646
|
-
return BUILTIN_POLICY_SPECS[id].action;
|
|
22647
|
-
}
|
|
22648
|
-
var CATEGORY_EXPRESSIBLE_IDS = KNOWN_BUILTIN_IDS.filter(
|
|
22649
|
-
(id) => !BUILTIN_POLICY_SPECS[id].reversible
|
|
22650
|
-
);
|
|
22651
|
-
var CATEGORY_INEXPRESSIBLE_IDS = KNOWN_BUILTIN_IDS.filter(
|
|
22652
|
-
(id) => BUILTIN_POLICY_SPECS[id].reversible
|
|
22653
|
-
);
|
|
22654
|
-
var CategoryPolicyId = external_exports.enum(CATEGORY_EXPRESSIBLE_IDS).meta({ id: "CategoryPolicyId" });
|
|
22655
|
-
var DEFAULT_ACTIONS = Object.fromEntries(
|
|
22656
|
-
DetectionCategory.options.map((c) => [c, builtinPolicyToAction(severityFloorPolicy(c))])
|
|
22657
|
-
);
|
|
22658
|
-
var BUILTIN_POLICIES = Object.fromEntries(
|
|
22659
|
-
KNOWN_BUILTIN_IDS.map((id) => [id, { id, ...BUILTIN_POLICY_SPECS[id] }])
|
|
22660
|
-
);
|
|
22661
|
-
var UsedByItem = external_exports.object({
|
|
22662
|
-
id: external_exports.string(),
|
|
22663
|
-
name: external_exports.string(),
|
|
22664
|
-
ruleCount: external_exports.number().int().nonnegative(),
|
|
22665
|
-
enabled: external_exports.boolean()
|
|
22666
|
-
}).meta({ id: "UsedByItem" });
|
|
22667
|
-
var PolicyListItem = external_exports.object({
|
|
22668
|
-
id: external_exports.string(),
|
|
22669
|
-
kind: PolicyKind,
|
|
22670
|
-
name: external_exports.string(),
|
|
22671
|
-
enabled: external_exports.boolean(),
|
|
22672
|
-
usedByCount: external_exports.number().int().nonnegative()
|
|
22673
|
-
}).meta({ id: "PolicyListItem" });
|
|
22674
|
-
var ListPoliciesResponse = external_exports.object({ items: external_exports.array(PolicyListItem) }).meta({ id: "ListPoliciesResponse" });
|
|
22675
|
-
var PolicyDetail = external_exports.object({
|
|
22676
|
-
specVersion: external_exports.literal(1),
|
|
22677
|
-
id: external_exports.string(),
|
|
22678
|
-
kind: PolicyKind,
|
|
22679
|
-
name: external_exports.string(),
|
|
22680
|
-
enabled: external_exports.boolean(),
|
|
22681
|
-
description: external_exports.string(),
|
|
22682
|
-
usedBy: external_exports.array(UsedByItem)
|
|
22683
|
-
}).meta({ id: "PolicyDetail" });
|
|
22684
|
-
var PolicyStatsResponse = external_exports.object({
|
|
22685
|
-
policies: external_exports.number().int().nonnegative(),
|
|
22686
|
-
builtin: external_exports.number().int().nonnegative(),
|
|
22687
|
-
custom: external_exports.number().int().nonnegative(),
|
|
22688
|
-
detectionsGoverned: external_exports.number().int().nonnegative()
|
|
22689
|
-
}).meta({ id: "PolicyStatsResponse" });
|
|
22690
|
-
|
|
22691
22791
|
// ../../packages/schema/src/zod/project-files.ts
|
|
22692
22792
|
var ProjectFileInput = external_exports.object({
|
|
22693
22793
|
path: external_exports.string().min(1),
|
|
@@ -22927,10 +23027,12 @@ var DismissRecommendedActionResponse = external_exports.object({ id: external_ex
|
|
|
22927
23027
|
var RecommendedActionIdParam = external_exports.object({ id: external_exports.string() });
|
|
22928
23028
|
|
|
22929
23029
|
// ../../packages/schema/src/zod/settings-action.ts
|
|
23030
|
+
var HistorySyncConsentChoice = external_exports.enum(["granted", "revoked", "unchanged"]).meta({ id: "HistorySyncConsentChoice" });
|
|
23031
|
+
var ModelJudgeConsentChoice = external_exports.enum(["granted", "revoked", "unchanged"]).meta({ id: "ModelJudgeConsentChoice" });
|
|
22930
23032
|
var SaveSettingsInput = external_exports.object({
|
|
22931
23033
|
historicalAccess: external_exports.string(),
|
|
22932
|
-
modelJudgeConsent:
|
|
22933
|
-
historySyncConsent:
|
|
23034
|
+
modelJudgeConsent: ModelJudgeConsentChoice,
|
|
23035
|
+
historySyncConsent: HistorySyncConsentChoice,
|
|
22934
23036
|
vaultConsent: external_exports.string(),
|
|
22935
23037
|
vaultInlineReveal: external_exports.string()
|
|
22936
23038
|
});
|
|
@@ -23064,7 +23166,7 @@ var USE_SHELL = process.platform === "win32";
|
|
|
23064
23166
|
|
|
23065
23167
|
// ../../packages/plugin-sdk/src/config.ts
|
|
23066
23168
|
import { existsSync as existsSync7 } from "fs";
|
|
23067
|
-
import { join as
|
|
23169
|
+
import { join as join13 } from "path";
|
|
23068
23170
|
|
|
23069
23171
|
// ../../packages/persistence/src/attached-derived.ts
|
|
23070
23172
|
import { rmSync } from "fs";
|
|
@@ -23087,8 +23189,8 @@ import {
|
|
|
23087
23189
|
import { threadId } from "worker_threads";
|
|
23088
23190
|
|
|
23089
23191
|
// ../../packages/persistence/src/database.ts
|
|
23090
|
-
import { randomUUID as
|
|
23091
|
-
import { join as
|
|
23192
|
+
import { randomUUID as randomUUID11 } from "crypto";
|
|
23193
|
+
import { dirname as dirname2, join as join7, sep } from "path";
|
|
23092
23194
|
import { DatabaseSync } from "node:sqlite";
|
|
23093
23195
|
|
|
23094
23196
|
// ../../packages/persistence/src/ids.ts
|
|
@@ -23104,6 +23206,20 @@ var STAGED_NAME_SUFFIX = `.bak${SNAPSHOT_STAGING_SUFFIX}`;
|
|
|
23104
23206
|
|
|
23105
23207
|
// ../../packages/persistence/src/repositories/activity.ts
|
|
23106
23208
|
var LIVE_ACTIVITY_WINDOW_MS = 30 * 6e4;
|
|
23209
|
+
var DB_EVENT_TYPE_TO_KIND = {
|
|
23210
|
+
session: "session",
|
|
23211
|
+
prompt: "prompt",
|
|
23212
|
+
response: "response",
|
|
23213
|
+
tool_call: "tool",
|
|
23214
|
+
hook: "hook",
|
|
23215
|
+
detection: "detection",
|
|
23216
|
+
share: "share",
|
|
23217
|
+
permission: "permission",
|
|
23218
|
+
commit: "commit",
|
|
23219
|
+
error: "error",
|
|
23220
|
+
active: "active"
|
|
23221
|
+
};
|
|
23222
|
+
var TIMELINE_EVENT_TYPES = Object.keys(DB_EVENT_TYPE_TO_KIND).map((kind) => `'${kind}'`).join(", ");
|
|
23107
23223
|
var DEFAULT_HARNESS = HARNESS.ClaudeCode;
|
|
23108
23224
|
|
|
23109
23225
|
// ../../packages/persistence/src/repositories/exceptions.ts
|
|
@@ -23120,12 +23236,46 @@ var ACTIVE_REVEAL_GRANT_PREDICATE = `capability = 'reveal_to_model'
|
|
|
23120
23236
|
// ../../packages/persistence/src/repositories/history-sync.ts
|
|
23121
23237
|
var STRUCTURAL_EVENT_TYPES = ["session", "llm_call", "tool_call"];
|
|
23122
23238
|
var TYPE_LIST = STRUCTURAL_EVENT_TYPES.map((t) => `'${t}'`).join(", ");
|
|
23239
|
+
var OUTBOX_CAPTURE_EVENT_TYPES = ["prompt", "response", "tool_use"];
|
|
23240
|
+
var CAPTURE_TYPE_LIST = OUTBOX_CAPTURE_EVENT_TYPES.map((t) => `'${t}'`).join(", ");
|
|
23123
23241
|
|
|
23124
23242
|
// ../../packages/persistence/src/repositories/installed-packs.ts
|
|
23125
|
-
import { createHash as createHash2, randomUUID as
|
|
23243
|
+
import { createHash as createHash2, randomUUID as randomUUID4 } from "crypto";
|
|
23244
|
+
|
|
23245
|
+
// ../../packages/persistence/src/policy-floor.ts
|
|
23246
|
+
import { readFileSync as readFileSync5 } from "fs";
|
|
23247
|
+
import { join as join6 } from "path";
|
|
23248
|
+
|
|
23249
|
+
// ../../packages/persistence/src/local-layout.ts
|
|
23250
|
+
import { renameSync as renameSync3 } from "fs";
|
|
23251
|
+
import { mkdir } from "fs/promises";
|
|
23252
|
+
import { homedir } from "os";
|
|
23253
|
+
import { join as join4 } from "path";
|
|
23254
|
+
|
|
23255
|
+
// ../../packages/persistence/src/settings.ts
|
|
23256
|
+
import { readFileSync as readFileSync4 } from "fs";
|
|
23257
|
+
import { join as join5 } from "path";
|
|
23258
|
+
|
|
23259
|
+
// ../../packages/persistence/src/file-lock.ts
|
|
23260
|
+
import { randomUUID as randomUUID3 } from "crypto";
|
|
23261
|
+
import {
|
|
23262
|
+
closeSync,
|
|
23263
|
+
existsSync as existsSync2,
|
|
23264
|
+
openSync,
|
|
23265
|
+
readFileSync as readFileSync2,
|
|
23266
|
+
rmSync as rmSync5,
|
|
23267
|
+
statSync as statSync3,
|
|
23268
|
+
writeFileSync as writeFileSync2
|
|
23269
|
+
} from "fs";
|
|
23270
|
+
import { hostname as hostname3 } from "os";
|
|
23271
|
+
var PARK = new Int32Array(new SharedArrayBuffer(4));
|
|
23272
|
+
|
|
23273
|
+
// ../../packages/persistence/src/managed-settings.ts
|
|
23274
|
+
import { readFileSync as readFileSync3 } from "fs";
|
|
23275
|
+
import { posix, win32 } from "path";
|
|
23126
23276
|
|
|
23127
23277
|
// ../../packages/persistence/src/repositories/inventory-assets.ts
|
|
23128
|
-
import { randomUUID as
|
|
23278
|
+
import { randomUUID as randomUUID5 } from "crypto";
|
|
23129
23279
|
var VALID_HARNESS_IDS = new Set(HarnessId.options);
|
|
23130
23280
|
var HARNESS_LABELS = {
|
|
23131
23281
|
[HARNESS.ClaudeCode]: "Claude Code",
|
|
@@ -23143,16 +23293,16 @@ var TITLE_NEEDLES = {
|
|
|
23143
23293
|
};
|
|
23144
23294
|
|
|
23145
23295
|
// ../../packages/persistence/src/repositories/policies.ts
|
|
23146
|
-
import { randomUUID as
|
|
23296
|
+
import { randomUUID as randomUUID6 } from "crypto";
|
|
23147
23297
|
|
|
23148
23298
|
// ../../packages/persistence/src/repositories/project-files.ts
|
|
23149
|
-
import { randomUUID as
|
|
23299
|
+
import { randomUUID as randomUUID7 } from "crypto";
|
|
23150
23300
|
|
|
23151
23301
|
// ../../packages/persistence/src/repositories/resolutions.ts
|
|
23152
|
-
import { randomUUID as
|
|
23302
|
+
import { randomUUID as randomUUID8 } from "crypto";
|
|
23153
23303
|
|
|
23154
23304
|
// ../../packages/persistence/src/repositories/secret-vault.ts
|
|
23155
|
-
import { randomUUID as
|
|
23305
|
+
import { randomUUID as randomUUID9 } from "crypto";
|
|
23156
23306
|
|
|
23157
23307
|
// ../../packages/persistence/src/repositories/security.ts
|
|
23158
23308
|
var SCAN_COVERAGE = {
|
|
@@ -23167,53 +23317,28 @@ var SCAN_COVERAGE = {
|
|
|
23167
23317
|
};
|
|
23168
23318
|
|
|
23169
23319
|
// ../../packages/persistence/src/repositories/shares.ts
|
|
23170
|
-
import { randomUUID as
|
|
23320
|
+
import { randomUUID as randomUUID10 } from "crypto";
|
|
23171
23321
|
|
|
23172
|
-
// ../../packages/persistence/src/
|
|
23173
|
-
|
|
23174
|
-
import {
|
|
23175
|
-
closeSync,
|
|
23176
|
-
existsSync as existsSync2,
|
|
23177
|
-
openSync,
|
|
23178
|
-
readFileSync as readFileSync2,
|
|
23179
|
-
rmSync as rmSync5,
|
|
23180
|
-
statSync as statSync3,
|
|
23181
|
-
writeFileSync as writeFileSync2
|
|
23182
|
-
} from "fs";
|
|
23183
|
-
import { hostname as hostname3 } from "os";
|
|
23184
|
-
var PARK = new Int32Array(new SharedArrayBuffer(4));
|
|
23322
|
+
// ../../packages/persistence/src/database.ts
|
|
23323
|
+
var CAPTURE_GRAIN = new Set(EventKind.options);
|
|
23185
23324
|
|
|
23186
23325
|
// ../../packages/persistence/src/finding-key.ts
|
|
23187
23326
|
import { createHash as createHash3 } from "crypto";
|
|
23188
23327
|
|
|
23189
23328
|
// ../../packages/persistence/src/fingerprint.ts
|
|
23190
23329
|
import { createHmac, randomBytes } from "crypto";
|
|
23191
|
-
import { existsSync as existsSync3, readFileSync as
|
|
23192
|
-
import { join as
|
|
23330
|
+
import { existsSync as existsSync3, readFileSync as readFileSync6 } from "fs";
|
|
23331
|
+
import { join as join8 } from "path";
|
|
23193
23332
|
import { DatabaseSync as DatabaseSync2 } from "node:sqlite";
|
|
23194
23333
|
|
|
23195
23334
|
// ../../packages/persistence/src/history-preview.ts
|
|
23196
23335
|
import { existsSync as existsSync4 } from "fs";
|
|
23197
|
-
import { join as
|
|
23336
|
+
import { join as join9 } from "path";
|
|
23198
23337
|
import { DatabaseSync as DatabaseSync3 } from "node:sqlite";
|
|
23199
23338
|
|
|
23200
|
-
// ../../packages/persistence/src/local-layout.ts
|
|
23201
|
-
import { renameSync as renameSync3 } from "fs";
|
|
23202
|
-
import { mkdir } from "fs/promises";
|
|
23203
|
-
import { homedir } from "os";
|
|
23204
|
-
import { join as join7 } from "path";
|
|
23205
|
-
|
|
23206
|
-
// ../../packages/persistence/src/managed-settings.ts
|
|
23207
|
-
import { readFileSync as readFileSync4 } from "fs";
|
|
23208
|
-
import { posix, win32 } from "path";
|
|
23209
|
-
|
|
23210
|
-
// ../../packages/persistence/src/settings.ts
|
|
23211
|
-
import { readFileSync as readFileSync5 } from "fs";
|
|
23212
|
-
import { join as join8 } from "path";
|
|
23213
|
-
|
|
23214
23339
|
// ../../packages/persistence/src/store-symlinks.ts
|
|
23215
23340
|
import { existsSync as existsSync5, lstatSync as lstatSync3, readlinkSync, realpathSync, statSync as statSync4 } from "fs";
|
|
23216
|
-
import { dirname as
|
|
23341
|
+
import { dirname as dirname3, join as join10, resolve } from "path";
|
|
23217
23342
|
|
|
23218
23343
|
// ../../packages/persistence/src/vault/crypto.ts
|
|
23219
23344
|
import {
|
|
@@ -23227,15 +23352,15 @@ import {
|
|
|
23227
23352
|
// ../../packages/persistence/src/vault/key-provider.ts
|
|
23228
23353
|
import { execFileSync as execFileSync2 } from "child_process";
|
|
23229
23354
|
import { randomBytes as randomBytes2 } from "crypto";
|
|
23230
|
-
import { chmodSync as chmodSync3, readFileSync as
|
|
23231
|
-
import { join as
|
|
23355
|
+
import { chmodSync as chmodSync3, readFileSync as readFileSync7, renameSync as renameSync4, rmSync as rmSync6, statSync as statSync5, writeFileSync as writeFileSync3 } from "fs";
|
|
23356
|
+
import { join as join11 } from "path";
|
|
23232
23357
|
|
|
23233
23358
|
// ../../packages/persistence/src/vault/vault.ts
|
|
23234
23359
|
import { randomBytes as randomBytes3, randomUUID as randomUUID12 } from "crypto";
|
|
23235
23360
|
|
|
23236
23361
|
// ../../packages/persistence/src/warn-era-cap.ts
|
|
23237
23362
|
import { existsSync as existsSync6, writeFileSync as writeFileSync4 } from "fs";
|
|
23238
|
-
import { join as
|
|
23363
|
+
import { join as join12 } from "path";
|
|
23239
23364
|
|
|
23240
23365
|
// ../../packages/plugin-sdk/src/provider-env.ts
|
|
23241
23366
|
var booleanish = external_exports.string().optional().transform((v) => {
|
|
@@ -23256,9 +23381,9 @@ var providerEnvShape = {
|
|
|
23256
23381
|
var ProviderEnvSchema = external_exports.object(providerEnvShape);
|
|
23257
23382
|
|
|
23258
23383
|
// ../../packages/plugin-sdk/src/config-inventory.ts
|
|
23259
|
-
import { readdirSync as readdirSync2, readFileSync as
|
|
23384
|
+
import { readdirSync as readdirSync2, readFileSync as readFileSync9, realpathSync as realpathSync2, statSync as statSync7 } from "fs";
|
|
23260
23385
|
import { homedir as homedir2 } from "os";
|
|
23261
|
-
import { basename as basename3, join as
|
|
23386
|
+
import { basename as basename3, join as join15 } from "path";
|
|
23262
23387
|
|
|
23263
23388
|
// ../../packages/detections/src/egress/registry.ts
|
|
23264
23389
|
var EXTRACTOR_VERSION = "1";
|
|
@@ -24016,8 +24141,8 @@ var CPU_CORROBORATION_SHARE = 0.2;
|
|
|
24016
24141
|
var CORROBORATION_FLOOR_MS = BUDGET_MS * CPU_CORROBORATION_SHARE;
|
|
24017
24142
|
|
|
24018
24143
|
// ../../packages/plugin-sdk/src/repo.ts
|
|
24019
|
-
import { existsSync as existsSync8, readFileSync as
|
|
24020
|
-
import { basename as basename2, dirname as
|
|
24144
|
+
import { existsSync as existsSync8, readFileSync as readFileSync8, statSync as statSync6 } from "fs";
|
|
24145
|
+
import { basename as basename2, dirname as dirname4, isAbsolute, join as join14, sep as sep2 } from "path";
|
|
24021
24146
|
|
|
24022
24147
|
// ../../packages/plugin-sdk/src/events.ts
|
|
24023
24148
|
import { createHash as createHash4, randomUUID as randomUUID13 } from "crypto";
|
|
@@ -24029,8 +24154,8 @@ import { Worker } from "worker_threads";
|
|
|
24029
24154
|
|
|
24030
24155
|
// ../../packages/plugin-sdk/src/ignore-layers.ts
|
|
24031
24156
|
var import_ignore = __toESM(require_ignore(), 1);
|
|
24032
|
-
import { readFileSync as
|
|
24033
|
-
import { join as
|
|
24157
|
+
import { readFileSync as readFileSync10 } from "fs";
|
|
24158
|
+
import { join as join16 } from "path";
|
|
24034
24159
|
|
|
24035
24160
|
// ../../packages/plugin-sdk/src/inventory-resolver.ts
|
|
24036
24161
|
import { arch, hostname as hostname4, platform, release } from "os";
|
|
@@ -24041,24 +24166,24 @@ import {
|
|
|
24041
24166
|
fstatSync,
|
|
24042
24167
|
mkdirSync as mkdirSync2,
|
|
24043
24168
|
openSync as openSync2,
|
|
24044
|
-
readFileSync as
|
|
24169
|
+
readFileSync as readFileSync11,
|
|
24045
24170
|
readSync,
|
|
24046
24171
|
writeFileSync as writeFileSync5
|
|
24047
24172
|
} from "fs";
|
|
24048
|
-
import { join as
|
|
24173
|
+
import { join as join17 } from "path";
|
|
24049
24174
|
var TAIL_BYTES = 256 * 1024;
|
|
24050
24175
|
|
|
24051
24176
|
// ../../packages/plugin-sdk/src/nudge.ts
|
|
24052
|
-
import { mkdirSync as mkdirSync3, readFileSync as
|
|
24053
|
-
import { join as
|
|
24177
|
+
import { mkdirSync as mkdirSync3, readFileSync as readFileSync12, writeFileSync as writeFileSync6 } from "fs";
|
|
24178
|
+
import { join as join18 } from "path";
|
|
24054
24179
|
|
|
24055
24180
|
// ../../packages/plugin-sdk/src/paths.ts
|
|
24056
24181
|
import { readdirSync as readdirSync3, realpathSync as realpathSync3 } from "fs";
|
|
24057
|
-
import { basename as basename4, dirname as
|
|
24182
|
+
import { basename as basename4, dirname as dirname5, sep as sep3 } from "path";
|
|
24058
24183
|
|
|
24059
24184
|
// ../../packages/plugin-sdk/src/project-files.ts
|
|
24060
24185
|
import { existsSync as existsSync10, readdirSync as readdirSync4 } from "fs";
|
|
24061
|
-
import { basename as basename5, join as
|
|
24186
|
+
import { basename as basename5, join as join19 } from "path";
|
|
24062
24187
|
|
|
24063
24188
|
// ../../packages/plugin-sdk/src/provider-env-antigravity.ts
|
|
24064
24189
|
var optionalBaseUrl2 = external_exports.preprocess((v) => {
|
|
@@ -24094,11 +24219,11 @@ var THIRTY_DAYS_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
|
24094
24219
|
|
|
24095
24220
|
// ../../packages/plugin-sdk/src/throttle.ts
|
|
24096
24221
|
import { mkdirSync as mkdirSync4, statSync as statSync8, writeFileSync as writeFileSync7 } from "fs";
|
|
24097
|
-
import { join as
|
|
24222
|
+
import { join as join20 } from "path";
|
|
24098
24223
|
|
|
24099
24224
|
// ../../packages/setup-wizard/src/remediation/rotation-checklist.ts
|
|
24100
24225
|
import { writeFileSync as writeFileSync8 } from "fs";
|
|
24101
|
-
import { join as
|
|
24226
|
+
import { join as join21 } from "path";
|
|
24102
24227
|
|
|
24103
24228
|
// ../../packages/setup-wizard/src/triage/merge.ts
|
|
24104
24229
|
var RANK = Object.fromEntries(
|
|
@@ -24106,9 +24231,9 @@ var RANK = Object.fromEntries(
|
|
|
24106
24231
|
);
|
|
24107
24232
|
|
|
24108
24233
|
// ../../packages/setup-wizard/src/triage/plan-file.ts
|
|
24109
|
-
import { mkdtempSync, readFileSync as
|
|
24234
|
+
import { mkdtempSync, readFileSync as readFileSync13, rmdirSync, rmSync as rmSync7, writeFileSync as writeFileSync9 } from "fs";
|
|
24110
24235
|
import { tmpdir } from "os";
|
|
24111
|
-
import { basename as basename6, dirname as
|
|
24236
|
+
import { basename as basename6, dirname as dirname6, join as join22 } from "path";
|
|
24112
24237
|
var SuppressionEntrySchema = external_exports.object({
|
|
24113
24238
|
ruleId: external_exports.string(),
|
|
24114
24239
|
category: DetectionCategory,
|
|
@@ -24251,7 +24376,7 @@ function buildIntroCard(manifest2, verified) {
|
|
|
24251
24376
|
var manifestPath = process.argv[2];
|
|
24252
24377
|
var manifest = {};
|
|
24253
24378
|
try {
|
|
24254
|
-
manifest = JSON.parse(
|
|
24379
|
+
manifest = JSON.parse(readFileSync14(manifestPath ?? "", "utf8"));
|
|
24255
24380
|
} catch {
|
|
24256
24381
|
}
|
|
24257
24382
|
process.stdout.write(show(fenced(buildIntroCard(manifest))));
|