@akasecurity/ai-tc-antigravity 0.9.21 → 0.9.23
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/package.json +4 -4
- package/plugin.json +1 -1
- package/scripts/apply-suppressions.js +377 -33
- package/scripts/backfill.js +576 -92
- package/scripts/content-retention.js +138 -37
- package/scripts/fail-open-count.js +49 -6
- package/scripts/filescan.js +637 -136
- package/scripts/firstrun.js +536 -84
- package/scripts/history-sync.js +468 -62
- package/scripts/intro.js +47 -6
- package/scripts/onboard.js +351 -26
- package/scripts/post-tool-use.js +89 -33
- package/scripts/pre-invocation.js +595 -130
- package/scripts/pre-tool-use.js +574 -90
- package/scripts/query.js +535 -83
- package/scripts/reconcile.js +539 -86
- package/scripts/remediate.js +587 -99
- package/scripts/scan-worker.js +89 -14
- package/scripts/start-light.js +47 -6
- package/scripts/stop.js +89 -33
- package/scripts/sync.js +643 -142
package/scripts/scan-worker.js
CHANGED
|
@@ -8526,6 +8526,12 @@ var CaptureSighting = object({
|
|
|
8526
8526
|
ruleId: string2().min(1),
|
|
8527
8527
|
category: DetectionCategory
|
|
8528
8528
|
}).meta({ id: "CaptureSighting" });
|
|
8529
|
+
var REVIEW_VALUES_MAX = 16;
|
|
8530
|
+
var REVIEW_VALUE_MAX_CHARS = 1024;
|
|
8531
|
+
var ReviewValue = object({
|
|
8532
|
+
ruleId: string2().min(1).max(256),
|
|
8533
|
+
value: string2().min(1).max(REVIEW_VALUE_MAX_CHARS)
|
|
8534
|
+
}).meta({ id: "ReviewValue" });
|
|
8529
8535
|
var EventMetadata = object({
|
|
8530
8536
|
sessionId: string2().optional(),
|
|
8531
8537
|
repo: string2().optional(),
|
|
@@ -8633,7 +8639,14 @@ var EventMetadata = object({
|
|
|
8633
8639
|
scanIncomplete: _enum(["timeout", "unavailable"]).optional(),
|
|
8634
8640
|
// The sighting tokens in `content`, one entry per distinct token and rule.
|
|
8635
8641
|
// Set only on a forwarded capture; the locally stored copy holds the values.
|
|
8636
|
-
sightings: array(CaptureSighting).optional()
|
|
8642
|
+
sightings: array(CaptureSighting).optional(),
|
|
8643
|
+
// The length of the text this capture was cut from, when its content holds only the first
|
|
8644
|
+
// part of it. Absent when the content is the whole text.
|
|
8645
|
+
contentTruncatedFrom: number2().int().nonnegative().optional(),
|
|
8646
|
+
// The raw value of each finding in this capture, for review by the deployment. Set only on
|
|
8647
|
+
// a forwarded capture from a repository the organization's capture settings name; the
|
|
8648
|
+
// locally stored copy never carries it.
|
|
8649
|
+
reviewValues: array(ReviewValue).max(REVIEW_VALUES_MAX).optional()
|
|
8637
8650
|
}).meta({ id: "EventMetadata" });
|
|
8638
8651
|
var Event = object({
|
|
8639
8652
|
id: guid2(),
|
|
@@ -9624,7 +9637,7 @@ var McpTool = object({
|
|
|
9624
9637
|
signature: string2(),
|
|
9625
9638
|
description: string2(),
|
|
9626
9639
|
write: boolean2(),
|
|
9627
|
-
/**
|
|
9640
|
+
/** What makes the tool dangerous; null when nothing does. */
|
|
9628
9641
|
risk: string2().nullable()
|
|
9629
9642
|
}).meta({ id: "McpTool" });
|
|
9630
9643
|
var AssetFindingRef = object({
|
|
@@ -9671,8 +9684,9 @@ var ProjectSensitiveData = object({ items: array(SensitiveDataClass) }).meta({ i
|
|
|
9671
9684
|
var ListProjectsResponse = object({ items: array(ProjectSummary) }).meta({ id: "ListProjectsResponse" });
|
|
9672
9685
|
var InventoryStats = object({
|
|
9673
9686
|
/**
|
|
9674
|
-
* Assets with a flag
|
|
9675
|
-
*
|
|
9687
|
+
* Assets with a flag or with an `ATTENTION_TRUST_LEVELS` effective trust,
|
|
9688
|
+
* plus projects with a finding in the last `PROJECT_FINDINGS_WINDOW_DAYS`
|
|
9689
|
+
* days (drives the attention header chip). An asset counts once.
|
|
9676
9690
|
*/
|
|
9677
9691
|
attention: number2().int().nonnegative(),
|
|
9678
9692
|
byType: object({
|
|
@@ -10195,6 +10209,10 @@ var EgressIngestHit = object({
|
|
|
10195
10209
|
*/
|
|
10196
10210
|
credentialRefs: EgressCredentialRefs.optional()
|
|
10197
10211
|
}).meta({ id: "EgressIngestHit" });
|
|
10212
|
+
var SUPERSEDED_PROJECT_KEYS_MAX = 4;
|
|
10213
|
+
var SupersededProjectKeys = array(
|
|
10214
|
+
string2().regex(/^[0-9a-f]{64}$/, "a superseded key must be a 64-character lowercase hex digest")
|
|
10215
|
+
).max(SUPERSEDED_PROJECT_KEYS_MAX);
|
|
10198
10216
|
var EgressIngestRequest = object({
|
|
10199
10217
|
/**
|
|
10200
10218
|
* Hash digest of the local `projectKey`, never the plaintext.
|
|
@@ -10207,6 +10225,7 @@ var EgressIngestRequest = object({
|
|
|
10207
10225
|
* that still has the plaintext to not send.
|
|
10208
10226
|
*/
|
|
10209
10227
|
projectKey: string2().regex(/^[0-9a-f]{64}$/, "projectKey must be a 64-character lowercase hex digest"),
|
|
10228
|
+
supersededProjectKeys: SupersededProjectKeys.optional(),
|
|
10210
10229
|
/** Display name only — never keys reconciliation. */
|
|
10211
10230
|
project: string2(),
|
|
10212
10231
|
reconcile: EgressReconcile,
|
|
@@ -10316,6 +10335,10 @@ var DeviceCommand = object({
|
|
|
10316
10335
|
expiresAt: printable(64).min(1)
|
|
10317
10336
|
}).strict();
|
|
10318
10337
|
var DeviceCommandPollResponse = object({ command: DeviceCommand.nullable() });
|
|
10338
|
+
var SessionHoldResponse = object({
|
|
10339
|
+
held: boolean2(),
|
|
10340
|
+
reason: printable(500).optional()
|
|
10341
|
+
});
|
|
10319
10342
|
var DeviceCommandFailureReason = _enum(["scan_failed", "no_projects", "expired"]);
|
|
10320
10343
|
var DeviceCommandAckBody = discriminatedUnion("outcome", [
|
|
10321
10344
|
object({
|
|
@@ -10378,7 +10401,9 @@ var CredentialSighting = object({
|
|
|
10378
10401
|
}).strict().meta({ id: "CredentialSighting" });
|
|
10379
10402
|
var CredentialSightingsRequest = object({
|
|
10380
10403
|
sightings: array(CredentialSighting).min(1).max(CREDENTIAL_SIGHTINGS_BATCH_MAX),
|
|
10381
|
-
scanId: uuid2().optional()
|
|
10404
|
+
scanId: uuid2().optional(),
|
|
10405
|
+
/** The earlier digests of the one project every sighting in the request names. */
|
|
10406
|
+
supersededProjectKeys: SupersededProjectKeys.optional()
|
|
10382
10407
|
}).strict().meta({ id: "CredentialSightingsRequest" });
|
|
10383
10408
|
var CredentialSightingsAck = object({
|
|
10384
10409
|
accepted: number2().int().nonnegative()
|
|
@@ -10509,6 +10534,18 @@ var ModelPolicy = object({
|
|
|
10509
10534
|
mode: literal("allowlist"),
|
|
10510
10535
|
approved: array(string2().min(1).max(512)).max(1e3)
|
|
10511
10536
|
}).meta({ id: "ModelPolicy" });
|
|
10537
|
+
var TOOL_OUTPUT_FORWARD_MIN_CHARS = 2;
|
|
10538
|
+
var TOOL_OUTPUT_FORWARD_MAX_CHARS = 65536;
|
|
10539
|
+
var CAPTURE_REPOS_MAX = 1e3;
|
|
10540
|
+
var CaptureRepos = array(string2().min(1).max(512)).max(CAPTURE_REPOS_MAX);
|
|
10541
|
+
var CaptureSettings = object({
|
|
10542
|
+
toolOutput: object({
|
|
10543
|
+
maxChars: number2().int().min(TOOL_OUTPUT_FORWARD_MIN_CHARS).max(TOOL_OUTPUT_FORWARD_MAX_CHARS),
|
|
10544
|
+
repos: CaptureRepos.optional()
|
|
10545
|
+
}).optional(),
|
|
10546
|
+
reviewValueRepos: CaptureRepos.optional(),
|
|
10547
|
+
sessionHold: boolean2().optional()
|
|
10548
|
+
}).meta({ id: "CaptureSettings" });
|
|
10512
10549
|
var PolicyBundle = object({
|
|
10513
10550
|
version: string2(),
|
|
10514
10551
|
policies: array(Policy),
|
|
@@ -10572,6 +10609,9 @@ var PolicyBundle = object({
|
|
|
10572
10609
|
// absent leaves the device's own setting in force, which is the behaviour
|
|
10573
10610
|
// that predates the field and the safe direction to default.
|
|
10574
10611
|
redactFallback: RedactFallback.optional(),
|
|
10612
|
+
// Optional so an older backend, and an older on-disk cache, still parses; absent sends what
|
|
10613
|
+
// the machine sent before the field existed.
|
|
10614
|
+
capture: CaptureSettings.optional(),
|
|
10575
10615
|
customKeywords: array(string2()),
|
|
10576
10616
|
fetchedAt: iso_exports.datetime()
|
|
10577
10617
|
}).meta({ id: "PolicyBundle" });
|
|
@@ -10580,7 +10620,8 @@ var POLICY_BUNDLE_SHAPE_ID = [
|
|
|
10580
10620
|
...Object.keys(Policy.shape).map((key) => `policies.${key}`),
|
|
10581
10621
|
...PolicyTarget.options.flatMap((member) => "shape" in member ? Object.keys(member.shape) : []).map((key) => `policies.target.${key}`),
|
|
10582
10622
|
...Object.keys(ExceptionBundleEntry.shape).map((key) => `exceptions.${key}`),
|
|
10583
|
-
...Object.keys(ModelPolicy.shape).map((key) => `modelPolicy.${key}`)
|
|
10623
|
+
...Object.keys(ModelPolicy.shape).map((key) => `modelPolicy.${key}`),
|
|
10624
|
+
...Object.keys(CaptureSettings.shape).map((key) => `capture.${key}`)
|
|
10584
10625
|
].sort().join(",");
|
|
10585
10626
|
var OBSERVE_ONLY_CATEGORIES = ["config"];
|
|
10586
10627
|
var ENFORCEABLE_CATEGORIES = DetectionCategory.options.filter((c) => !OBSERVE_ONLY_CATEGORIES.includes(c));
|
|
@@ -13454,6 +13495,21 @@ function passesPostValidators(rule, value) {
|
|
|
13454
13495
|
function getLoadedRules() {
|
|
13455
13496
|
return [...packs.values()].flatMap((p) => p.rules);
|
|
13456
13497
|
}
|
|
13498
|
+
function outsideWrittenRegions(candidates, context) {
|
|
13499
|
+
const regions = context?.writtenRegions;
|
|
13500
|
+
if (!regions || regions.length === 0 || context.eventKind !== "tool_use") return candidates;
|
|
13501
|
+
return candidates.filter((c) => {
|
|
13502
|
+
if (c.rule.category !== "code_flaw") return true;
|
|
13503
|
+
const { start, end } = c.match.span;
|
|
13504
|
+
return !regions.some(
|
|
13505
|
+
(r) => r.start <= start && end <= r.end && ruleApplies(
|
|
13506
|
+
c.rule,
|
|
13507
|
+
r.filePath === void 0 ? void 0 : extensionOf(r.filePath),
|
|
13508
|
+
"code_change"
|
|
13509
|
+
)
|
|
13510
|
+
);
|
|
13511
|
+
});
|
|
13512
|
+
}
|
|
13457
13513
|
function spansOverlap(a, b) {
|
|
13458
13514
|
return a.start < b.end && a.end > b.start;
|
|
13459
13515
|
}
|
|
@@ -13641,17 +13697,20 @@ function scanEncoded(text, ruleset2, context) {
|
|
|
13641
13697
|
function scanText(text, ruleset2, context) {
|
|
13642
13698
|
const extension = context?.filePath ? extensionOf(context.filePath) : void 0;
|
|
13643
13699
|
const normalization = normalizeFormatChars(text);
|
|
13644
|
-
const originalCandidates =
|
|
13700
|
+
const originalCandidates = outsideWrittenRegions(
|
|
13701
|
+
buildCandidates(text, ruleset2, extension, context?.eventKind),
|
|
13702
|
+
context
|
|
13703
|
+
);
|
|
13645
13704
|
if (!normalization) return gate(originalCandidates, text, void 0);
|
|
13646
13705
|
const pooledOriginal = originalCandidates.map(
|
|
13647
13706
|
(candidate) => withNormalizedSpan(candidate, normalization)
|
|
13648
13707
|
);
|
|
13649
|
-
const normalizedCandidates =
|
|
13650
|
-
normalization.normalized,
|
|
13651
|
-
|
|
13652
|
-
|
|
13653
|
-
context
|
|
13654
|
-
)
|
|
13708
|
+
const normalizedCandidates = outsideWrittenRegions(
|
|
13709
|
+
buildCandidates(normalization.normalized, ruleset2, extension, context?.eventKind).map(
|
|
13710
|
+
(candidate) => mapCandidateToOriginal(candidate, normalization, text)
|
|
13711
|
+
),
|
|
13712
|
+
context
|
|
13713
|
+
);
|
|
13655
13714
|
const findings = gate([...pooledOriginal, ...normalizedCandidates], text, normalization);
|
|
13656
13715
|
return mergeOverlappingSameRule(findings, text);
|
|
13657
13716
|
}
|
|
@@ -13974,6 +14033,21 @@ var ruleset = [...verified, ...unverified];
|
|
|
13974
14033
|
function post(message) {
|
|
13975
14034
|
port.postMessage(message);
|
|
13976
14035
|
}
|
|
14036
|
+
var MAX_REGIONS = 64;
|
|
14037
|
+
function validRegions(value, length) {
|
|
14038
|
+
if (!Array.isArray(value) || value.length === 0 || value.length > MAX_REGIONS) return void 0;
|
|
14039
|
+
let previousEnd = 0;
|
|
14040
|
+
for (const region of value) {
|
|
14041
|
+
if (typeof region !== "object" || region === null) return void 0;
|
|
14042
|
+
const { start, end, filePath } = region;
|
|
14043
|
+
if (filePath !== void 0 && typeof filePath !== "string") return void 0;
|
|
14044
|
+
if (typeof start !== "number" || typeof end !== "number") return void 0;
|
|
14045
|
+
if (!Number.isInteger(start) || !Number.isInteger(end)) return void 0;
|
|
14046
|
+
if (start < previousEnd || start >= end || end > length) return void 0;
|
|
14047
|
+
previousEnd = end;
|
|
14048
|
+
}
|
|
14049
|
+
return value;
|
|
14050
|
+
}
|
|
13977
14051
|
port.on("message", (job) => {
|
|
13978
14052
|
try {
|
|
13979
14053
|
if (job.kind === "probe") {
|
|
@@ -13989,7 +14063,8 @@ port.on("message", (job) => {
|
|
|
13989
14063
|
});
|
|
13990
14064
|
return;
|
|
13991
14065
|
}
|
|
13992
|
-
const
|
|
14066
|
+
const writtenRegions = validRegions(job.writtenRegions, job.text.length);
|
|
14067
|
+
const context = job.filePath === void 0 && job.eventKind === void 0 && writtenRegions === void 0 ? void 0 : { filePath: job.filePath, eventKind: job.eventKind, writtenRegions };
|
|
13993
14068
|
if (job.attribute) {
|
|
13994
14069
|
for (const [index, rule] of unverified.entries()) {
|
|
13995
14070
|
post({ kind: "progress", index });
|
package/scripts/start-light.js
CHANGED
|
@@ -8523,6 +8523,12 @@ var CaptureSighting = object({
|
|
|
8523
8523
|
ruleId: string2().min(1),
|
|
8524
8524
|
category: DetectionCategory
|
|
8525
8525
|
}).meta({ id: "CaptureSighting" });
|
|
8526
|
+
var REVIEW_VALUES_MAX = 16;
|
|
8527
|
+
var REVIEW_VALUE_MAX_CHARS = 1024;
|
|
8528
|
+
var ReviewValue = object({
|
|
8529
|
+
ruleId: string2().min(1).max(256),
|
|
8530
|
+
value: string2().min(1).max(REVIEW_VALUE_MAX_CHARS)
|
|
8531
|
+
}).meta({ id: "ReviewValue" });
|
|
8526
8532
|
var EventMetadata = object({
|
|
8527
8533
|
sessionId: string2().optional(),
|
|
8528
8534
|
repo: string2().optional(),
|
|
@@ -8630,7 +8636,14 @@ var EventMetadata = object({
|
|
|
8630
8636
|
scanIncomplete: _enum(["timeout", "unavailable"]).optional(),
|
|
8631
8637
|
// The sighting tokens in `content`, one entry per distinct token and rule.
|
|
8632
8638
|
// Set only on a forwarded capture; the locally stored copy holds the values.
|
|
8633
|
-
sightings: array(CaptureSighting).optional()
|
|
8639
|
+
sightings: array(CaptureSighting).optional(),
|
|
8640
|
+
// The length of the text this capture was cut from, when its content holds only the first
|
|
8641
|
+
// part of it. Absent when the content is the whole text.
|
|
8642
|
+
contentTruncatedFrom: number2().int().nonnegative().optional(),
|
|
8643
|
+
// The raw value of each finding in this capture, for review by the deployment. Set only on
|
|
8644
|
+
// a forwarded capture from a repository the organization's capture settings name; the
|
|
8645
|
+
// locally stored copy never carries it.
|
|
8646
|
+
reviewValues: array(ReviewValue).max(REVIEW_VALUES_MAX).optional()
|
|
8634
8647
|
}).meta({ id: "EventMetadata" });
|
|
8635
8648
|
var Event = object({
|
|
8636
8649
|
id: guid2(),
|
|
@@ -9621,7 +9634,7 @@ var McpTool = object({
|
|
|
9621
9634
|
signature: string2(),
|
|
9622
9635
|
description: string2(),
|
|
9623
9636
|
write: boolean2(),
|
|
9624
|
-
/**
|
|
9637
|
+
/** What makes the tool dangerous; null when nothing does. */
|
|
9625
9638
|
risk: string2().nullable()
|
|
9626
9639
|
}).meta({ id: "McpTool" });
|
|
9627
9640
|
var AssetFindingRef = object({
|
|
@@ -9668,8 +9681,9 @@ var ProjectSensitiveData = object({ items: array(SensitiveDataClass) }).meta({ i
|
|
|
9668
9681
|
var ListProjectsResponse = object({ items: array(ProjectSummary) }).meta({ id: "ListProjectsResponse" });
|
|
9669
9682
|
var InventoryStats = object({
|
|
9670
9683
|
/**
|
|
9671
|
-
* Assets with a flag
|
|
9672
|
-
*
|
|
9684
|
+
* Assets with a flag or with an `ATTENTION_TRUST_LEVELS` effective trust,
|
|
9685
|
+
* plus projects with a finding in the last `PROJECT_FINDINGS_WINDOW_DAYS`
|
|
9686
|
+
* days (drives the attention header chip). An asset counts once.
|
|
9673
9687
|
*/
|
|
9674
9688
|
attention: number2().int().nonnegative(),
|
|
9675
9689
|
byType: object({
|
|
@@ -10192,6 +10206,10 @@ var EgressIngestHit = object({
|
|
|
10192
10206
|
*/
|
|
10193
10207
|
credentialRefs: EgressCredentialRefs.optional()
|
|
10194
10208
|
}).meta({ id: "EgressIngestHit" });
|
|
10209
|
+
var SUPERSEDED_PROJECT_KEYS_MAX = 4;
|
|
10210
|
+
var SupersededProjectKeys = array(
|
|
10211
|
+
string2().regex(/^[0-9a-f]{64}$/, "a superseded key must be a 64-character lowercase hex digest")
|
|
10212
|
+
).max(SUPERSEDED_PROJECT_KEYS_MAX);
|
|
10195
10213
|
var EgressIngestRequest = object({
|
|
10196
10214
|
/**
|
|
10197
10215
|
* Hash digest of the local `projectKey`, never the plaintext.
|
|
@@ -10204,6 +10222,7 @@ var EgressIngestRequest = object({
|
|
|
10204
10222
|
* that still has the plaintext to not send.
|
|
10205
10223
|
*/
|
|
10206
10224
|
projectKey: string2().regex(/^[0-9a-f]{64}$/, "projectKey must be a 64-character lowercase hex digest"),
|
|
10225
|
+
supersededProjectKeys: SupersededProjectKeys.optional(),
|
|
10207
10226
|
/** Display name only — never keys reconciliation. */
|
|
10208
10227
|
project: string2(),
|
|
10209
10228
|
reconcile: EgressReconcile,
|
|
@@ -10313,6 +10332,10 @@ var DeviceCommand = object({
|
|
|
10313
10332
|
expiresAt: printable(64).min(1)
|
|
10314
10333
|
}).strict();
|
|
10315
10334
|
var DeviceCommandPollResponse = object({ command: DeviceCommand.nullable() });
|
|
10335
|
+
var SessionHoldResponse = object({
|
|
10336
|
+
held: boolean2(),
|
|
10337
|
+
reason: printable(500).optional()
|
|
10338
|
+
});
|
|
10316
10339
|
var DeviceCommandFailureReason = _enum(["scan_failed", "no_projects", "expired"]);
|
|
10317
10340
|
var DeviceCommandAckBody = discriminatedUnion("outcome", [
|
|
10318
10341
|
object({
|
|
@@ -10375,7 +10398,9 @@ var CredentialSighting = object({
|
|
|
10375
10398
|
}).strict().meta({ id: "CredentialSighting" });
|
|
10376
10399
|
var CredentialSightingsRequest = object({
|
|
10377
10400
|
sightings: array(CredentialSighting).min(1).max(CREDENTIAL_SIGHTINGS_BATCH_MAX),
|
|
10378
|
-
scanId: uuid2().optional()
|
|
10401
|
+
scanId: uuid2().optional(),
|
|
10402
|
+
/** The earlier digests of the one project every sighting in the request names. */
|
|
10403
|
+
supersededProjectKeys: SupersededProjectKeys.optional()
|
|
10379
10404
|
}).strict().meta({ id: "CredentialSightingsRequest" });
|
|
10380
10405
|
var CredentialSightingsAck = object({
|
|
10381
10406
|
accepted: number2().int().nonnegative()
|
|
@@ -10506,6 +10531,18 @@ var ModelPolicy = object({
|
|
|
10506
10531
|
mode: literal("allowlist"),
|
|
10507
10532
|
approved: array(string2().min(1).max(512)).max(1e3)
|
|
10508
10533
|
}).meta({ id: "ModelPolicy" });
|
|
10534
|
+
var TOOL_OUTPUT_FORWARD_MIN_CHARS = 2;
|
|
10535
|
+
var TOOL_OUTPUT_FORWARD_MAX_CHARS = 65536;
|
|
10536
|
+
var CAPTURE_REPOS_MAX = 1e3;
|
|
10537
|
+
var CaptureRepos = array(string2().min(1).max(512)).max(CAPTURE_REPOS_MAX);
|
|
10538
|
+
var CaptureSettings = object({
|
|
10539
|
+
toolOutput: object({
|
|
10540
|
+
maxChars: number2().int().min(TOOL_OUTPUT_FORWARD_MIN_CHARS).max(TOOL_OUTPUT_FORWARD_MAX_CHARS),
|
|
10541
|
+
repos: CaptureRepos.optional()
|
|
10542
|
+
}).optional(),
|
|
10543
|
+
reviewValueRepos: CaptureRepos.optional(),
|
|
10544
|
+
sessionHold: boolean2().optional()
|
|
10545
|
+
}).meta({ id: "CaptureSettings" });
|
|
10509
10546
|
var PolicyBundle = object({
|
|
10510
10547
|
version: string2(),
|
|
10511
10548
|
policies: array(Policy),
|
|
@@ -10569,6 +10606,9 @@ var PolicyBundle = object({
|
|
|
10569
10606
|
// absent leaves the device's own setting in force, which is the behaviour
|
|
10570
10607
|
// that predates the field and the safe direction to default.
|
|
10571
10608
|
redactFallback: RedactFallback.optional(),
|
|
10609
|
+
// Optional so an older backend, and an older on-disk cache, still parses; absent sends what
|
|
10610
|
+
// the machine sent before the field existed.
|
|
10611
|
+
capture: CaptureSettings.optional(),
|
|
10572
10612
|
customKeywords: array(string2()),
|
|
10573
10613
|
fetchedAt: iso_exports.datetime()
|
|
10574
10614
|
}).meta({ id: "PolicyBundle" });
|
|
@@ -10577,7 +10617,8 @@ var POLICY_BUNDLE_SHAPE_ID = [
|
|
|
10577
10617
|
...Object.keys(Policy.shape).map((key) => `policies.${key}`),
|
|
10578
10618
|
...PolicyTarget.options.flatMap((member) => "shape" in member ? Object.keys(member.shape) : []).map((key) => `policies.target.${key}`),
|
|
10579
10619
|
...Object.keys(ExceptionBundleEntry.shape).map((key) => `exceptions.${key}`),
|
|
10580
|
-
...Object.keys(ModelPolicy.shape).map((key) => `modelPolicy.${key}`)
|
|
10620
|
+
...Object.keys(ModelPolicy.shape).map((key) => `modelPolicy.${key}`),
|
|
10621
|
+
...Object.keys(CaptureSettings.shape).map((key) => `capture.${key}`)
|
|
10581
10622
|
].sort().join(",");
|
|
10582
10623
|
var OBSERVE_ONLY_CATEGORIES = ["config"];
|
|
10583
10624
|
var ENFORCEABLE_CATEGORIES = DetectionCategory.options.filter((c) => !OBSERVE_ONLY_CATEGORIES.includes(c));
|
package/scripts/stop.js
CHANGED
|
@@ -8545,6 +8545,12 @@ var CaptureSighting = object({
|
|
|
8545
8545
|
ruleId: string2().min(1),
|
|
8546
8546
|
category: DetectionCategory
|
|
8547
8547
|
}).meta({ id: "CaptureSighting" });
|
|
8548
|
+
var REVIEW_VALUES_MAX = 16;
|
|
8549
|
+
var REVIEW_VALUE_MAX_CHARS = 1024;
|
|
8550
|
+
var ReviewValue = object({
|
|
8551
|
+
ruleId: string2().min(1).max(256),
|
|
8552
|
+
value: string2().min(1).max(REVIEW_VALUE_MAX_CHARS)
|
|
8553
|
+
}).meta({ id: "ReviewValue" });
|
|
8548
8554
|
var EventMetadata = object({
|
|
8549
8555
|
sessionId: string2().optional(),
|
|
8550
8556
|
repo: string2().optional(),
|
|
@@ -8652,7 +8658,14 @@ var EventMetadata = object({
|
|
|
8652
8658
|
scanIncomplete: _enum(["timeout", "unavailable"]).optional(),
|
|
8653
8659
|
// The sighting tokens in `content`, one entry per distinct token and rule.
|
|
8654
8660
|
// Set only on a forwarded capture; the locally stored copy holds the values.
|
|
8655
|
-
sightings: array(CaptureSighting).optional()
|
|
8661
|
+
sightings: array(CaptureSighting).optional(),
|
|
8662
|
+
// The length of the text this capture was cut from, when its content holds only the first
|
|
8663
|
+
// part of it. Absent when the content is the whole text.
|
|
8664
|
+
contentTruncatedFrom: number2().int().nonnegative().optional(),
|
|
8665
|
+
// The raw value of each finding in this capture, for review by the deployment. Set only on
|
|
8666
|
+
// a forwarded capture from a repository the organization's capture settings name; the
|
|
8667
|
+
// locally stored copy never carries it.
|
|
8668
|
+
reviewValues: array(ReviewValue).max(REVIEW_VALUES_MAX).optional()
|
|
8656
8669
|
}).meta({ id: "EventMetadata" });
|
|
8657
8670
|
var Event = object({
|
|
8658
8671
|
id: guid2(),
|
|
@@ -9503,6 +9516,7 @@ var AssetType = _enum(["project", "skill", "mcp", "hook", "config"]).meta({ id:
|
|
|
9503
9516
|
var AccessLevel = _enum(["open", "approved", "blocked"]).meta({ id: "AccessLevel" });
|
|
9504
9517
|
var Origin = _enum(["source", "public-dep", "vendored", "config", "data", "docs", "generated"]).meta({ id: "Origin" });
|
|
9505
9518
|
var TrustLevel = _enum(["known-good", "risky", "unapproved"]).meta({ id: "TrustLevel" });
|
|
9519
|
+
var ATTENTION_TRUST_LEVELS = ["unapproved", "risky"];
|
|
9506
9520
|
var Flag = _enum(["update", "stale", "conflict", "unknown", "change", "untracked", "risk", "findings"]).meta({ id: "Flag" });
|
|
9507
9521
|
var Visibility = _enum(["public", "private"]).meta({ id: "Visibility" });
|
|
9508
9522
|
var HarnessEventKind = _enum(["block", "redact", "warn"]).meta({ id: "HarnessEventKind" });
|
|
@@ -9645,7 +9659,7 @@ var McpTool = object({
|
|
|
9645
9659
|
signature: string2(),
|
|
9646
9660
|
description: string2(),
|
|
9647
9661
|
write: boolean2(),
|
|
9648
|
-
/**
|
|
9662
|
+
/** What makes the tool dangerous; null when nothing does. */
|
|
9649
9663
|
risk: string2().nullable()
|
|
9650
9664
|
}).meta({ id: "McpTool" });
|
|
9651
9665
|
var AssetFindingRef = object({
|
|
@@ -9692,8 +9706,9 @@ var ProjectSensitiveData = object({ items: array(SensitiveDataClass) }).meta({ i
|
|
|
9692
9706
|
var ListProjectsResponse = object({ items: array(ProjectSummary) }).meta({ id: "ListProjectsResponse" });
|
|
9693
9707
|
var InventoryStats = object({
|
|
9694
9708
|
/**
|
|
9695
|
-
* Assets with a flag
|
|
9696
|
-
*
|
|
9709
|
+
* Assets with a flag or with an `ATTENTION_TRUST_LEVELS` effective trust,
|
|
9710
|
+
* plus projects with a finding in the last `PROJECT_FINDINGS_WINDOW_DAYS`
|
|
9711
|
+
* days (drives the attention header chip). An asset counts once.
|
|
9697
9712
|
*/
|
|
9698
9713
|
attention: number2().int().nonnegative(),
|
|
9699
9714
|
byType: object({
|
|
@@ -10216,6 +10231,10 @@ var EgressIngestHit = object({
|
|
|
10216
10231
|
*/
|
|
10217
10232
|
credentialRefs: EgressCredentialRefs.optional()
|
|
10218
10233
|
}).meta({ id: "EgressIngestHit" });
|
|
10234
|
+
var SUPERSEDED_PROJECT_KEYS_MAX = 4;
|
|
10235
|
+
var SupersededProjectKeys = array(
|
|
10236
|
+
string2().regex(/^[0-9a-f]{64}$/, "a superseded key must be a 64-character lowercase hex digest")
|
|
10237
|
+
).max(SUPERSEDED_PROJECT_KEYS_MAX);
|
|
10219
10238
|
var EgressIngestRequest = object({
|
|
10220
10239
|
/**
|
|
10221
10240
|
* Hash digest of the local `projectKey`, never the plaintext.
|
|
@@ -10228,6 +10247,7 @@ var EgressIngestRequest = object({
|
|
|
10228
10247
|
* that still has the plaintext to not send.
|
|
10229
10248
|
*/
|
|
10230
10249
|
projectKey: string2().regex(/^[0-9a-f]{64}$/, "projectKey must be a 64-character lowercase hex digest"),
|
|
10250
|
+
supersededProjectKeys: SupersededProjectKeys.optional(),
|
|
10231
10251
|
/** Display name only — never keys reconciliation. */
|
|
10232
10252
|
project: string2(),
|
|
10233
10253
|
reconcile: EgressReconcile,
|
|
@@ -10337,6 +10357,10 @@ var DeviceCommand = object({
|
|
|
10337
10357
|
expiresAt: printable(64).min(1)
|
|
10338
10358
|
}).strict();
|
|
10339
10359
|
var DeviceCommandPollResponse = object({ command: DeviceCommand.nullable() });
|
|
10360
|
+
var SessionHoldResponse = object({
|
|
10361
|
+
held: boolean2(),
|
|
10362
|
+
reason: printable(500).optional()
|
|
10363
|
+
});
|
|
10340
10364
|
var DeviceCommandFailureReason = _enum(["scan_failed", "no_projects", "expired"]);
|
|
10341
10365
|
var DeviceCommandAckBody = discriminatedUnion("outcome", [
|
|
10342
10366
|
object({
|
|
@@ -10399,7 +10423,9 @@ var CredentialSighting = object({
|
|
|
10399
10423
|
}).strict().meta({ id: "CredentialSighting" });
|
|
10400
10424
|
var CredentialSightingsRequest = object({
|
|
10401
10425
|
sightings: array(CredentialSighting).min(1).max(CREDENTIAL_SIGHTINGS_BATCH_MAX),
|
|
10402
|
-
scanId: uuid2().optional()
|
|
10426
|
+
scanId: uuid2().optional(),
|
|
10427
|
+
/** The earlier digests of the one project every sighting in the request names. */
|
|
10428
|
+
supersededProjectKeys: SupersededProjectKeys.optional()
|
|
10403
10429
|
}).strict().meta({ id: "CredentialSightingsRequest" });
|
|
10404
10430
|
var CredentialSightingsAck = object({
|
|
10405
10431
|
accepted: number2().int().nonnegative()
|
|
@@ -10530,6 +10556,18 @@ var ModelPolicy = object({
|
|
|
10530
10556
|
mode: literal("allowlist"),
|
|
10531
10557
|
approved: array(string2().min(1).max(512)).max(1e3)
|
|
10532
10558
|
}).meta({ id: "ModelPolicy" });
|
|
10559
|
+
var TOOL_OUTPUT_FORWARD_MIN_CHARS = 2;
|
|
10560
|
+
var TOOL_OUTPUT_FORWARD_MAX_CHARS = 65536;
|
|
10561
|
+
var CAPTURE_REPOS_MAX = 1e3;
|
|
10562
|
+
var CaptureRepos = array(string2().min(1).max(512)).max(CAPTURE_REPOS_MAX);
|
|
10563
|
+
var CaptureSettings = object({
|
|
10564
|
+
toolOutput: object({
|
|
10565
|
+
maxChars: number2().int().min(TOOL_OUTPUT_FORWARD_MIN_CHARS).max(TOOL_OUTPUT_FORWARD_MAX_CHARS),
|
|
10566
|
+
repos: CaptureRepos.optional()
|
|
10567
|
+
}).optional(),
|
|
10568
|
+
reviewValueRepos: CaptureRepos.optional(),
|
|
10569
|
+
sessionHold: boolean2().optional()
|
|
10570
|
+
}).meta({ id: "CaptureSettings" });
|
|
10533
10571
|
var PolicyBundle = object({
|
|
10534
10572
|
version: string2(),
|
|
10535
10573
|
policies: array(Policy),
|
|
@@ -10593,6 +10631,9 @@ var PolicyBundle = object({
|
|
|
10593
10631
|
// absent leaves the device's own setting in force, which is the behaviour
|
|
10594
10632
|
// that predates the field and the safe direction to default.
|
|
10595
10633
|
redactFallback: RedactFallback.optional(),
|
|
10634
|
+
// Optional so an older backend, and an older on-disk cache, still parses; absent sends what
|
|
10635
|
+
// the machine sent before the field existed.
|
|
10636
|
+
capture: CaptureSettings.optional(),
|
|
10596
10637
|
customKeywords: array(string2()),
|
|
10597
10638
|
fetchedAt: iso_exports.datetime()
|
|
10598
10639
|
}).meta({ id: "PolicyBundle" });
|
|
@@ -10601,7 +10642,8 @@ var POLICY_BUNDLE_SHAPE_ID = [
|
|
|
10601
10642
|
...Object.keys(Policy.shape).map((key) => `policies.${key}`),
|
|
10602
10643
|
...PolicyTarget.options.flatMap((member) => "shape" in member ? Object.keys(member.shape) : []).map((key) => `policies.target.${key}`),
|
|
10603
10644
|
...Object.keys(ExceptionBundleEntry.shape).map((key) => `exceptions.${key}`),
|
|
10604
|
-
...Object.keys(ModelPolicy.shape).map((key) => `modelPolicy.${key}`)
|
|
10645
|
+
...Object.keys(ModelPolicy.shape).map((key) => `modelPolicy.${key}`),
|
|
10646
|
+
...Object.keys(CaptureSettings.shape).map((key) => `capture.${key}`)
|
|
10605
10647
|
].sort().join(",");
|
|
10606
10648
|
var OBSERVE_ONLY_CATEGORIES = ["config"];
|
|
10607
10649
|
var ENFORCEABLE_CATEGORIES = DetectionCategory.options.filter((c) => !OBSERVE_ONLY_CATEGORIES.includes(c));
|
|
@@ -13690,6 +13732,7 @@ var HARNESS_LABELS = {
|
|
|
13690
13732
|
[HARNESS.Copilot]: "GitHub Copilot"
|
|
13691
13733
|
};
|
|
13692
13734
|
var HARNESS_LIVENESS_WINDOW_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
13735
|
+
var ATTENTION_TRUST_SQL = ATTENTION_TRUST_LEVELS.map((t) => `'${t}'`).join(", ");
|
|
13693
13736
|
var PROJECT_FINDINGS_WINDOW_MS = PROJECT_FINDINGS_WINDOW_DAYS * 24 * 60 * 60 * 1e3;
|
|
13694
13737
|
var MCP_TOOLS_USED_WINDOW_MS = MCP_TOOLS_USED_WINDOW_DAYS * 24 * 60 * 60 * 1e3;
|
|
13695
13738
|
var CATEGORY_OF_DEFINITION = `CASE WHEN d.category IN (${DetectionCategory.options.map((c) => `'${c}'`).join(", ")}) THEN d.category ELSE 'custom' END`;
|
|
@@ -14140,8 +14183,8 @@ function parseReconcileTrigger(input) {
|
|
|
14140
14183
|
}
|
|
14141
14184
|
|
|
14142
14185
|
// src/hooks/store-health.ts
|
|
14143
|
-
import { mkdirSync as mkdirSync4, readFileSync as
|
|
14144
|
-
import { dirname as
|
|
14186
|
+
import { mkdirSync as mkdirSync4, readFileSync as readFileSync24, writeFileSync as writeFileSync7 } from "fs";
|
|
14187
|
+
import { dirname as dirname10, join as join39 } from "path";
|
|
14145
14188
|
|
|
14146
14189
|
// ../../packages/plugin-runtime/src/attached/factory.ts
|
|
14147
14190
|
import { hostname as hostname3 } from "os";
|
|
@@ -14166,8 +14209,8 @@ import { dirname as dirname6 } from "path";
|
|
|
14166
14209
|
|
|
14167
14210
|
// ../../packages/plugin-runtime/src/attached/config-inventory-sync.ts
|
|
14168
14211
|
import { createHash as createHash11 } from "crypto";
|
|
14169
|
-
import { readFileSync as
|
|
14170
|
-
import { join as
|
|
14212
|
+
import { readFileSync as readFileSync18 } from "fs";
|
|
14213
|
+
import { join as join31 } from "path";
|
|
14171
14214
|
|
|
14172
14215
|
// ../../packages/plugin-runtime/src/attached/history-sync.ts
|
|
14173
14216
|
import { createHash as createHash10 } from "crypto";
|
|
@@ -14181,9 +14224,9 @@ var REDACT_DEGRADED_TO = EventMetadata.shape.redactDegradedTo.unwrap();
|
|
|
14181
14224
|
var SCAN_INCOMPLETE = EventMetadata.shape.scanIncomplete.unwrap();
|
|
14182
14225
|
|
|
14183
14226
|
// ../../packages/plugin-runtime/src/attached/policy-store.ts
|
|
14184
|
-
import { randomUUID as
|
|
14185
|
-
import { readFile as readFile2, rm, writeFile as
|
|
14186
|
-
import { join as
|
|
14227
|
+
import { randomUUID as randomUUID16 } from "crypto";
|
|
14228
|
+
import { readFile as readFile2, rm as rm2, writeFile as writeFile3 } from "fs/promises";
|
|
14229
|
+
import { join as join30 } from "path";
|
|
14187
14230
|
|
|
14188
14231
|
// ../../packages/plugin-runtime/src/attached/atomic-publish.ts
|
|
14189
14232
|
import { rename as rename2 } from "fs/promises";
|
|
@@ -14191,6 +14234,16 @@ var IMMEDIATE_RETRIES = 8;
|
|
|
14191
14234
|
var TIMED_RETRIES = 4;
|
|
14192
14235
|
var ATTEMPTS = 1 + IMMEDIATE_RETRIES + TIMED_RETRIES;
|
|
14193
14236
|
|
|
14237
|
+
// ../../packages/plugin-runtime/src/attached/capture-settings.ts
|
|
14238
|
+
import { randomUUID as randomUUID15 } from "crypto";
|
|
14239
|
+
import { readFileSync as readFileSync17 } from "fs";
|
|
14240
|
+
import { rm, writeFile as writeFile2 } from "fs/promises";
|
|
14241
|
+
import { join as join29 } from "path";
|
|
14242
|
+
var HookCaptureSettingsSchema = CaptureSettings.pick({
|
|
14243
|
+
toolOutput: true,
|
|
14244
|
+
sessionHold: true
|
|
14245
|
+
});
|
|
14246
|
+
|
|
14194
14247
|
// ../../packages/plugin-runtime/src/attached/history-sync.ts
|
|
14195
14248
|
var CAPTURE_BATCH_BYTES = 1024 * 1024;
|
|
14196
14249
|
|
|
@@ -14200,22 +14253,22 @@ var CONFIG_INVENTORY_STAGED_MAX_AGE_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
|
14200
14253
|
var CONFIG_INVENTORY_STAGED_MAX_BYTES = 8 * 1024 * 1024;
|
|
14201
14254
|
|
|
14202
14255
|
// ../../packages/plugin-runtime/src/attached/forward-drops.ts
|
|
14203
|
-
import { readFileSync as
|
|
14204
|
-
import { join as
|
|
14256
|
+
import { readFileSync as readFileSync19 } from "fs";
|
|
14257
|
+
import { join as join32 } from "path";
|
|
14205
14258
|
|
|
14206
14259
|
// ../../packages/plugin-runtime/src/attached/plugin-block.ts
|
|
14207
|
-
import { readFileSync as
|
|
14260
|
+
import { readFileSync as readFileSync20 } from "fs";
|
|
14208
14261
|
|
|
14209
14262
|
// ../../packages/plugin-runtime/src/attached/install-record.ts
|
|
14210
14263
|
import { readFile as readFile3, stat } from "fs/promises";
|
|
14211
|
-
import { basename as basename2, dirname as dirname7, join as
|
|
14264
|
+
import { basename as basename2, dirname as dirname7, join as join33, resolve as resolve3 } from "path";
|
|
14212
14265
|
|
|
14213
14266
|
// ../../packages/plugin-runtime/src/attached/plugin-block.ts
|
|
14214
14267
|
var INSTALL_RECORD_READ_TIMEOUT_MS = REQUEST_TIMEOUT_MS / 2;
|
|
14215
14268
|
|
|
14216
14269
|
// ../../packages/plugin-runtime/src/attached/posture-report-state.ts
|
|
14217
|
-
import { readFileSync as
|
|
14218
|
-
import { join as
|
|
14270
|
+
import { readFileSync as readFileSync21 } from "fs";
|
|
14271
|
+
import { join as join34 } from "path";
|
|
14219
14272
|
var OUTCOME_KEYS = {
|
|
14220
14273
|
ok: true,
|
|
14221
14274
|
unauthorized: true,
|
|
@@ -14236,18 +14289,18 @@ import { statSync as statSync8 } from "fs";
|
|
|
14236
14289
|
import { DatabaseSync as DatabaseSync3 } from "node:sqlite";
|
|
14237
14290
|
|
|
14238
14291
|
// ../../packages/plugin-runtime/src/attached/posture-store.ts
|
|
14239
|
-
import { randomUUID as
|
|
14240
|
-
import { readFile as readFile4, rm as
|
|
14241
|
-
import { join as join34 } from "path";
|
|
14242
|
-
|
|
14243
|
-
// ../../packages/plugin-runtime/src/attached/label-drops.ts
|
|
14244
|
-
import { readFileSync as readFileSync21 } from "fs";
|
|
14292
|
+
import { randomUUID as randomUUID17 } from "crypto";
|
|
14293
|
+
import { readFile as readFile4, rm as rm3, writeFile as writeFile4 } from "fs/promises";
|
|
14245
14294
|
import { join as join35 } from "path";
|
|
14246
14295
|
|
|
14247
|
-
// ../../packages/plugin-runtime/src/attached/
|
|
14296
|
+
// ../../packages/plugin-runtime/src/attached/label-drops.ts
|
|
14248
14297
|
import { readFileSync as readFileSync22 } from "fs";
|
|
14249
14298
|
import { join as join36 } from "path";
|
|
14250
14299
|
|
|
14300
|
+
// ../../packages/plugin-runtime/src/attached/sync-state.ts
|
|
14301
|
+
import { readFileSync as readFileSync23 } from "fs";
|
|
14302
|
+
import { join as join37 } from "path";
|
|
14303
|
+
|
|
14251
14304
|
// ../../packages/plugin-runtime/src/attached/status.ts
|
|
14252
14305
|
var REFUSAL_LINES = {
|
|
14253
14306
|
unauthorized: "KEY REJECTED \u2014 re-attach with a valid plugin key",
|
|
@@ -14277,10 +14330,13 @@ var WORK_LINES = {
|
|
|
14277
14330
|
// ../../packages/plugin-runtime/src/attached/history-sync-trigger.ts
|
|
14278
14331
|
import { spawn as spawn3 } from "child_process";
|
|
14279
14332
|
import { existsSync as existsSync9, statSync as statSync9 } from "fs";
|
|
14280
|
-
import { join as
|
|
14333
|
+
import { join as join38 } from "path";
|
|
14281
14334
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
14282
14335
|
var HISTORY_SYNC_THROTTLE_MS = 5 * 60 * 1e3;
|
|
14283
14336
|
|
|
14337
|
+
// ../../packages/plugin-runtime/src/attached/session-hold.ts
|
|
14338
|
+
import { dirname as dirname8 } from "path";
|
|
14339
|
+
|
|
14284
14340
|
// ../../packages/plugin-runtime/src/attached/sighting-key-sync.ts
|
|
14285
14341
|
var SIGHTING_KEY_MAX_AGE_MS = 24 * 60 * 60 * 1e3;
|
|
14286
14342
|
|
|
@@ -14298,10 +14354,10 @@ import { fileURLToPath as fileURLToPath5 } from "url";
|
|
|
14298
14354
|
var CONTENT_RETENTION_THROTTLE_MS = 60 * 60 * 1e3;
|
|
14299
14355
|
|
|
14300
14356
|
// ../../packages/plugin-runtime/src/handle-session-start.ts
|
|
14301
|
-
import { randomUUID as
|
|
14357
|
+
import { randomUUID as randomUUID18 } from "crypto";
|
|
14302
14358
|
|
|
14303
14359
|
// ../../packages/plugin-runtime/src/attached/forwarding-line.ts
|
|
14304
|
-
import { dirname as
|
|
14360
|
+
import { dirname as dirname9 } from "path";
|
|
14305
14361
|
|
|
14306
14362
|
// ../../packages/plugin-runtime/src/handle-session-start.ts
|
|
14307
14363
|
var EXCEPTION_RETENTION_MS = 90 * 24 * 60 * 60 * 1e3;
|
|
@@ -14317,7 +14373,7 @@ function hasControlChar(text) {
|
|
|
14317
14373
|
return false;
|
|
14318
14374
|
}
|
|
14319
14375
|
function markerDirs(dataDir2) {
|
|
14320
|
-
return [dataDir2,
|
|
14376
|
+
return [dataDir2, dirname10(dataDir2)];
|
|
14321
14377
|
}
|
|
14322
14378
|
function alreadyClaimed(dirs, marker, sessionId) {
|
|
14323
14379
|
if (hasControlChar(sessionId)) return false;
|
|
@@ -14325,7 +14381,7 @@ function alreadyClaimed(dirs, marker, sessionId) {
|
|
|
14325
14381
|
}
|
|
14326
14382
|
function readRecent(dir, marker) {
|
|
14327
14383
|
try {
|
|
14328
|
-
return
|
|
14384
|
+
return readFileSync24(join39(dir, marker), "utf8").split("\n").filter(Boolean);
|
|
14329
14385
|
} catch {
|
|
14330
14386
|
return [];
|
|
14331
14387
|
}
|
|
@@ -14336,7 +14392,7 @@ function recordClaim(dirs, marker, sessionId) {
|
|
|
14336
14392
|
try {
|
|
14337
14393
|
mkdirSync4(dir, { recursive: true, mode: DATA_DIR_MODE });
|
|
14338
14394
|
const recent = [...readRecent(dir, marker), sessionId].slice(-RECENT_SESSIONS);
|
|
14339
|
-
writeFileSync7(
|
|
14395
|
+
writeFileSync7(join39(dir, marker), recent.join("\n"), { mode: DATA_FILE_MODE });
|
|
14340
14396
|
return;
|
|
14341
14397
|
} catch {
|
|
14342
14398
|
}
|
|
@@ -14361,7 +14417,7 @@ function formatMode(mode) {
|
|
|
14361
14417
|
}
|
|
14362
14418
|
function warnIfStoreRedirected(config2, sessionId, write = (message) => void process.stderr.write(message)) {
|
|
14363
14419
|
try {
|
|
14364
|
-
const paths = symlinkedStorePaths(
|
|
14420
|
+
const paths = symlinkedStorePaths(dirname10(config2.dataDir));
|
|
14365
14421
|
if (paths.length === 0) return;
|
|
14366
14422
|
if (!sessionId) {
|
|
14367
14423
|
write(storeRedirectedMessage(paths));
|