@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/firstrun.js
CHANGED
|
@@ -8864,7 +8864,11 @@ var ListFindingTypesQuery = object({
|
|
|
8864
8864
|
// and so is not bounded by what any page happens to hold.
|
|
8865
8865
|
includeId: string2().optional(),
|
|
8866
8866
|
limit: coerce_exports.number().int().min(1).max(MAX_FINDING_TYPES_LIMIT).optional(),
|
|
8867
|
-
cursor: string2().optional()
|
|
8867
|
+
cursor: string2().optional(),
|
|
8868
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
8869
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
8870
|
+
// from wherever it lands.
|
|
8871
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
8868
8872
|
});
|
|
8869
8873
|
var ListFindingTypesResponse = object({
|
|
8870
8874
|
totals: object({
|
|
@@ -8945,7 +8949,11 @@ var ListFindingInstancesQuery = object({
|
|
|
8945
8949
|
sessionId: string2().optional(),
|
|
8946
8950
|
from: iso_exports.datetime().optional(),
|
|
8947
8951
|
limit: coerce_exports.number().int().min(1).max(MAX_FLAT_FINDINGS_LIMIT).optional(),
|
|
8948
|
-
cursor: string2().optional()
|
|
8952
|
+
cursor: string2().optional(),
|
|
8953
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
8954
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
8955
|
+
// from wherever it lands.
|
|
8956
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
8949
8957
|
});
|
|
8950
8958
|
var ListFindingInstancesResponse = object({
|
|
8951
8959
|
// Instances matching the filters across the whole scope, not just this
|
|
@@ -9017,7 +9025,11 @@ var ListFindingLocationsQuery = object({
|
|
|
9017
9025
|
// rather than a deep-link corner. Never affects totals, facets or the cursor.
|
|
9018
9026
|
includeId: string2().optional(),
|
|
9019
9027
|
limit: coerce_exports.number().int().min(1).max(MAX_FINDING_LOCATIONS_LIMIT).optional(),
|
|
9020
|
-
cursor: string2().optional()
|
|
9028
|
+
cursor: string2().optional(),
|
|
9029
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
9030
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
9031
|
+
// from wherever it lands.
|
|
9032
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
9021
9033
|
});
|
|
9022
9034
|
var ListFindingLocationsResponse = object({
|
|
9023
9035
|
totals: object({
|
|
@@ -11649,7 +11661,11 @@ var MAX_VAULT_PAGE_LIMIT = 200;
|
|
|
11649
11661
|
var ListVaultInventoryQuery = object({
|
|
11650
11662
|
limit: coerce_exports.number().int().min(1).max(MAX_VAULT_PAGE_LIMIT).optional(),
|
|
11651
11663
|
// Opaque; names the last row of the page just served.
|
|
11652
|
-
cursor: string2().optional()
|
|
11664
|
+
cursor: string2().optional(),
|
|
11665
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
11666
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
11667
|
+
// from wherever it lands.
|
|
11668
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
11653
11669
|
});
|
|
11654
11670
|
var ListVaultInventoryResponse = object({
|
|
11655
11671
|
// Vaulted values across the whole store, not just this page — cursor-
|
|
@@ -11661,7 +11677,11 @@ var ListVaultInventoryResponse = object({
|
|
|
11661
11677
|
});
|
|
11662
11678
|
var ListVaultReuseQuery = object({
|
|
11663
11679
|
limit: coerce_exports.number().int().min(1).max(MAX_VAULT_PAGE_LIMIT).optional(),
|
|
11664
|
-
cursor: string2().optional()
|
|
11680
|
+
cursor: string2().optional(),
|
|
11681
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
11682
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
11683
|
+
// from wherever it lands.
|
|
11684
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
11665
11685
|
});
|
|
11666
11686
|
var ListVaultReuseResponse = object({
|
|
11667
11687
|
// Reused values across the whole store — the number the section's claim
|
|
@@ -11677,9 +11697,15 @@ var ListVaultDerefsQuery = object({
|
|
|
11677
11697
|
// over a Server Action, which preserves the type, never as a URL param.
|
|
11678
11698
|
includeBatched: boolean2().optional(),
|
|
11679
11699
|
limit: coerce_exports.number().int().min(1).max(MAX_VAULT_PAGE_LIMIT).optional(),
|
|
11680
|
-
cursor: string2().optional()
|
|
11700
|
+
cursor: string2().optional(),
|
|
11701
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
11702
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
11703
|
+
// from wherever it lands.
|
|
11704
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
11681
11705
|
});
|
|
11682
11706
|
var ListVaultDerefsResponse = object({
|
|
11707
|
+
// Rows this filter selects across the whole trail, not just this page.
|
|
11708
|
+
totals: object({ derefs: number2().int().nonnegative() }),
|
|
11683
11709
|
items: array(VaultDeref),
|
|
11684
11710
|
nextCursor: string2().nullable(),
|
|
11685
11711
|
// Display/view-render rows the query hid, over the WHOLE trail rather than
|
|
@@ -20487,7 +20513,7 @@ var SqliteFindingsRepository = class {
|
|
|
20487
20513
|
};
|
|
20488
20514
|
const limit = query.limit ?? DEFAULT_FINDING_TYPES_LIMIT;
|
|
20489
20515
|
const cursor = query.cursor === void 0 ? null : decodeGroupCursor(query.cursor);
|
|
20490
|
-
const start = cursor === null ? 0 : firstAfter(sorted, cursor);
|
|
20516
|
+
const start = query.offset ?? (cursor === null ? 0 : firstAfter(sorted, cursor));
|
|
20491
20517
|
const page = sorted.slice(start, start + limit);
|
|
20492
20518
|
const lastOnPage = page.at(-1);
|
|
20493
20519
|
const nextCursor = start + limit < sorted.length && lastOnPage ? encodeGroupCursor(lastOnPage) : null;
|
|
@@ -20581,7 +20607,7 @@ var SqliteFindingsRepository = class {
|
|
|
20581
20607
|
accumulator.add(row);
|
|
20582
20608
|
if (!matchesInstanceFilters(row, opts)) continue;
|
|
20583
20609
|
total += 1;
|
|
20584
|
-
if (!isPastCursor(row)) continue;
|
|
20610
|
+
if (query.offset === void 0 ? !isPastCursor(row) : total <= query.offset) continue;
|
|
20585
20611
|
if (items.length < limit) {
|
|
20586
20612
|
items.push(toInstanceDetail(row));
|
|
20587
20613
|
last = row;
|
|
@@ -20670,7 +20696,7 @@ var SqliteFindingsRepository = class {
|
|
|
20670
20696
|
}
|
|
20671
20697
|
}
|
|
20672
20698
|
sorted.sort(compareLocationOrder);
|
|
20673
|
-
const start = cursor === null ? 0 : firstLocationAfter(sorted, cursor);
|
|
20699
|
+
const start = query.offset ?? (cursor === null ? 0 : firstLocationAfter(sorted, cursor));
|
|
20674
20700
|
const page = sorted.slice(start, start + limit);
|
|
20675
20701
|
const lastOnPage = page.at(-1);
|
|
20676
20702
|
const nextCursor = start + limit < sorted.length && lastOnPage ? encodeLocationCursor(lastOnPage) : null;
|
|
@@ -23298,6 +23324,9 @@ function pageLimit(requested, fallback) {
|
|
|
23298
23324
|
if (requested === void 0) return fallback;
|
|
23299
23325
|
return Math.min(Math.max(1, Math.trunc(requested)), MAX_VAULT_PAGE_LIMIT);
|
|
23300
23326
|
}
|
|
23327
|
+
function pageOffset(requested) {
|
|
23328
|
+
return requested === void 0 ? 0 : Math.max(0, Math.trunc(requested));
|
|
23329
|
+
}
|
|
23301
23330
|
function encodeReuseCursor(payload) {
|
|
23302
23331
|
return Buffer.from(JSON.stringify(payload)).toString("base64url");
|
|
23303
23332
|
}
|
|
@@ -23645,7 +23674,8 @@ var SqliteSecretVaultRepository = class {
|
|
|
23645
23674
|
*/
|
|
23646
23675
|
listInventory(query = {}, now = Date.now()) {
|
|
23647
23676
|
const limit = pageLimit(query.limit, DEFAULT_VAULT_INVENTORY_LIMIT);
|
|
23648
|
-
const
|
|
23677
|
+
const offset = pageOffset(query.offset);
|
|
23678
|
+
const cursor = query.cursor === void 0 || query.offset !== void 0 ? null : decodeKeysetCursor(query.cursor);
|
|
23649
23679
|
const where = cursor === null ? "" : "WHERE (v.last_seen < :cursorLastSeen OR (v.last_seen = :cursorLastSeen AND v.pointer_id < :cursorPointerId))";
|
|
23650
23680
|
const rows = allRows(
|
|
23651
23681
|
this.db.prepare(
|
|
@@ -23659,11 +23689,12 @@ var SqliteSecretVaultRepository = class {
|
|
|
23659
23689
|
FROM secret_vault v
|
|
23660
23690
|
${where}
|
|
23661
23691
|
ORDER BY v.last_seen DESC, v.pointer_id DESC
|
|
23662
|
-
LIMIT :limit`
|
|
23692
|
+
LIMIT :limit OFFSET :offset`
|
|
23663
23693
|
),
|
|
23664
23694
|
bindParams({
|
|
23665
23695
|
now,
|
|
23666
23696
|
limit: limit + 1,
|
|
23697
|
+
offset,
|
|
23667
23698
|
...cursor === null ? {} : { cursorLastSeen: cursor.startedAtMs, cursorPointerId: cursor.id }
|
|
23668
23699
|
})
|
|
23669
23700
|
);
|
|
@@ -23687,7 +23718,8 @@ var SqliteSecretVaultRepository = class {
|
|
|
23687
23718
|
*/
|
|
23688
23719
|
listReuse(query = {}, now = Date.now()) {
|
|
23689
23720
|
const limit = pageLimit(query.limit, DEFAULT_VAULT_INVENTORY_LIMIT);
|
|
23690
|
-
const
|
|
23721
|
+
const offset = pageOffset(query.offset);
|
|
23722
|
+
const cursor = query.cursor === void 0 || query.offset !== void 0 ? null : decodeReuseCursor(query.cursor);
|
|
23691
23723
|
const after = cursor === null ? "" : `AND (v.occurrence_count < :cursorOccurrences
|
|
23692
23724
|
OR (v.occurrence_count = :cursorOccurrences AND v.pointer_id < :cursorPointerId))`;
|
|
23693
23725
|
const rows = allRows(
|
|
@@ -23702,11 +23734,12 @@ var SqliteSecretVaultRepository = class {
|
|
|
23702
23734
|
FROM secret_vault v
|
|
23703
23735
|
WHERE ${REUSED_PREDICATE} ${after}
|
|
23704
23736
|
ORDER BY v.occurrence_count DESC, v.pointer_id DESC
|
|
23705
|
-
LIMIT :limit`
|
|
23737
|
+
LIMIT :limit OFFSET :offset`
|
|
23706
23738
|
),
|
|
23707
23739
|
bindParams({
|
|
23708
23740
|
now,
|
|
23709
23741
|
limit: limit + 1,
|
|
23742
|
+
offset,
|
|
23710
23743
|
...cursor === null ? {} : { cursorOccurrences: cursor.occurrences, cursorPointerId: cursor.pointerId }
|
|
23711
23744
|
})
|
|
23712
23745
|
);
|
|
@@ -23731,7 +23764,8 @@ var SqliteSecretVaultRepository = class {
|
|
|
23731
23764
|
*/
|
|
23732
23765
|
listDerefs(query = {}) {
|
|
23733
23766
|
const limit = pageLimit(query.limit, DEFAULT_VAULT_DEREFS_LIMIT);
|
|
23734
|
-
const
|
|
23767
|
+
const offset = pageOffset(query.offset);
|
|
23768
|
+
const cursor = query.cursor === void 0 || query.offset !== void 0 ? null : decodeKeysetCursor(query.cursor);
|
|
23735
23769
|
const conditions = [];
|
|
23736
23770
|
if (query.includeBatched !== true) {
|
|
23737
23771
|
conditions.push(`reason NOT IN ('display', 'view-render')`);
|
|
@@ -23744,21 +23778,28 @@ var SqliteSecretVaultRepository = class {
|
|
|
23744
23778
|
this.db.prepare(
|
|
23745
23779
|
`SELECT id, pointer_id, at, target, reason, outcome, grant_id, pointer_count
|
|
23746
23780
|
FROM secret_vault_deref ${where}
|
|
23747
|
-
ORDER BY at DESC, id DESC LIMIT :limit`
|
|
23781
|
+
ORDER BY at DESC, id DESC LIMIT :limit OFFSET :offset`
|
|
23748
23782
|
),
|
|
23749
23783
|
bindParams({
|
|
23750
23784
|
limit: limit + 1,
|
|
23785
|
+
offset,
|
|
23751
23786
|
...cursor === null ? {} : { cursorAt: cursor.startedAtMs, cursorId: cursor.id }
|
|
23752
23787
|
})
|
|
23753
23788
|
);
|
|
23754
23789
|
const hasMore = rows.length > limit;
|
|
23755
23790
|
const page = hasMore ? rows.slice(0, limit) : rows;
|
|
23756
23791
|
const last = page[page.length - 1];
|
|
23757
|
-
const
|
|
23758
|
-
this.db
|
|
23759
|
-
|
|
23760
|
-
|
|
23792
|
+
const counts = getRow(
|
|
23793
|
+
this.db.prepare(
|
|
23794
|
+
`SELECT count(*) AS total,
|
|
23795
|
+
count(*) FILTER (WHERE reason IN ('display', 'view-render')) AS hidden
|
|
23796
|
+
FROM secret_vault_deref`
|
|
23797
|
+
)
|
|
23798
|
+
) ?? { total: 0, hidden: 0 };
|
|
23799
|
+
const includeBatched = query.includeBatched === true;
|
|
23800
|
+
const hiddenBatched = includeBatched ? 0 : counts.hidden;
|
|
23761
23801
|
return {
|
|
23802
|
+
totals: { derefs: includeBatched ? counts.total : counts.total - counts.hidden },
|
|
23762
23803
|
items: page.map((r) => ({
|
|
23763
23804
|
id: r.id,
|
|
23764
23805
|
pointerId: r.pointer_id,
|
|
@@ -30250,7 +30291,7 @@ function shippedRegexMatchers() {
|
|
|
30250
30291
|
}
|
|
30251
30292
|
|
|
30252
30293
|
// ../../packages/plugin-sdk/src/repo.ts
|
|
30253
|
-
import { existsSync as existsSync9,
|
|
30294
|
+
import { existsSync as existsSync9, statSync as statSync7 } from "fs";
|
|
30254
30295
|
import { basename as basename2, dirname as dirname5, isAbsolute as isAbsolute3, join as join24, sep as sep4 } from "path";
|
|
30255
30296
|
function remoteWithoutCredentials(remote) {
|
|
30256
30297
|
const withoutInfo = withoutUserinfo(remote);
|
|
@@ -30284,6 +30325,7 @@ function unparsedWithoutCredentials(remote) {
|
|
|
30284
30325
|
return `${scheme}${tail.split(/[?#]/, 1)[0] ?? ""}`;
|
|
30285
30326
|
}
|
|
30286
30327
|
var NO_ATTRIBUTION = Object.freeze({});
|
|
30328
|
+
var MAX_GIT_METADATA_BYTES = 1024 * 1024;
|
|
30287
30329
|
|
|
30288
30330
|
// ../../packages/plugin-sdk/src/events.ts
|
|
30289
30331
|
import { createHash as createHash9, randomUUID as randomUUID14 } from "crypto";
|
|
@@ -31868,7 +31910,7 @@ function sessionToolIsKeyed(tool) {
|
|
|
31868
31910
|
|
|
31869
31911
|
// ../../packages/plugin-runtime/src/attached/config-inventory-sync.ts
|
|
31870
31912
|
import { createHash as createHash11 } from "crypto";
|
|
31871
|
-
import { readFileSync as
|
|
31913
|
+
import { readFileSync as readFileSync17 } from "fs";
|
|
31872
31914
|
import { join as join28 } from "path";
|
|
31873
31915
|
|
|
31874
31916
|
// ../../packages/plugin-runtime/src/attached/config-inventory-wire.ts
|
|
@@ -31968,7 +32010,7 @@ async function publishByRename(tmp, file, move = rename2) {
|
|
|
31968
32010
|
|
|
31969
32011
|
// ../../packages/plugin-runtime/src/attached/capture-settings.ts
|
|
31970
32012
|
import { randomUUID as randomUUID17 } from "crypto";
|
|
31971
|
-
import { readFileSync as
|
|
32013
|
+
import { readFileSync as readFileSync16 } from "fs";
|
|
31972
32014
|
import { rm, writeFile as writeFile2 } from "fs/promises";
|
|
31973
32015
|
import { join as join26 } from "path";
|
|
31974
32016
|
var HookCaptureSettingsSchema = CaptureSettings.pick({
|
|
@@ -32356,7 +32398,7 @@ function reportKey(request) {
|
|
|
32356
32398
|
function readStagedEntries(dataDir2) {
|
|
32357
32399
|
let parsed2;
|
|
32358
32400
|
try {
|
|
32359
|
-
parsed2 = JSON.parse(
|
|
32401
|
+
parsed2 = JSON.parse(readFileSync17(stagedConfigInventoryPath(dataDir2), "utf8"));
|
|
32360
32402
|
} catch {
|
|
32361
32403
|
return [];
|
|
32362
32404
|
}
|
|
@@ -32380,7 +32422,7 @@ function isTimestamp(value) {
|
|
|
32380
32422
|
}
|
|
32381
32423
|
|
|
32382
32424
|
// ../../packages/plugin-runtime/src/attached/forward-drops.ts
|
|
32383
|
-
import { readFileSync as
|
|
32425
|
+
import { readFileSync as readFileSync18 } from "fs";
|
|
32384
32426
|
import { join as join29 } from "path";
|
|
32385
32427
|
var FORWARD_DROPS_FILENAME = ATTACHED_FORWARD_DROPS_FILENAME;
|
|
32386
32428
|
function forwardDropsPath(dataDir2) {
|
|
@@ -32402,7 +32444,7 @@ function recordForwardDrops(dataDir2, count, nowMs) {
|
|
|
32402
32444
|
}
|
|
32403
32445
|
function readForwardDrops(dataDir2) {
|
|
32404
32446
|
try {
|
|
32405
|
-
const parsed2 = JSON.parse(
|
|
32447
|
+
const parsed2 = JSON.parse(readFileSync18(forwardDropsPath(dataDir2), "utf8"));
|
|
32406
32448
|
if (typeof parsed2 !== "object" || parsed2 === null) return null;
|
|
32407
32449
|
const record2 = parsed2;
|
|
32408
32450
|
if (typeof record2.droppedForwards !== "number" || !Number.isFinite(record2.droppedForwards)) {
|
|
@@ -33506,7 +33548,7 @@ function toWireInspection(insp, nameKey) {
|
|
|
33506
33548
|
}
|
|
33507
33549
|
|
|
33508
33550
|
// ../../packages/plugin-runtime/src/attached/plugin-block.ts
|
|
33509
|
-
import { readFileSync as
|
|
33551
|
+
import { readFileSync as readFileSync19 } from "fs";
|
|
33510
33552
|
|
|
33511
33553
|
// ../../packages/plugin-runtime/src/attached/install-record.ts
|
|
33512
33554
|
import { readFile as readFile3, stat } from "fs/promises";
|
|
@@ -33579,7 +33621,7 @@ async function readInstalledVersionBounded(installRoot) {
|
|
|
33579
33621
|
}
|
|
33580
33622
|
|
|
33581
33623
|
// ../../packages/plugin-runtime/src/attached/posture-report-state.ts
|
|
33582
|
-
import { readFileSync as
|
|
33624
|
+
import { readFileSync as readFileSync20 } from "fs";
|
|
33583
33625
|
import { join as join31 } from "path";
|
|
33584
33626
|
var POSTURE_REPORT_STATE_FILENAME = ATTACHED_POSTURE_REPORT_FILENAME;
|
|
33585
33627
|
var OUTCOME_KEYS = {
|
|
@@ -33855,11 +33897,11 @@ function createPostureStore(dir = settingsDir(), legacyDir) {
|
|
|
33855
33897
|
}
|
|
33856
33898
|
|
|
33857
33899
|
// ../../packages/plugin-runtime/src/attached/label-drops.ts
|
|
33858
|
-
import { readFileSync as
|
|
33900
|
+
import { readFileSync as readFileSync21 } from "fs";
|
|
33859
33901
|
import { join as join33 } from "path";
|
|
33860
33902
|
|
|
33861
33903
|
// ../../packages/plugin-runtime/src/attached/sync-state.ts
|
|
33862
|
-
import { readFileSync as
|
|
33904
|
+
import { readFileSync as readFileSync22 } from "fs";
|
|
33863
33905
|
import { join as join34 } from "path";
|
|
33864
33906
|
|
|
33865
33907
|
// ../../packages/plugin-runtime/src/attached/status.ts
|
|
@@ -34158,7 +34200,7 @@ var RANK = Object.fromEntries(
|
|
|
34158
34200
|
);
|
|
34159
34201
|
|
|
34160
34202
|
// ../../packages/setup-wizard/src/triage/plan-file.ts
|
|
34161
|
-
import { mkdtempSync, readFileSync as
|
|
34203
|
+
import { mkdtempSync, readFileSync as readFileSync23, rmdirSync, rmSync as rmSync11, writeFileSync as writeFileSync6 } from "fs";
|
|
34162
34204
|
import { tmpdir } from "os";
|
|
34163
34205
|
import { basename as basename5, dirname as dirname10, join as join37 } from "path";
|
|
34164
34206
|
var SuppressionEntrySchema = object({
|
|
@@ -34202,7 +34244,7 @@ var PersistedPlanSchema = object({
|
|
|
34202
34244
|
});
|
|
34203
34245
|
|
|
34204
34246
|
// src/skills-registry.ts
|
|
34205
|
-
import { readdirSync as readdirSync3, readFileSync as
|
|
34247
|
+
import { readdirSync as readdirSync3, readFileSync as readFileSync24 } from "fs";
|
|
34206
34248
|
import { join as join38 } from "path";
|
|
34207
34249
|
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
34208
34250
|
var SKILLS_DIR = fileURLToPath5(new URL("../skills", import.meta.url));
|
|
@@ -34216,7 +34258,7 @@ function readRegisteredSkills() {
|
|
|
34216
34258
|
return readdirSync3(SKILLS_DIR, { withFileTypes: true }).filter((entry) => entry.isDirectory()).flatMap((entry) => {
|
|
34217
34259
|
let content;
|
|
34218
34260
|
try {
|
|
34219
|
-
content =
|
|
34261
|
+
content = readFileSync24(join38(SKILLS_DIR, entry.name, "SKILL.md"), "utf8");
|
|
34220
34262
|
} catch {
|
|
34221
34263
|
return [];
|
|
34222
34264
|
}
|
package/scripts/history-sync.js
CHANGED
|
@@ -8763,7 +8763,11 @@ var ListFindingTypesQuery = object({
|
|
|
8763
8763
|
// and so is not bounded by what any page happens to hold.
|
|
8764
8764
|
includeId: string2().optional(),
|
|
8765
8765
|
limit: coerce_exports.number().int().min(1).max(MAX_FINDING_TYPES_LIMIT).optional(),
|
|
8766
|
-
cursor: string2().optional()
|
|
8766
|
+
cursor: string2().optional(),
|
|
8767
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
8768
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
8769
|
+
// from wherever it lands.
|
|
8770
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
8767
8771
|
});
|
|
8768
8772
|
var ListFindingTypesResponse = object({
|
|
8769
8773
|
totals: object({
|
|
@@ -8844,7 +8848,11 @@ var ListFindingInstancesQuery = object({
|
|
|
8844
8848
|
sessionId: string2().optional(),
|
|
8845
8849
|
from: iso_exports.datetime().optional(),
|
|
8846
8850
|
limit: coerce_exports.number().int().min(1).max(MAX_FLAT_FINDINGS_LIMIT).optional(),
|
|
8847
|
-
cursor: string2().optional()
|
|
8851
|
+
cursor: string2().optional(),
|
|
8852
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
8853
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
8854
|
+
// from wherever it lands.
|
|
8855
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
8848
8856
|
});
|
|
8849
8857
|
var ListFindingInstancesResponse = object({
|
|
8850
8858
|
// Instances matching the filters across the whole scope, not just this
|
|
@@ -8916,7 +8924,11 @@ var ListFindingLocationsQuery = object({
|
|
|
8916
8924
|
// rather than a deep-link corner. Never affects totals, facets or the cursor.
|
|
8917
8925
|
includeId: string2().optional(),
|
|
8918
8926
|
limit: coerce_exports.number().int().min(1).max(MAX_FINDING_LOCATIONS_LIMIT).optional(),
|
|
8919
|
-
cursor: string2().optional()
|
|
8927
|
+
cursor: string2().optional(),
|
|
8928
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
8929
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
8930
|
+
// from wherever it lands.
|
|
8931
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
8920
8932
|
});
|
|
8921
8933
|
var ListFindingLocationsResponse = object({
|
|
8922
8934
|
totals: object({
|
|
@@ -11469,7 +11481,11 @@ var MAX_VAULT_PAGE_LIMIT = 200;
|
|
|
11469
11481
|
var ListVaultInventoryQuery = object({
|
|
11470
11482
|
limit: coerce_exports.number().int().min(1).max(MAX_VAULT_PAGE_LIMIT).optional(),
|
|
11471
11483
|
// Opaque; names the last row of the page just served.
|
|
11472
|
-
cursor: string2().optional()
|
|
11484
|
+
cursor: string2().optional(),
|
|
11485
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
11486
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
11487
|
+
// from wherever it lands.
|
|
11488
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
11473
11489
|
});
|
|
11474
11490
|
var ListVaultInventoryResponse = object({
|
|
11475
11491
|
// Vaulted values across the whole store, not just this page — cursor-
|
|
@@ -11481,7 +11497,11 @@ var ListVaultInventoryResponse = object({
|
|
|
11481
11497
|
});
|
|
11482
11498
|
var ListVaultReuseQuery = object({
|
|
11483
11499
|
limit: coerce_exports.number().int().min(1).max(MAX_VAULT_PAGE_LIMIT).optional(),
|
|
11484
|
-
cursor: string2().optional()
|
|
11500
|
+
cursor: string2().optional(),
|
|
11501
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
11502
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
11503
|
+
// from wherever it lands.
|
|
11504
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
11485
11505
|
});
|
|
11486
11506
|
var ListVaultReuseResponse = object({
|
|
11487
11507
|
// Reused values across the whole store — the number the section's claim
|
|
@@ -11497,9 +11517,15 @@ var ListVaultDerefsQuery = object({
|
|
|
11497
11517
|
// over a Server Action, which preserves the type, never as a URL param.
|
|
11498
11518
|
includeBatched: boolean2().optional(),
|
|
11499
11519
|
limit: coerce_exports.number().int().min(1).max(MAX_VAULT_PAGE_LIMIT).optional(),
|
|
11500
|
-
cursor: string2().optional()
|
|
11520
|
+
cursor: string2().optional(),
|
|
11521
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
11522
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
11523
|
+
// from wherever it lands.
|
|
11524
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
11501
11525
|
});
|
|
11502
11526
|
var ListVaultDerefsResponse = object({
|
|
11527
|
+
// Rows this filter selects across the whole trail, not just this page.
|
|
11528
|
+
totals: object({ derefs: number2().int().nonnegative() }),
|
|
11503
11529
|
items: array(VaultDeref),
|
|
11504
11530
|
nextCursor: string2().nullable(),
|
|
11505
11531
|
// Display/view-render rows the query hid, over the WHOLE trail rather than
|
|
@@ -19871,7 +19897,7 @@ var SqliteFindingsRepository = class {
|
|
|
19871
19897
|
};
|
|
19872
19898
|
const limit = query.limit ?? DEFAULT_FINDING_TYPES_LIMIT;
|
|
19873
19899
|
const cursor = query.cursor === void 0 ? null : decodeGroupCursor(query.cursor);
|
|
19874
|
-
const start = cursor === null ? 0 : firstAfter(sorted, cursor);
|
|
19900
|
+
const start = query.offset ?? (cursor === null ? 0 : firstAfter(sorted, cursor));
|
|
19875
19901
|
const page = sorted.slice(start, start + limit);
|
|
19876
19902
|
const lastOnPage = page.at(-1);
|
|
19877
19903
|
const nextCursor = start + limit < sorted.length && lastOnPage ? encodeGroupCursor(lastOnPage) : null;
|
|
@@ -19965,7 +19991,7 @@ var SqliteFindingsRepository = class {
|
|
|
19965
19991
|
accumulator.add(row);
|
|
19966
19992
|
if (!matchesInstanceFilters(row, opts)) continue;
|
|
19967
19993
|
total += 1;
|
|
19968
|
-
if (!isPastCursor(row)) continue;
|
|
19994
|
+
if (query.offset === void 0 ? !isPastCursor(row) : total <= query.offset) continue;
|
|
19969
19995
|
if (items.length < limit) {
|
|
19970
19996
|
items.push(toInstanceDetail(row));
|
|
19971
19997
|
last = row;
|
|
@@ -20054,7 +20080,7 @@ var SqliteFindingsRepository = class {
|
|
|
20054
20080
|
}
|
|
20055
20081
|
}
|
|
20056
20082
|
sorted.sort(compareLocationOrder);
|
|
20057
|
-
const start = cursor === null ? 0 : firstLocationAfter(sorted, cursor);
|
|
20083
|
+
const start = query.offset ?? (cursor === null ? 0 : firstLocationAfter(sorted, cursor));
|
|
20058
20084
|
const page = sorted.slice(start, start + limit);
|
|
20059
20085
|
const lastOnPage = page.at(-1);
|
|
20060
20086
|
const nextCursor = start + limit < sorted.length && lastOnPage ? encodeLocationCursor(lastOnPage) : null;
|
|
@@ -22682,6 +22708,9 @@ function pageLimit(requested, fallback) {
|
|
|
22682
22708
|
if (requested === void 0) return fallback;
|
|
22683
22709
|
return Math.min(Math.max(1, Math.trunc(requested)), MAX_VAULT_PAGE_LIMIT);
|
|
22684
22710
|
}
|
|
22711
|
+
function pageOffset(requested) {
|
|
22712
|
+
return requested === void 0 ? 0 : Math.max(0, Math.trunc(requested));
|
|
22713
|
+
}
|
|
22685
22714
|
function encodeReuseCursor(payload) {
|
|
22686
22715
|
return Buffer.from(JSON.stringify(payload)).toString("base64url");
|
|
22687
22716
|
}
|
|
@@ -23029,7 +23058,8 @@ var SqliteSecretVaultRepository = class {
|
|
|
23029
23058
|
*/
|
|
23030
23059
|
listInventory(query = {}, now = Date.now()) {
|
|
23031
23060
|
const limit = pageLimit(query.limit, DEFAULT_VAULT_INVENTORY_LIMIT);
|
|
23032
|
-
const
|
|
23061
|
+
const offset = pageOffset(query.offset);
|
|
23062
|
+
const cursor = query.cursor === void 0 || query.offset !== void 0 ? null : decodeKeysetCursor(query.cursor);
|
|
23033
23063
|
const where = cursor === null ? "" : "WHERE (v.last_seen < :cursorLastSeen OR (v.last_seen = :cursorLastSeen AND v.pointer_id < :cursorPointerId))";
|
|
23034
23064
|
const rows = allRows(
|
|
23035
23065
|
this.db.prepare(
|
|
@@ -23043,11 +23073,12 @@ var SqliteSecretVaultRepository = class {
|
|
|
23043
23073
|
FROM secret_vault v
|
|
23044
23074
|
${where}
|
|
23045
23075
|
ORDER BY v.last_seen DESC, v.pointer_id DESC
|
|
23046
|
-
LIMIT :limit`
|
|
23076
|
+
LIMIT :limit OFFSET :offset`
|
|
23047
23077
|
),
|
|
23048
23078
|
bindParams({
|
|
23049
23079
|
now,
|
|
23050
23080
|
limit: limit + 1,
|
|
23081
|
+
offset,
|
|
23051
23082
|
...cursor === null ? {} : { cursorLastSeen: cursor.startedAtMs, cursorPointerId: cursor.id }
|
|
23052
23083
|
})
|
|
23053
23084
|
);
|
|
@@ -23071,7 +23102,8 @@ var SqliteSecretVaultRepository = class {
|
|
|
23071
23102
|
*/
|
|
23072
23103
|
listReuse(query = {}, now = Date.now()) {
|
|
23073
23104
|
const limit = pageLimit(query.limit, DEFAULT_VAULT_INVENTORY_LIMIT);
|
|
23074
|
-
const
|
|
23105
|
+
const offset = pageOffset(query.offset);
|
|
23106
|
+
const cursor = query.cursor === void 0 || query.offset !== void 0 ? null : decodeReuseCursor(query.cursor);
|
|
23075
23107
|
const after = cursor === null ? "" : `AND (v.occurrence_count < :cursorOccurrences
|
|
23076
23108
|
OR (v.occurrence_count = :cursorOccurrences AND v.pointer_id < :cursorPointerId))`;
|
|
23077
23109
|
const rows = allRows(
|
|
@@ -23086,11 +23118,12 @@ var SqliteSecretVaultRepository = class {
|
|
|
23086
23118
|
FROM secret_vault v
|
|
23087
23119
|
WHERE ${REUSED_PREDICATE} ${after}
|
|
23088
23120
|
ORDER BY v.occurrence_count DESC, v.pointer_id DESC
|
|
23089
|
-
LIMIT :limit`
|
|
23121
|
+
LIMIT :limit OFFSET :offset`
|
|
23090
23122
|
),
|
|
23091
23123
|
bindParams({
|
|
23092
23124
|
now,
|
|
23093
23125
|
limit: limit + 1,
|
|
23126
|
+
offset,
|
|
23094
23127
|
...cursor === null ? {} : { cursorOccurrences: cursor.occurrences, cursorPointerId: cursor.pointerId }
|
|
23095
23128
|
})
|
|
23096
23129
|
);
|
|
@@ -23115,7 +23148,8 @@ var SqliteSecretVaultRepository = class {
|
|
|
23115
23148
|
*/
|
|
23116
23149
|
listDerefs(query = {}) {
|
|
23117
23150
|
const limit = pageLimit(query.limit, DEFAULT_VAULT_DEREFS_LIMIT);
|
|
23118
|
-
const
|
|
23151
|
+
const offset = pageOffset(query.offset);
|
|
23152
|
+
const cursor = query.cursor === void 0 || query.offset !== void 0 ? null : decodeKeysetCursor(query.cursor);
|
|
23119
23153
|
const conditions = [];
|
|
23120
23154
|
if (query.includeBatched !== true) {
|
|
23121
23155
|
conditions.push(`reason NOT IN ('display', 'view-render')`);
|
|
@@ -23128,21 +23162,28 @@ var SqliteSecretVaultRepository = class {
|
|
|
23128
23162
|
this.db.prepare(
|
|
23129
23163
|
`SELECT id, pointer_id, at, target, reason, outcome, grant_id, pointer_count
|
|
23130
23164
|
FROM secret_vault_deref ${where}
|
|
23131
|
-
ORDER BY at DESC, id DESC LIMIT :limit`
|
|
23165
|
+
ORDER BY at DESC, id DESC LIMIT :limit OFFSET :offset`
|
|
23132
23166
|
),
|
|
23133
23167
|
bindParams({
|
|
23134
23168
|
limit: limit + 1,
|
|
23169
|
+
offset,
|
|
23135
23170
|
...cursor === null ? {} : { cursorAt: cursor.startedAtMs, cursorId: cursor.id }
|
|
23136
23171
|
})
|
|
23137
23172
|
);
|
|
23138
23173
|
const hasMore = rows.length > limit;
|
|
23139
23174
|
const page = hasMore ? rows.slice(0, limit) : rows;
|
|
23140
23175
|
const last = page[page.length - 1];
|
|
23141
|
-
const
|
|
23142
|
-
this.db
|
|
23143
|
-
|
|
23144
|
-
|
|
23176
|
+
const counts = getRow(
|
|
23177
|
+
this.db.prepare(
|
|
23178
|
+
`SELECT count(*) AS total,
|
|
23179
|
+
count(*) FILTER (WHERE reason IN ('display', 'view-render')) AS hidden
|
|
23180
|
+
FROM secret_vault_deref`
|
|
23181
|
+
)
|
|
23182
|
+
) ?? { total: 0, hidden: 0 };
|
|
23183
|
+
const includeBatched = query.includeBatched === true;
|
|
23184
|
+
const hiddenBatched = includeBatched ? 0 : counts.hidden;
|
|
23145
23185
|
return {
|
|
23186
|
+
totals: { derefs: includeBatched ? counts.total : counts.total - counts.hidden },
|
|
23146
23187
|
items: page.map((r) => ({
|
|
23147
23188
|
id: r.id,
|
|
23148
23189
|
pointerId: r.pointer_id,
|
package/scripts/intro.js
CHANGED
|
@@ -8382,7 +8382,11 @@ var ListFindingTypesQuery = object({
|
|
|
8382
8382
|
// and so is not bounded by what any page happens to hold.
|
|
8383
8383
|
includeId: string2().optional(),
|
|
8384
8384
|
limit: coerce_exports.number().int().min(1).max(MAX_FINDING_TYPES_LIMIT).optional(),
|
|
8385
|
-
cursor: string2().optional()
|
|
8385
|
+
cursor: string2().optional(),
|
|
8386
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
8387
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
8388
|
+
// from wherever it lands.
|
|
8389
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
8386
8390
|
});
|
|
8387
8391
|
var ListFindingTypesResponse = object({
|
|
8388
8392
|
totals: object({
|
|
@@ -8462,7 +8466,11 @@ var ListFindingInstancesQuery = object({
|
|
|
8462
8466
|
sessionId: string2().optional(),
|
|
8463
8467
|
from: iso_exports.datetime().optional(),
|
|
8464
8468
|
limit: coerce_exports.number().int().min(1).max(MAX_FLAT_FINDINGS_LIMIT).optional(),
|
|
8465
|
-
cursor: string2().optional()
|
|
8469
|
+
cursor: string2().optional(),
|
|
8470
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
8471
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
8472
|
+
// from wherever it lands.
|
|
8473
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
8466
8474
|
});
|
|
8467
8475
|
var ListFindingInstancesResponse = object({
|
|
8468
8476
|
// Instances matching the filters across the whole scope, not just this
|
|
@@ -8533,7 +8541,11 @@ var ListFindingLocationsQuery = object({
|
|
|
8533
8541
|
// rather than a deep-link corner. Never affects totals, facets or the cursor.
|
|
8534
8542
|
includeId: string2().optional(),
|
|
8535
8543
|
limit: coerce_exports.number().int().min(1).max(MAX_FINDING_LOCATIONS_LIMIT).optional(),
|
|
8536
|
-
cursor: string2().optional()
|
|
8544
|
+
cursor: string2().optional(),
|
|
8545
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
8546
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
8547
|
+
// from wherever it lands.
|
|
8548
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
8537
8549
|
});
|
|
8538
8550
|
var ListFindingLocationsResponse = object({
|
|
8539
8551
|
totals: object({
|
|
@@ -10930,7 +10942,11 @@ var MAX_VAULT_PAGE_LIMIT = 200;
|
|
|
10930
10942
|
var ListVaultInventoryQuery = object({
|
|
10931
10943
|
limit: coerce_exports.number().int().min(1).max(MAX_VAULT_PAGE_LIMIT).optional(),
|
|
10932
10944
|
// Opaque; names the last row of the page just served.
|
|
10933
|
-
cursor: string2().optional()
|
|
10945
|
+
cursor: string2().optional(),
|
|
10946
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
10947
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
10948
|
+
// from wherever it lands.
|
|
10949
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
10934
10950
|
});
|
|
10935
10951
|
var ListVaultInventoryResponse = object({
|
|
10936
10952
|
// Vaulted values across the whole store, not just this page — cursor-
|
|
@@ -10942,7 +10958,11 @@ var ListVaultInventoryResponse = object({
|
|
|
10942
10958
|
});
|
|
10943
10959
|
var ListVaultReuseQuery = object({
|
|
10944
10960
|
limit: coerce_exports.number().int().min(1).max(MAX_VAULT_PAGE_LIMIT).optional(),
|
|
10945
|
-
cursor: string2().optional()
|
|
10961
|
+
cursor: string2().optional(),
|
|
10962
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
10963
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
10964
|
+
// from wherever it lands.
|
|
10965
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
10946
10966
|
});
|
|
10947
10967
|
var ListVaultReuseResponse = object({
|
|
10948
10968
|
// Reused values across the whole store — the number the section's claim
|
|
@@ -10958,9 +10978,15 @@ var ListVaultDerefsQuery = object({
|
|
|
10958
10978
|
// over a Server Action, which preserves the type, never as a URL param.
|
|
10959
10979
|
includeBatched: boolean2().optional(),
|
|
10960
10980
|
limit: coerce_exports.number().int().min(1).max(MAX_VAULT_PAGE_LIMIT).optional(),
|
|
10961
|
-
cursor: string2().optional()
|
|
10981
|
+
cursor: string2().optional(),
|
|
10982
|
+
// A row position to read from, for jumping to a page instead of stepping to
|
|
10983
|
+
// it. Takes precedence over `cursor`, and the page's `nextCursor` carries on
|
|
10984
|
+
// from wherever it lands.
|
|
10985
|
+
offset: coerce_exports.number().int().min(0).optional()
|
|
10962
10986
|
});
|
|
10963
10987
|
var ListVaultDerefsResponse = object({
|
|
10988
|
+
// Rows this filter selects across the whole trail, not just this page.
|
|
10989
|
+
totals: object({ derefs: number2().int().nonnegative() }),
|
|
10964
10990
|
items: array(VaultDeref),
|
|
10965
10991
|
nextCursor: string2().nullable(),
|
|
10966
10992
|
// Display/view-render rows the query hid, over the WHOLE trail rather than
|