@akasecurity/ai-tc-codex 0.9.23 → 0.9.24
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/.codex-plugin/plugin.json +1 -1
- package/package.json +1 -1
- package/scripts/apply-suppressions.js +60 -19
- package/scripts/backfill.js +83 -24
- package/scripts/content-retention.js +60 -19
- package/scripts/filescan.js +94 -36
- package/scripts/firstrun.js +74 -32
- package/scripts/history-sync.js +60 -19
- package/scripts/intro.js +32 -6
- package/scripts/onboard.js +60 -19
- package/scripts/post-tool-use.js +97 -38
- package/scripts/pre-tool-use.js +97 -38
- package/scripts/query.js +73 -31
- package/scripts/reconcile.js +95 -36
- package/scripts/remediate.js +80 -21
- package/scripts/scan-worker.js +32 -6
- package/scripts/session-start.js +134 -72
- package/scripts/start-light.js +32 -6
- package/scripts/stop.js +78 -36
- package/scripts/sync.js +96 -38
- package/scripts/user-prompt-submit.js +103 -44
package/scripts/start-light.js
CHANGED
|
@@ -8326,7 +8326,11 @@ var ListFindingTypesQuery = object({
|
|
|
8326
8326
|
// and so is not bounded by what any page happens to hold.
|
|
8327
8327
|
includeId: string2().optional(),
|
|
8328
8328
|
limit: coerce_exports.number().int().min(1).max(MAX_FINDING_TYPES_LIMIT).optional(),
|
|
8329
|
-
cursor: string2().optional()
|
|
8329
|
+
cursor: string2().optional(),
|
|
8330
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
8331
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
8332
|
+
// from wherever it lands.
|
|
8333
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
8330
8334
|
});
|
|
8331
8335
|
var ListFindingTypesResponse = object({
|
|
8332
8336
|
totals: object({
|
|
@@ -8406,7 +8410,11 @@ var ListFindingInstancesQuery = object({
|
|
|
8406
8410
|
sessionId: string2().optional(),
|
|
8407
8411
|
from: iso_exports.datetime().optional(),
|
|
8408
8412
|
limit: coerce_exports.number().int().min(1).max(MAX_FLAT_FINDINGS_LIMIT).optional(),
|
|
8409
|
-
cursor: string2().optional()
|
|
8413
|
+
cursor: string2().optional(),
|
|
8414
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
8415
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
8416
|
+
// from wherever it lands.
|
|
8417
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
8410
8418
|
});
|
|
8411
8419
|
var ListFindingInstancesResponse = object({
|
|
8412
8420
|
// Instances matching the filters across the whole scope, not just this
|
|
@@ -8477,7 +8485,11 @@ var ListFindingLocationsQuery = object({
|
|
|
8477
8485
|
// rather than a deep-link corner. Never affects totals, facets or the cursor.
|
|
8478
8486
|
includeId: string2().optional(),
|
|
8479
8487
|
limit: coerce_exports.number().int().min(1).max(MAX_FINDING_LOCATIONS_LIMIT).optional(),
|
|
8480
|
-
cursor: string2().optional()
|
|
8488
|
+
cursor: string2().optional(),
|
|
8489
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
8490
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
8491
|
+
// from wherever it lands.
|
|
8492
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
8481
8493
|
});
|
|
8482
8494
|
var ListFindingLocationsResponse = object({
|
|
8483
8495
|
totals: object({
|
|
@@ -10879,7 +10891,11 @@ var MAX_VAULT_PAGE_LIMIT = 200;
|
|
|
10879
10891
|
var ListVaultInventoryQuery = object({
|
|
10880
10892
|
limit: coerce_exports.number().int().min(1).max(MAX_VAULT_PAGE_LIMIT).optional(),
|
|
10881
10893
|
// Opaque; names the last row of the page just served.
|
|
10882
|
-
cursor: string2().optional()
|
|
10894
|
+
cursor: string2().optional(),
|
|
10895
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
10896
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
10897
|
+
// from wherever it lands.
|
|
10898
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
10883
10899
|
});
|
|
10884
10900
|
var ListVaultInventoryResponse = object({
|
|
10885
10901
|
// Vaulted values across the whole store, not just this page — cursor-
|
|
@@ -10891,7 +10907,11 @@ var ListVaultInventoryResponse = object({
|
|
|
10891
10907
|
});
|
|
10892
10908
|
var ListVaultReuseQuery = object({
|
|
10893
10909
|
limit: coerce_exports.number().int().min(1).max(MAX_VAULT_PAGE_LIMIT).optional(),
|
|
10894
|
-
cursor: string2().optional()
|
|
10910
|
+
cursor: string2().optional(),
|
|
10911
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
10912
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
10913
|
+
// from wherever it lands.
|
|
10914
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
10895
10915
|
});
|
|
10896
10916
|
var ListVaultReuseResponse = object({
|
|
10897
10917
|
// Reused values across the whole store — the number the section's claim
|
|
@@ -10907,9 +10927,15 @@ var ListVaultDerefsQuery = object({
|
|
|
10907
10927
|
// over a Server Action, which preserves the type, never as a URL param.
|
|
10908
10928
|
includeBatched: boolean2().optional(),
|
|
10909
10929
|
limit: coerce_exports.number().int().min(1).max(MAX_VAULT_PAGE_LIMIT).optional(),
|
|
10910
|
-
cursor: string2().optional()
|
|
10930
|
+
cursor: string2().optional(),
|
|
10931
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
10932
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
10933
|
+
// from wherever it lands.
|
|
10934
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
10911
10935
|
});
|
|
10912
10936
|
var ListVaultDerefsResponse = object({
|
|
10937
|
+
// Rows this filter selects across the whole trail, not just this page.
|
|
10938
|
+
totals: object({ derefs: number2().int().nonnegative() }),
|
|
10913
10939
|
items: array(VaultDeref),
|
|
10914
10940
|
nextCursor: string2().nullable(),
|
|
10915
10941
|
// Display/view-render rows the query hid, over the WHOLE trail rather than
|
package/scripts/stop.js
CHANGED
|
@@ -8777,7 +8777,11 @@ var ListFindingTypesQuery = object({
|
|
|
8777
8777
|
// and so is not bounded by what any page happens to hold.
|
|
8778
8778
|
includeId: string2().optional(),
|
|
8779
8779
|
limit: coerce_exports.number().int().min(1).max(MAX_FINDING_TYPES_LIMIT).optional(),
|
|
8780
|
-
cursor: string2().optional()
|
|
8780
|
+
cursor: string2().optional(),
|
|
8781
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
8782
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
8783
|
+
// from wherever it lands.
|
|
8784
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
8781
8785
|
});
|
|
8782
8786
|
var ListFindingTypesResponse = object({
|
|
8783
8787
|
totals: object({
|
|
@@ -8858,7 +8862,11 @@ var ListFindingInstancesQuery = object({
|
|
|
8858
8862
|
sessionId: string2().optional(),
|
|
8859
8863
|
from: iso_exports.datetime().optional(),
|
|
8860
8864
|
limit: coerce_exports.number().int().min(1).max(MAX_FLAT_FINDINGS_LIMIT).optional(),
|
|
8861
|
-
cursor: string2().optional()
|
|
8865
|
+
cursor: string2().optional(),
|
|
8866
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
8867
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
8868
|
+
// from wherever it lands.
|
|
8869
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
8862
8870
|
});
|
|
8863
8871
|
var ListFindingInstancesResponse = object({
|
|
8864
8872
|
// Instances matching the filters across the whole scope, not just this
|
|
@@ -8930,7 +8938,11 @@ var ListFindingLocationsQuery = object({
|
|
|
8930
8938
|
// rather than a deep-link corner. Never affects totals, facets or the cursor.
|
|
8931
8939
|
includeId: string2().optional(),
|
|
8932
8940
|
limit: coerce_exports.number().int().min(1).max(MAX_FINDING_LOCATIONS_LIMIT).optional(),
|
|
8933
|
-
cursor: string2().optional()
|
|
8941
|
+
cursor: string2().optional(),
|
|
8942
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
8943
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
8944
|
+
// from wherever it lands.
|
|
8945
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
8934
8946
|
});
|
|
8935
8947
|
var ListFindingLocationsResponse = object({
|
|
8936
8948
|
totals: object({
|
|
@@ -11562,7 +11574,11 @@ var MAX_VAULT_PAGE_LIMIT = 200;
|
|
|
11562
11574
|
var ListVaultInventoryQuery = object({
|
|
11563
11575
|
limit: coerce_exports.number().int().min(1).max(MAX_VAULT_PAGE_LIMIT).optional(),
|
|
11564
11576
|
// Opaque; names the last row of the page just served.
|
|
11565
|
-
cursor: string2().optional()
|
|
11577
|
+
cursor: string2().optional(),
|
|
11578
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
11579
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
11580
|
+
// from wherever it lands.
|
|
11581
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
11566
11582
|
});
|
|
11567
11583
|
var ListVaultInventoryResponse = object({
|
|
11568
11584
|
// Vaulted values across the whole store, not just this page — cursor-
|
|
@@ -11574,7 +11590,11 @@ var ListVaultInventoryResponse = object({
|
|
|
11574
11590
|
});
|
|
11575
11591
|
var ListVaultReuseQuery = object({
|
|
11576
11592
|
limit: coerce_exports.number().int().min(1).max(MAX_VAULT_PAGE_LIMIT).optional(),
|
|
11577
|
-
cursor: string2().optional()
|
|
11593
|
+
cursor: string2().optional(),
|
|
11594
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
11595
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
11596
|
+
// from wherever it lands.
|
|
11597
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
11578
11598
|
});
|
|
11579
11599
|
var ListVaultReuseResponse = object({
|
|
11580
11600
|
// Reused values across the whole store — the number the section's claim
|
|
@@ -11590,9 +11610,15 @@ var ListVaultDerefsQuery = object({
|
|
|
11590
11610
|
// over a Server Action, which preserves the type, never as a URL param.
|
|
11591
11611
|
includeBatched: boolean2().optional(),
|
|
11592
11612
|
limit: coerce_exports.number().int().min(1).max(MAX_VAULT_PAGE_LIMIT).optional(),
|
|
11593
|
-
cursor: string2().optional()
|
|
11613
|
+
cursor: string2().optional(),
|
|
11614
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
11615
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
11616
|
+
// from wherever it lands.
|
|
11617
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
11594
11618
|
});
|
|
11595
11619
|
var ListVaultDerefsResponse = object({
|
|
11620
|
+
// Rows this filter selects across the whole trail, not just this page.
|
|
11621
|
+
totals: object({ derefs: number2().int().nonnegative() }),
|
|
11596
11622
|
items: array(VaultDeref),
|
|
11597
11623
|
nextCursor: string2().nullable(),
|
|
11598
11624
|
// Display/view-render rows the query hid, over the WHOLE trail rather than
|
|
@@ -24838,7 +24864,7 @@ var SqliteFindingsRepository = class {
|
|
|
24838
24864
|
};
|
|
24839
24865
|
const limit = query.limit ?? DEFAULT_FINDING_TYPES_LIMIT;
|
|
24840
24866
|
const cursor = query.cursor === void 0 ? null : decodeGroupCursor(query.cursor);
|
|
24841
|
-
const start = cursor === null ? 0 : firstAfter(sorted, cursor);
|
|
24867
|
+
const start = query.offset ?? (cursor === null ? 0 : firstAfter(sorted, cursor));
|
|
24842
24868
|
const page = sorted.slice(start, start + limit);
|
|
24843
24869
|
const lastOnPage = page.at(-1);
|
|
24844
24870
|
const nextCursor = start + limit < sorted.length && lastOnPage ? encodeGroupCursor(lastOnPage) : null;
|
|
@@ -24932,7 +24958,7 @@ var SqliteFindingsRepository = class {
|
|
|
24932
24958
|
accumulator.add(row);
|
|
24933
24959
|
if (!matchesInstanceFilters(row, opts)) continue;
|
|
24934
24960
|
total += 1;
|
|
24935
|
-
if (!isPastCursor(row)) continue;
|
|
24961
|
+
if (query.offset === void 0 ? !isPastCursor(row) : total <= query.offset) continue;
|
|
24936
24962
|
if (items.length < limit) {
|
|
24937
24963
|
items.push(toInstanceDetail(row));
|
|
24938
24964
|
last = row;
|
|
@@ -25021,7 +25047,7 @@ var SqliteFindingsRepository = class {
|
|
|
25021
25047
|
}
|
|
25022
25048
|
}
|
|
25023
25049
|
sorted.sort(compareLocationOrder);
|
|
25024
|
-
const start = cursor === null ? 0 : firstLocationAfter(sorted, cursor);
|
|
25050
|
+
const start = query.offset ?? (cursor === null ? 0 : firstLocationAfter(sorted, cursor));
|
|
25025
25051
|
const page = sorted.slice(start, start + limit);
|
|
25026
25052
|
const lastOnPage = page.at(-1);
|
|
25027
25053
|
const nextCursor = start + limit < sorted.length && lastOnPage ? encodeLocationCursor(lastOnPage) : null;
|
|
@@ -27649,6 +27675,9 @@ function pageLimit(requested, fallback) {
|
|
|
27649
27675
|
if (requested === void 0) return fallback;
|
|
27650
27676
|
return Math.min(Math.max(1, Math.trunc(requested)), MAX_VAULT_PAGE_LIMIT);
|
|
27651
27677
|
}
|
|
27678
|
+
function pageOffset(requested) {
|
|
27679
|
+
return requested === void 0 ? 0 : Math.max(0, Math.trunc(requested));
|
|
27680
|
+
}
|
|
27652
27681
|
function encodeReuseCursor(payload) {
|
|
27653
27682
|
return Buffer.from(JSON.stringify(payload)).toString("base64url");
|
|
27654
27683
|
}
|
|
@@ -27996,7 +28025,8 @@ var SqliteSecretVaultRepository = class {
|
|
|
27996
28025
|
*/
|
|
27997
28026
|
listInventory(query = {}, now = Date.now()) {
|
|
27998
28027
|
const limit = pageLimit(query.limit, DEFAULT_VAULT_INVENTORY_LIMIT);
|
|
27999
|
-
const
|
|
28028
|
+
const offset = pageOffset(query.offset);
|
|
28029
|
+
const cursor = query.cursor === void 0 || query.offset !== void 0 ? null : decodeKeysetCursor(query.cursor);
|
|
28000
28030
|
const where = cursor === null ? "" : "WHERE (v.last_seen < :cursorLastSeen OR (v.last_seen = :cursorLastSeen AND v.pointer_id < :cursorPointerId))";
|
|
28001
28031
|
const rows = allRows(
|
|
28002
28032
|
this.db.prepare(
|
|
@@ -28010,11 +28040,12 @@ var SqliteSecretVaultRepository = class {
|
|
|
28010
28040
|
FROM secret_vault v
|
|
28011
28041
|
${where}
|
|
28012
28042
|
ORDER BY v.last_seen DESC, v.pointer_id DESC
|
|
28013
|
-
LIMIT :limit`
|
|
28043
|
+
LIMIT :limit OFFSET :offset`
|
|
28014
28044
|
),
|
|
28015
28045
|
bindParams({
|
|
28016
28046
|
now,
|
|
28017
28047
|
limit: limit + 1,
|
|
28048
|
+
offset,
|
|
28018
28049
|
...cursor === null ? {} : { cursorLastSeen: cursor.startedAtMs, cursorPointerId: cursor.id }
|
|
28019
28050
|
})
|
|
28020
28051
|
);
|
|
@@ -28038,7 +28069,8 @@ var SqliteSecretVaultRepository = class {
|
|
|
28038
28069
|
*/
|
|
28039
28070
|
listReuse(query = {}, now = Date.now()) {
|
|
28040
28071
|
const limit = pageLimit(query.limit, DEFAULT_VAULT_INVENTORY_LIMIT);
|
|
28041
|
-
const
|
|
28072
|
+
const offset = pageOffset(query.offset);
|
|
28073
|
+
const cursor = query.cursor === void 0 || query.offset !== void 0 ? null : decodeReuseCursor(query.cursor);
|
|
28042
28074
|
const after = cursor === null ? "" : `AND (v.occurrence_count < :cursorOccurrences
|
|
28043
28075
|
OR (v.occurrence_count = :cursorOccurrences AND v.pointer_id < :cursorPointerId))`;
|
|
28044
28076
|
const rows = allRows(
|
|
@@ -28053,11 +28085,12 @@ var SqliteSecretVaultRepository = class {
|
|
|
28053
28085
|
FROM secret_vault v
|
|
28054
28086
|
WHERE ${REUSED_PREDICATE} ${after}
|
|
28055
28087
|
ORDER BY v.occurrence_count DESC, v.pointer_id DESC
|
|
28056
|
-
LIMIT :limit`
|
|
28088
|
+
LIMIT :limit OFFSET :offset`
|
|
28057
28089
|
),
|
|
28058
28090
|
bindParams({
|
|
28059
28091
|
now,
|
|
28060
28092
|
limit: limit + 1,
|
|
28093
|
+
offset,
|
|
28061
28094
|
...cursor === null ? {} : { cursorOccurrences: cursor.occurrences, cursorPointerId: cursor.pointerId }
|
|
28062
28095
|
})
|
|
28063
28096
|
);
|
|
@@ -28082,7 +28115,8 @@ var SqliteSecretVaultRepository = class {
|
|
|
28082
28115
|
*/
|
|
28083
28116
|
listDerefs(query = {}) {
|
|
28084
28117
|
const limit = pageLimit(query.limit, DEFAULT_VAULT_DEREFS_LIMIT);
|
|
28085
|
-
const
|
|
28118
|
+
const offset = pageOffset(query.offset);
|
|
28119
|
+
const cursor = query.cursor === void 0 || query.offset !== void 0 ? null : decodeKeysetCursor(query.cursor);
|
|
28086
28120
|
const conditions = [];
|
|
28087
28121
|
if (query.includeBatched !== true) {
|
|
28088
28122
|
conditions.push(`reason NOT IN ('display', 'view-render')`);
|
|
@@ -28095,21 +28129,28 @@ var SqliteSecretVaultRepository = class {
|
|
|
28095
28129
|
this.db.prepare(
|
|
28096
28130
|
`SELECT id, pointer_id, at, target, reason, outcome, grant_id, pointer_count
|
|
28097
28131
|
FROM secret_vault_deref ${where}
|
|
28098
|
-
ORDER BY at DESC, id DESC LIMIT :limit`
|
|
28132
|
+
ORDER BY at DESC, id DESC LIMIT :limit OFFSET :offset`
|
|
28099
28133
|
),
|
|
28100
28134
|
bindParams({
|
|
28101
28135
|
limit: limit + 1,
|
|
28136
|
+
offset,
|
|
28102
28137
|
...cursor === null ? {} : { cursorAt: cursor.startedAtMs, cursorId: cursor.id }
|
|
28103
28138
|
})
|
|
28104
28139
|
);
|
|
28105
28140
|
const hasMore = rows.length > limit;
|
|
28106
28141
|
const page = hasMore ? rows.slice(0, limit) : rows;
|
|
28107
28142
|
const last = page[page.length - 1];
|
|
28108
|
-
const
|
|
28109
|
-
this.db
|
|
28110
|
-
|
|
28111
|
-
|
|
28143
|
+
const counts = getRow(
|
|
28144
|
+
this.db.prepare(
|
|
28145
|
+
`SELECT count(*) AS total,
|
|
28146
|
+
count(*) FILTER (WHERE reason IN ('display', 'view-render')) AS hidden
|
|
28147
|
+
FROM secret_vault_deref`
|
|
28148
|
+
)
|
|
28149
|
+
) ?? { total: 0, hidden: 0 };
|
|
28150
|
+
const includeBatched = query.includeBatched === true;
|
|
28151
|
+
const hiddenBatched = includeBatched ? 0 : counts.hidden;
|
|
28112
28152
|
return {
|
|
28153
|
+
totals: { derefs: includeBatched ? counts.total : counts.total - counts.hidden },
|
|
28113
28154
|
items: page.map((r) => ({
|
|
28114
28155
|
id: r.id,
|
|
28115
28156
|
pointerId: r.pointer_id,
|
|
@@ -30174,7 +30215,7 @@ function shippedRegexMatchers() {
|
|
|
30174
30215
|
}
|
|
30175
30216
|
|
|
30176
30217
|
// ../../packages/plugin-sdk/src/repo.ts
|
|
30177
|
-
import { existsSync as existsSync9,
|
|
30218
|
+
import { existsSync as existsSync9, statSync as statSync7 } from "fs";
|
|
30178
30219
|
import { basename as basename2, dirname as dirname5, isAbsolute as isAbsolute3, join as join24, sep as sep4 } from "path";
|
|
30179
30220
|
function remoteWithoutCredentials(remote) {
|
|
30180
30221
|
const withoutInfo = withoutUserinfo(remote);
|
|
@@ -30208,6 +30249,7 @@ function unparsedWithoutCredentials(remote) {
|
|
|
30208
30249
|
return `${scheme}${tail.split(/[?#]/, 1)[0] ?? ""}`;
|
|
30209
30250
|
}
|
|
30210
30251
|
var NO_ATTRIBUTION = Object.freeze({});
|
|
30252
|
+
var MAX_GIT_METADATA_BYTES = 1024 * 1024;
|
|
30211
30253
|
|
|
30212
30254
|
// ../../packages/plugin-sdk/src/events.ts
|
|
30213
30255
|
import { createHash as createHash9, randomUUID as randomUUID14 } from "crypto";
|
|
@@ -30655,7 +30697,7 @@ function createGuardedScanner(partition, gateway, opts) {
|
|
|
30655
30697
|
}
|
|
30656
30698
|
|
|
30657
30699
|
// ../../packages/plugin-sdk/src/hook-fail-opens.ts
|
|
30658
|
-
import { readFileSync as
|
|
30700
|
+
import { readFileSync as readFileSync16 } from "fs";
|
|
30659
30701
|
import { join as join25 } from "path";
|
|
30660
30702
|
var HOOK_FAIL_OPENS_FILENAME = "hook-fail-opens.json";
|
|
30661
30703
|
function hookFailOpensPath(dataDir2) {
|
|
@@ -30678,7 +30720,7 @@ function recordHookFailOpen(dataDir2, nowMs) {
|
|
|
30678
30720
|
}
|
|
30679
30721
|
function readHookFailOpens(dataDir2) {
|
|
30680
30722
|
try {
|
|
30681
|
-
const parsed2 = JSON.parse(
|
|
30723
|
+
const parsed2 = JSON.parse(readFileSync16(hookFailOpensPath(dataDir2), "utf8"));
|
|
30682
30724
|
if (typeof parsed2 !== "object" || parsed2 === null) return null;
|
|
30683
30725
|
const record2 = parsed2;
|
|
30684
30726
|
if (!isPositiveSafeInteger(record2.failOpens)) return null;
|
|
@@ -30698,7 +30740,7 @@ import {
|
|
|
30698
30740
|
fstatSync,
|
|
30699
30741
|
mkdirSync as mkdirSync2,
|
|
30700
30742
|
openSync as openSync2,
|
|
30701
|
-
readFileSync as
|
|
30743
|
+
readFileSync as readFileSync17,
|
|
30702
30744
|
readSync,
|
|
30703
30745
|
writeFileSync as writeFileSync5
|
|
30704
30746
|
} from "fs";
|
|
@@ -30724,7 +30766,7 @@ function readTail(path) {
|
|
|
30724
30766
|
const fd = openSync2(path, "r");
|
|
30725
30767
|
try {
|
|
30726
30768
|
const { size } = fstatSync(fd);
|
|
30727
|
-
if (size <= TAIL_BYTES) return { text:
|
|
30769
|
+
if (size <= TAIL_BYTES) return { text: readFileSync17(fd, "utf8"), truncated: false };
|
|
30728
30770
|
const buffer = Buffer.allocUnsafe(TAIL_BYTES);
|
|
30729
30771
|
let filled = 0;
|
|
30730
30772
|
while (filled < TAIL_BYTES) {
|
|
@@ -31022,7 +31064,7 @@ import {
|
|
|
31022
31064
|
fstatSync as fstatSync2,
|
|
31023
31065
|
mkdirSync as mkdirSync4,
|
|
31024
31066
|
openSync as openSync3,
|
|
31025
|
-
readFileSync as
|
|
31067
|
+
readFileSync as readFileSync18,
|
|
31026
31068
|
readSync as readSync2,
|
|
31027
31069
|
writeFileSync as writeFileSync7
|
|
31028
31070
|
} from "fs";
|
|
@@ -32124,7 +32166,7 @@ function sessionToolIsKeyed(tool) {
|
|
|
32124
32166
|
|
|
32125
32167
|
// ../../packages/plugin-runtime/src/attached/config-inventory-sync.ts
|
|
32126
32168
|
import { createHash as createHash12 } from "crypto";
|
|
32127
|
-
import { readFileSync as
|
|
32169
|
+
import { readFileSync as readFileSync20 } from "fs";
|
|
32128
32170
|
import { join as join33 } from "path";
|
|
32129
32171
|
|
|
32130
32172
|
// ../../packages/plugin-runtime/src/attached/config-inventory-wire.ts
|
|
@@ -32224,7 +32266,7 @@ async function publishByRename(tmp, file, move = rename2) {
|
|
|
32224
32266
|
|
|
32225
32267
|
// ../../packages/plugin-runtime/src/attached/capture-settings.ts
|
|
32226
32268
|
import { randomUUID as randomUUID17 } from "crypto";
|
|
32227
|
-
import { readFileSync as
|
|
32269
|
+
import { readFileSync as readFileSync19 } from "fs";
|
|
32228
32270
|
import { rm, writeFile as writeFile2 } from "fs/promises";
|
|
32229
32271
|
import { join as join31 } from "path";
|
|
32230
32272
|
var HookCaptureSettingsSchema = CaptureSettings.pick({
|
|
@@ -32612,7 +32654,7 @@ function reportKey(request) {
|
|
|
32612
32654
|
function readStagedEntries(dataDir2) {
|
|
32613
32655
|
let parsed2;
|
|
32614
32656
|
try {
|
|
32615
|
-
parsed2 = JSON.parse(
|
|
32657
|
+
parsed2 = JSON.parse(readFileSync20(stagedConfigInventoryPath(dataDir2), "utf8"));
|
|
32616
32658
|
} catch {
|
|
32617
32659
|
return [];
|
|
32618
32660
|
}
|
|
@@ -32636,7 +32678,7 @@ function isTimestamp(value) {
|
|
|
32636
32678
|
}
|
|
32637
32679
|
|
|
32638
32680
|
// ../../packages/plugin-runtime/src/attached/forward-drops.ts
|
|
32639
|
-
import { readFileSync as
|
|
32681
|
+
import { readFileSync as readFileSync21 } from "fs";
|
|
32640
32682
|
import { join as join34 } from "path";
|
|
32641
32683
|
var FORWARD_DROPS_FILENAME = ATTACHED_FORWARD_DROPS_FILENAME;
|
|
32642
32684
|
function forwardDropsPath(dataDir2) {
|
|
@@ -32658,7 +32700,7 @@ function recordForwardDrops(dataDir2, count, nowMs) {
|
|
|
32658
32700
|
}
|
|
32659
32701
|
function readForwardDrops(dataDir2) {
|
|
32660
32702
|
try {
|
|
32661
|
-
const parsed2 = JSON.parse(
|
|
32703
|
+
const parsed2 = JSON.parse(readFileSync21(forwardDropsPath(dataDir2), "utf8"));
|
|
32662
32704
|
if (typeof parsed2 !== "object" || parsed2 === null) return null;
|
|
32663
32705
|
const record2 = parsed2;
|
|
32664
32706
|
if (typeof record2.droppedForwards !== "number" || !Number.isFinite(record2.droppedForwards)) {
|
|
@@ -33762,7 +33804,7 @@ function toWireInspection(insp, nameKey) {
|
|
|
33762
33804
|
}
|
|
33763
33805
|
|
|
33764
33806
|
// ../../packages/plugin-runtime/src/attached/plugin-block.ts
|
|
33765
|
-
import { readFileSync as
|
|
33807
|
+
import { readFileSync as readFileSync22 } from "fs";
|
|
33766
33808
|
|
|
33767
33809
|
// ../../packages/plugin-runtime/src/attached/install-record.ts
|
|
33768
33810
|
import { readFile as readFile3, stat } from "fs/promises";
|
|
@@ -33835,7 +33877,7 @@ async function readInstalledVersionBounded(installRoot) {
|
|
|
33835
33877
|
}
|
|
33836
33878
|
|
|
33837
33879
|
// ../../packages/plugin-runtime/src/attached/posture-report-state.ts
|
|
33838
|
-
import { readFileSync as
|
|
33880
|
+
import { readFileSync as readFileSync23 } from "fs";
|
|
33839
33881
|
import { join as join36 } from "path";
|
|
33840
33882
|
var POSTURE_REPORT_STATE_FILENAME = ATTACHED_POSTURE_REPORT_FILENAME;
|
|
33841
33883
|
var OUTCOME_KEYS = {
|
|
@@ -34783,11 +34825,11 @@ function codexHookAccount(input) {
|
|
|
34783
34825
|
}
|
|
34784
34826
|
|
|
34785
34827
|
// ../../packages/plugin-runtime/src/attached/label-drops.ts
|
|
34786
|
-
import { readFileSync as
|
|
34828
|
+
import { readFileSync as readFileSync24 } from "fs";
|
|
34787
34829
|
import { join as join41 } from "path";
|
|
34788
34830
|
|
|
34789
34831
|
// ../../packages/plugin-runtime/src/attached/sync-state.ts
|
|
34790
|
-
import { readFileSync as
|
|
34832
|
+
import { readFileSync as readFileSync25 } from "fs";
|
|
34791
34833
|
import { join as join42 } from "path";
|
|
34792
34834
|
|
|
34793
34835
|
// ../../packages/plugin-runtime/src/attached/status.ts
|
|
@@ -35114,7 +35156,7 @@ function parseStopPayload(input) {
|
|
|
35114
35156
|
}
|
|
35115
35157
|
|
|
35116
35158
|
// src/hooks/store-health.ts
|
|
35117
|
-
import { mkdirSync as mkdirSync6, readFileSync as
|
|
35159
|
+
import { mkdirSync as mkdirSync6, readFileSync as readFileSync26, writeFileSync as writeFileSync8 } from "fs";
|
|
35118
35160
|
import { dirname as dirname11, join as join44 } from "path";
|
|
35119
35161
|
var STORE_REDIRECT_MARKER = "store-redirect-last-session";
|
|
35120
35162
|
var RECENT_SESSIONS = 32;
|
|
@@ -35134,7 +35176,7 @@ function alreadyClaimed(dirs, marker, sessionId) {
|
|
|
35134
35176
|
}
|
|
35135
35177
|
function readRecent(dir, marker) {
|
|
35136
35178
|
try {
|
|
35137
|
-
return
|
|
35179
|
+
return readFileSync26(join44(dir, marker), "utf8").split("\n").filter(Boolean);
|
|
35138
35180
|
} catch {
|
|
35139
35181
|
return [];
|
|
35140
35182
|
}
|