@akasecurity/ai-tc-claude-code 0.9.11 → 0.9.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/commands/scan.md +1 -1
- package/commands/setup.md +31 -3
- package/package.json +2 -2
- package/scripts/apply-suppressions.js +1415 -793
- package/scripts/backfill.js +1524 -839
- package/scripts/content-retention.js +33995 -0
- package/scripts/filescan.js +1700 -883
- package/scripts/firstrun.js +1483 -813
- package/scripts/history-sync.js +1588 -875
- package/scripts/intro.js +316 -56
- package/scripts/message-display.js +1397 -775
- package/scripts/onboard.js +1404 -774
- package/scripts/post-model-switch.js +339 -71
- package/scripts/post-tool-use.js +1527 -842
- package/scripts/pre-model-switch.js +1485 -814
- package/scripts/pre-tool-use.js +1536 -845
- package/scripts/query.js +1488 -816
- package/scripts/reconcile.js +1499 -828
- package/scripts/remediate.js +1522 -837
- package/scripts/scan-worker.js +237 -18
- package/scripts/session-start.js +1568 -876
- package/scripts/start-light.js +314 -54
- package/scripts/statusline.js +1483 -812
- package/scripts/stop.js +348 -80
- package/scripts/sync.js +1698 -881
- package/scripts/user-prompt-submit.js +1524 -839
|
@@ -50,7 +50,7 @@ var require_ignore = __commonJS({
|
|
|
50
50
|
var REGEX_SPLITALL_CRLF = /\r?\n/g;
|
|
51
51
|
var REGEX_TEST_INVALID_PATH = /^\.{0,2}\/|^\.{1,2}$/;
|
|
52
52
|
var REGEX_TEST_TRAILING_SLASH = /\/$/;
|
|
53
|
-
var
|
|
53
|
+
var SLASH3 = "/";
|
|
54
54
|
var TMP_KEY_IGNORE = "node-ignore";
|
|
55
55
|
if (typeof Symbol !== "undefined") {
|
|
56
56
|
TMP_KEY_IGNORE = /* @__PURE__ */ Symbol.for("node-ignore");
|
|
@@ -422,11 +422,11 @@ var require_ignore = __commonJS({
|
|
|
422
422
|
if (!REGEX_TEST_TRAILING_SLASH.test(path)) {
|
|
423
423
|
return this.test(path);
|
|
424
424
|
}
|
|
425
|
-
const slices = path.split(
|
|
425
|
+
const slices = path.split(SLASH3).filter(Boolean);
|
|
426
426
|
slices.pop();
|
|
427
427
|
if (slices.length) {
|
|
428
428
|
const parent = this._t(
|
|
429
|
-
slices.join(
|
|
429
|
+
slices.join(SLASH3) + SLASH3,
|
|
430
430
|
this._testCache,
|
|
431
431
|
true,
|
|
432
432
|
slices
|
|
@@ -442,14 +442,14 @@ var require_ignore = __commonJS({
|
|
|
442
442
|
return cache[path];
|
|
443
443
|
}
|
|
444
444
|
if (!slices) {
|
|
445
|
-
slices = path.split(
|
|
445
|
+
slices = path.split(SLASH3).filter(Boolean);
|
|
446
446
|
}
|
|
447
447
|
slices.pop();
|
|
448
448
|
if (!slices.length) {
|
|
449
449
|
return cache[path] = this._rules.test(path, checkUnignored, MODE_IGNORE);
|
|
450
450
|
}
|
|
451
451
|
const parent = this._t(
|
|
452
|
-
slices.join(
|
|
452
|
+
slices.join(SLASH3) + SLASH3,
|
|
453
453
|
cache,
|
|
454
454
|
checkUnignored,
|
|
455
455
|
slices
|
|
@@ -493,7 +493,7 @@ var require_ignore = __commonJS({
|
|
|
493
493
|
|
|
494
494
|
// ../../packages/plugin-sdk/src/config.ts
|
|
495
495
|
import { existsSync as existsSync8 } from "fs";
|
|
496
|
-
import { join as
|
|
496
|
+
import { join as join16 } from "path";
|
|
497
497
|
|
|
498
498
|
// ../../packages/persistence/src/attached-derived.ts
|
|
499
499
|
import { rmSync } from "fs";
|
|
@@ -503,6 +503,14 @@ import { join } from "path";
|
|
|
503
503
|
import { chmodSync as chmodSync2, lstatSync as lstatSync2, readFileSync, rmSync as rmSync3, statSync } from "fs";
|
|
504
504
|
import { join as join2 } from "path";
|
|
505
505
|
|
|
506
|
+
// ../../packages/schema/src/drizzle/deferred-migrations.ts
|
|
507
|
+
var DEFERRED_MIGRATION_TAGS = [
|
|
508
|
+
"0031_audit_capture_by_time_index",
|
|
509
|
+
"0032_audit_capture_by_id_index",
|
|
510
|
+
"0033_audit_capture_location_index",
|
|
511
|
+
"0034_findings_read_indexes"
|
|
512
|
+
];
|
|
513
|
+
|
|
506
514
|
// ../../packages/schema/src/exception-scope.ts
|
|
507
515
|
var MINUTE_MS = 6e4;
|
|
508
516
|
var HOUR_MS = 60 * MINUTE_MS;
|
|
@@ -20312,6 +20320,15 @@ var FindingCategory = external_exports.enum([
|
|
|
20312
20320
|
]).meta({ id: "FindingCategory" });
|
|
20313
20321
|
var FindingOrigin = external_exports.enum(["in-flight", "at-rest"]).meta({ id: "FindingOrigin" });
|
|
20314
20322
|
var FindingStatus = external_exports.enum(["open", "handled", "resolved", "dismissed"]).meta({ id: "FindingStatus" });
|
|
20323
|
+
var SyncFailureReason = external_exports.enum(["deployment_refused", "payload_invalid", "detached_undelivered"]).meta({ id: "SyncFailureReason" });
|
|
20324
|
+
var FindingDeliveryState = external_exports.enum(["sent", "queued", "not_sent", "never_offered", "local_scan"]).meta({ id: "FindingDeliveryState" });
|
|
20325
|
+
var FindingDelivery = external_exports.object({
|
|
20326
|
+
state: FindingDeliveryState,
|
|
20327
|
+
// The delivery time for `sent`; the failure time for `not_sent` when recorded.
|
|
20328
|
+
at: external_exports.iso.datetime().optional(),
|
|
20329
|
+
// Only on `not_sent`, and only when a known reason was recorded.
|
|
20330
|
+
reason: SyncFailureReason.optional()
|
|
20331
|
+
}).meta({ id: "FindingDelivery" });
|
|
20315
20332
|
var ResolutionMethod = external_exports.enum([
|
|
20316
20333
|
"enforced-in-flight",
|
|
20317
20334
|
"fixed-at-source",
|
|
@@ -20368,7 +20385,10 @@ var FindingInstance = external_exports.object({
|
|
|
20368
20385
|
// The session that event belongs to, when it has one — the seam a
|
|
20369
20386
|
// per-instance "view session" link needs. Absent for events captured
|
|
20370
20387
|
// outside a session.
|
|
20371
|
-
sessionId: external_exports.string().optional()
|
|
20388
|
+
sessionId: external_exports.string().optional(),
|
|
20389
|
+
// The delivery state of the event above (see FindingDelivery). Optional so
|
|
20390
|
+
// readers that do not project it stay valid.
|
|
20391
|
+
delivery: FindingDelivery.optional()
|
|
20372
20392
|
}).meta({ id: "FindingInstance" });
|
|
20373
20393
|
var FindingGroup = external_exports.object({
|
|
20374
20394
|
id: external_exports.string(),
|
|
@@ -20420,7 +20440,10 @@ var FindingFacets = external_exports.object({
|
|
|
20420
20440
|
// Host tool (attributes.tool_name). Present only on the instance-level
|
|
20421
20441
|
// reads, which can filter by it; the type-level read omits the dimension
|
|
20422
20442
|
// because a group spans tools.
|
|
20423
|
-
tool: external_exports.array(FindingFacetItem).optional()
|
|
20443
|
+
tool: external_exports.array(FindingFacetItem).optional(),
|
|
20444
|
+
// Delivery states (FindingDeliveryState). Present only on the
|
|
20445
|
+
// instance-level reads, like `tool`.
|
|
20446
|
+
deployment: external_exports.array(FindingFacetItem).optional()
|
|
20424
20447
|
}).meta({ id: "FindingFacets" });
|
|
20425
20448
|
var FindingTypeSummary = FindingGroup.omit({ instances: true, match: true }).meta({
|
|
20426
20449
|
id: "FindingTypeSummary"
|
|
@@ -20529,6 +20552,8 @@ var ListFindingInstancesQuery = external_exports.object({
|
|
|
20529
20552
|
// Exact host-tool names (attributes.tool_name, e.g. 'Bash'). A real filter,
|
|
20530
20553
|
// where the free-text `q` can only match the rendered "via Bash" label.
|
|
20531
20554
|
tool: external_exports.array(external_exports.string()).optional(),
|
|
20555
|
+
// The delivery state of each finding's event (see FindingDelivery).
|
|
20556
|
+
deployment: external_exports.array(FindingDeliveryState).optional(),
|
|
20532
20557
|
// Exact repository / file-path matches, for the drill-down out of the
|
|
20533
20558
|
// locations view. A row whose event carries no repo/file matches neither.
|
|
20534
20559
|
repo: external_exports.string().optional(),
|
|
@@ -20549,6 +20574,10 @@ var ListFindingInstancesResponse = external_exports.object({
|
|
|
20549
20574
|
items: external_exports.array(FindingInstanceDetail),
|
|
20550
20575
|
nextCursor: external_exports.string().nullable()
|
|
20551
20576
|
}).meta({ id: "ListFindingInstancesResponse" });
|
|
20577
|
+
var ListFindingInstancesPage = external_exports.object({
|
|
20578
|
+
items: external_exports.array(FindingInstanceDetail),
|
|
20579
|
+
nextCursor: external_exports.string().nullable()
|
|
20580
|
+
}).meta({ id: "ListFindingInstancesPage" });
|
|
20552
20581
|
var FindingLocationSummary = external_exports.object({
|
|
20553
20582
|
// Opaque, stable, minted from the pair by encodeLocationId. It exists
|
|
20554
20583
|
// because a location's identity is two values and a URL param carries one:
|
|
@@ -20590,6 +20619,8 @@ var ListFindingLocationsQuery = external_exports.object({
|
|
|
20590
20619
|
// instances that match, and folds its status from those.
|
|
20591
20620
|
status: external_exports.array(FindingStatus).optional(),
|
|
20592
20621
|
tool: external_exports.array(external_exports.string()).optional(),
|
|
20622
|
+
// The delivery state of each finding's event (see FindingDelivery).
|
|
20623
|
+
deployment: external_exports.array(FindingDeliveryState).optional(),
|
|
20593
20624
|
q: external_exports.string().optional(),
|
|
20594
20625
|
sessionId: external_exports.string().optional(),
|
|
20595
20626
|
from: external_exports.iso.datetime().optional(),
|
|
@@ -20792,6 +20823,10 @@ var CaptureAttributes = external_exports.object({
|
|
|
20792
20823
|
// to 'allow' — the enforcement audit trail's link back to the grant that
|
|
20793
20824
|
// authorized the bypass.
|
|
20794
20825
|
exception_ids: external_exports.array(external_exports.guid()).optional(),
|
|
20826
|
+
// The persisted spellings of EventMetadata's messageId/conversationId — the
|
|
20827
|
+
// join back to the `llm_call` leaf for the same assistant turn.
|
|
20828
|
+
message_id: external_exports.string().optional(),
|
|
20829
|
+
conversation_id: external_exports.string().optional(),
|
|
20795
20830
|
// Whole milliseconds this capture's inspection blocked its caller — the
|
|
20796
20831
|
// plugin's own added latency (see EventMetadata.inspectionMs, whose value
|
|
20797
20832
|
// this is). Promoted to the `inspection_ms` generated column so the facet is
|
|
@@ -20800,7 +20835,19 @@ var CaptureAttributes = external_exports.object({
|
|
|
20800
20835
|
// inline json_extract and is not itself an optimization.
|
|
20801
20836
|
// ABSENT on replayed captures (backfill / worktree scan) and on rows written
|
|
20802
20837
|
// before the measurement shipped — never present as a placeholder 0.
|
|
20803
|
-
inspection_ms: external_exports.number().int().nonnegative().optional()
|
|
20838
|
+
inspection_ms: external_exports.number().int().nonnegative().optional(),
|
|
20839
|
+
// What a `redact` this capture could not carry out became instead (see
|
|
20840
|
+
// EventMetadata.redactDegradedTo, whose value this is). Present only when a
|
|
20841
|
+
// degrade actually happened, so absence is the ordinary case rather than a
|
|
20842
|
+
// reader having to distinguish it from a zero.
|
|
20843
|
+
//
|
|
20844
|
+
// PER CAPTURE, while `inspection_findings.action_taken` is per finding —
|
|
20845
|
+
// so on a multi-finding row this does not say which finding degraded, and
|
|
20846
|
+
// its presence does not mean the fallback decided the capture's action. A
|
|
20847
|
+
// capture denied by another finding's own Block policy carries `block`
|
|
20848
|
+
// here too. The full statement is on EventMetadata.redactDegradedTo; it is
|
|
20849
|
+
// repeated rather than referenced because a store reader opens this file.
|
|
20850
|
+
redact_degraded_to: ActionTaken.optional()
|
|
20804
20851
|
}).catchall(external_exports.unknown());
|
|
20805
20852
|
var ToolCallInspection = external_exports.object({
|
|
20806
20853
|
ruleId: external_exports.string().min(1),
|
|
@@ -20996,7 +21043,17 @@ var AuditEvent = external_exports.object({
|
|
|
20996
21043
|
/** `share` to a first-party/internal destination. */
|
|
20997
21044
|
internal: external_exports.boolean(),
|
|
20998
21045
|
/** Event needs review (e.g. unverified egress). */
|
|
20999
|
-
flagged: external_exports.boolean()
|
|
21046
|
+
flagged: external_exports.boolean(),
|
|
21047
|
+
/**
|
|
21048
|
+
* The body this event's `title` is drawn from was cleared by local body
|
|
21049
|
+
* expiry, so an EMPTY title here means "gone", not "never had one".
|
|
21050
|
+
*
|
|
21051
|
+
* A separate flag rather than a sentinel written into `title`: the title is
|
|
21052
|
+
* rendered text, and a store-layer module that invented display copy for it
|
|
21053
|
+
* would be choosing words the view is supposed to choose. Additive and
|
|
21054
|
+
* defaulted, so an older producer still validates.
|
|
21055
|
+
*/
|
|
21056
|
+
bodyExpired: external_exports.boolean().default(false)
|
|
21000
21057
|
}).meta({ id: "ActivityAuditEvent" });
|
|
21001
21058
|
var ActivitySessionSummary = external_exports.object({
|
|
21002
21059
|
id: external_exports.string(),
|
|
@@ -22219,6 +22276,12 @@ var EventMetadata = external_exports.object({
|
|
|
22219
22276
|
// to 'allow' — the enforcement audit trail's link back to the grant that
|
|
22220
22277
|
// authorized the bypass. Absent on captures where no exception applied.
|
|
22221
22278
|
exceptionIds: external_exports.array(external_exports.guid()).optional(),
|
|
22279
|
+
// The assistant message this capture belongs to, and the conversation it sits
|
|
22280
|
+
// in — set by the browser extension's network capture so a stored `response`
|
|
22281
|
+
// row can be joined to the `llm_call` leaf describing the same turn. Absent
|
|
22282
|
+
// on every other capture path, which has no such id.
|
|
22283
|
+
messageId: external_exports.string().optional(),
|
|
22284
|
+
conversationId: external_exports.string().optional(),
|
|
22222
22285
|
// How long THIS capture's inspection blocked its caller, in whole
|
|
22223
22286
|
// milliseconds — the plugin's own added latency, NOT the LLM call it sat in
|
|
22224
22287
|
// front of. Measured inside `capture()` (@akasecurity/plugin-sdk) across
|
|
@@ -22231,7 +22294,37 @@ var EventMetadata = external_exports.object({
|
|
|
22231
22294
|
// Absent is also what every pre-measurement client writes, and what a
|
|
22232
22295
|
// clock failure degrades to — a reader must treat absence as "not measured"
|
|
22233
22296
|
// and never as a zero, which would read as "inspection is free".
|
|
22234
|
-
inspectionMs: external_exports.number().int().nonnegative().optional()
|
|
22297
|
+
inspectionMs: external_exports.number().int().nonnegative().optional(),
|
|
22298
|
+
// What a `redact` this capture COULD NOT CARRY OUT became instead — the
|
|
22299
|
+
// workspace's `redactFallback`, applied because the field could not be
|
|
22300
|
+
// masked in place (a shell command, a URL, or any argument on a host whose
|
|
22301
|
+
// hook contract offers no rewrite channel).
|
|
22302
|
+
//
|
|
22303
|
+
// It exists because the action alone cannot say why. A finding recorded as
|
|
22304
|
+
// `warn` reads identically whether its detection was ASSIGNED Warn or was
|
|
22305
|
+
// assigned Redact on a field that could not take one — and those are
|
|
22306
|
+
// different facts about the same row: the first is a policy the user chose,
|
|
22307
|
+
// the second is a masking the host could not perform. Absent means no
|
|
22308
|
+
// degrade happened, which is every ordinary capture.
|
|
22309
|
+
//
|
|
22310
|
+
// TWO LIMITS a reader of a stored row has to know, because the grain here
|
|
22311
|
+
// is the CAPTURE while `actionTaken` is per FINDING:
|
|
22312
|
+
//
|
|
22313
|
+
// - It does not say WHICH finding degraded. A capture carrying a degraded
|
|
22314
|
+
// `redact` alongside a finding ASSIGNED the same action stores both
|
|
22315
|
+
// identically and one reason for the pair; attributing it to both
|
|
22316
|
+
// describes the assigned one wrongly, and to neither loses the degrade.
|
|
22317
|
+
// - PRESENCE IS NOT CAUSATION. The value is the action the lost redact
|
|
22318
|
+
// became, not the reason the capture ended as it did — a capture denied
|
|
22319
|
+
// by some other finding's own Block policy still carries `block` here,
|
|
22320
|
+
// and clearing the workspace's fallback would not have let it through.
|
|
22321
|
+
// Gate on the value against what a fallback can produce; never read the
|
|
22322
|
+
// field's presence as "this was the fallback's doing".
|
|
22323
|
+
//
|
|
22324
|
+
// Both are pinned as behaviour in @akasecurity/plugin-sdk's runtime suite.
|
|
22325
|
+
// Closing either means moving the reason onto the finding row, which
|
|
22326
|
+
// already carries its own action.
|
|
22327
|
+
redactDegradedTo: ActionTaken.optional()
|
|
22235
22328
|
}).meta({ id: "EventMetadata" });
|
|
22236
22329
|
var Event = external_exports.object({
|
|
22237
22330
|
id: external_exports.guid(),
|
|
@@ -22341,6 +22434,15 @@ var RotateKeyInput = external_exports.object({
|
|
|
22341
22434
|
confirmation: external_exports.string()
|
|
22342
22435
|
});
|
|
22343
22436
|
|
|
22437
|
+
// ../../packages/schema/src/zod/finding-delivery.ts
|
|
22438
|
+
var KNOWN_REASONS = SyncFailureReason.options;
|
|
22439
|
+
|
|
22440
|
+
// ../../packages/schema/src/zod/findings-group-build.ts
|
|
22441
|
+
function rankByOrder(members2) {
|
|
22442
|
+
return Object.fromEntries(members2.map((member, index) => [member, index]));
|
|
22443
|
+
}
|
|
22444
|
+
var SEVERITY_RANK = rankByOrder(Severity.options);
|
|
22445
|
+
|
|
22344
22446
|
// ../../packages/schema/src/zod/installed-pack.ts
|
|
22345
22447
|
var InstalledPack = external_exports.object({
|
|
22346
22448
|
id: external_exports.guid(),
|
|
@@ -22407,6 +22509,11 @@ var Policy = external_exports.object({
|
|
|
22407
22509
|
// test `prohibitedModels` passes and `reversibleRuleIds` fails.
|
|
22408
22510
|
provenance: PolicyProvenance.optional()
|
|
22409
22511
|
}).meta({ id: "Policy" });
|
|
22512
|
+
var KNOWN_BUILTIN_IDS = ["monitor", "warn", "redact", "vault", "block"];
|
|
22513
|
+
var BuiltinPolicyId = external_exports.enum(KNOWN_BUILTIN_IDS).meta({ id: "BuiltinPolicyId" });
|
|
22514
|
+
var RedactFallback = BuiltinPolicyId.extract(["monitor", "warn", "block"]).meta({
|
|
22515
|
+
id: "RedactFallback"
|
|
22516
|
+
});
|
|
22410
22517
|
var PolicyBundle = external_exports.object({
|
|
22411
22518
|
version: external_exports.string(),
|
|
22412
22519
|
policies: external_exports.array(Policy),
|
|
@@ -22454,6 +22561,16 @@ var PolicyBundle = external_exports.object({
|
|
|
22454
22561
|
// control plane), so no name resolution stands between the decision and the
|
|
22455
22562
|
// comparison.
|
|
22456
22563
|
prohibitedModels: external_exports.array(external_exports.string()).optional(),
|
|
22564
|
+
// What a resolved `redact` becomes on a field the host cannot rewrite, as
|
|
22565
|
+
// the ORGANIZATION would have it. Merged raise-only against the device's own
|
|
22566
|
+
// `WorkspaceSettings.redactFallback` (see strongerRedactFallback below), so
|
|
22567
|
+
// a control plane can tighten a machine and never loosen one — the same
|
|
22568
|
+
// direction `mergeRaiseOnly` enforces for policies.
|
|
22569
|
+
//
|
|
22570
|
+
// Optional so an older backend, and an older on-disk cache, still parses;
|
|
22571
|
+
// absent leaves the device's own setting in force, which is the behaviour
|
|
22572
|
+
// that predates the field and the safe direction to default.
|
|
22573
|
+
redactFallback: RedactFallback.optional(),
|
|
22457
22574
|
customKeywords: external_exports.array(external_exports.string()),
|
|
22458
22575
|
fetchedAt: external_exports.iso.datetime()
|
|
22459
22576
|
}).meta({ id: "PolicyBundle" });
|
|
@@ -22483,11 +22600,6 @@ function severityFloorPolicy(category) {
|
|
|
22483
22600
|
const peak = CATEGORY_PEAK_SEVERITY[category];
|
|
22484
22601
|
return peak === "critical" || peak === "high" ? "warn" : "monitor";
|
|
22485
22602
|
}
|
|
22486
|
-
var KNOWN_BUILTIN_IDS = ["monitor", "warn", "redact", "vault", "block"];
|
|
22487
|
-
var BuiltinPolicyId = external_exports.enum(KNOWN_BUILTIN_IDS).meta({ id: "BuiltinPolicyId" });
|
|
22488
|
-
var RedactFallback = BuiltinPolicyId.extract(["monitor", "warn", "block"]).meta({
|
|
22489
|
-
id: "RedactFallback"
|
|
22490
|
-
});
|
|
22491
22603
|
var BUILTIN_POLICY_SPECS = {
|
|
22492
22604
|
monitor: {
|
|
22493
22605
|
name: "Monitor",
|
|
@@ -22750,7 +22862,7 @@ var VaultConsent = external_exports.object({
|
|
|
22750
22862
|
});
|
|
22751
22863
|
|
|
22752
22864
|
// ../../packages/schema/src/zod/local.ts
|
|
22753
|
-
var WORKSPACE_SETTINGS_SPEC_VERSION =
|
|
22865
|
+
var WORKSPACE_SETTINGS_SPEC_VERSION = 8;
|
|
22754
22866
|
var MODEL_JUDGE_PAYLOAD_VERSION = 1;
|
|
22755
22867
|
var RunMode = external_exports.enum(["standalone", "attached"]);
|
|
22756
22868
|
var ControlPlaneConnection = external_exports.object({
|
|
@@ -22770,6 +22882,15 @@ var HistorySyncConsent = external_exports.object({
|
|
|
22770
22882
|
payloadVersion: external_exports.number().int().positive(),
|
|
22771
22883
|
endpoint: external_exports.string()
|
|
22772
22884
|
});
|
|
22885
|
+
var BODY_RETENTION_DEFAULT_DAYS = 30;
|
|
22886
|
+
var BodyRetention = external_exports.object({
|
|
22887
|
+
enabled: external_exports.boolean().default(false),
|
|
22888
|
+
// Never 0, and the ceiling is a fat-finger guard rather than a policy
|
|
22889
|
+
// limit — `enabled` is the real gate. A low value cannot reach a row the
|
|
22890
|
+
// sync ledger still owes: the sweep's age filter only ever NARROWS a
|
|
22891
|
+
// candidate set that is already bounded by "delivered, or never owed".
|
|
22892
|
+
retainDays: external_exports.number().int().min(1).max(3650).default(BODY_RETENTION_DEFAULT_DAYS)
|
|
22893
|
+
}).meta({ id: "BodyRetention" });
|
|
22773
22894
|
var WorkspaceSettings = external_exports.object({
|
|
22774
22895
|
specVersion: external_exports.number().int().positive().default(WORKSPACE_SETTINGS_SPEC_VERSION),
|
|
22775
22896
|
runMode: RunMode.default("standalone"),
|
|
@@ -22818,7 +22939,13 @@ var WorkspaceSettings = external_exports.object({
|
|
|
22818
22939
|
// carry prompt/reply/tool-output text in `content`; the key name predates
|
|
22819
22940
|
// both widenings. Absent until granted, and a grant for a different endpoint
|
|
22820
22941
|
// or an older payload no longer counts.
|
|
22821
|
-
historySyncConsent: HistorySyncConsent.optional()
|
|
22942
|
+
historySyncConsent: HistorySyncConsent.optional(),
|
|
22943
|
+
// Local body expiry (see BodyRetention). Off until switched on; expiring a
|
|
22944
|
+
// body never removes the row or its findings.
|
|
22945
|
+
bodyRetention: BodyRetention.default({
|
|
22946
|
+
enabled: false,
|
|
22947
|
+
retainDays: BODY_RETENTION_DEFAULT_DAYS
|
|
22948
|
+
})
|
|
22822
22949
|
});
|
|
22823
22950
|
function defaultWorkspaceSettings() {
|
|
22824
22951
|
return WorkspaceSettings.parse({});
|
|
@@ -22835,13 +22962,22 @@ var ManagedSettingKey = external_exports.enum([
|
|
|
22835
22962
|
"vaultInlineReveal",
|
|
22836
22963
|
"modelJudgeConsent",
|
|
22837
22964
|
"dataSharesInPlace",
|
|
22838
|
-
"redactFallback"
|
|
22965
|
+
"redactFallback",
|
|
22966
|
+
// Pins the toggle and the day count together — see BodyRetention on why the
|
|
22967
|
+
// two are one unit. An administrator mandating a window wants the count
|
|
22968
|
+
// enforced with it, not one a user can widen while the toggle stays on.
|
|
22969
|
+
"bodyRetention"
|
|
22839
22970
|
]).meta({ id: "ManagedSettingKey" });
|
|
22840
22971
|
function isManagedSettingKey(value) {
|
|
22841
22972
|
return ManagedSettingKey.safeParse(value).success;
|
|
22842
22973
|
}
|
|
22843
22974
|
var ManagedSettingsValues = external_exports.object({
|
|
22844
22975
|
runMode: external_exports.enum(["standalone", "attached"]).optional(),
|
|
22976
|
+
// `controlPlane` and `bodyRetention` are the two nested values, and both are
|
|
22977
|
+
// plain, non-strict objects: a key under either that this build does not know
|
|
22978
|
+
// is stripped and nothing reports it. The unknown-value split in
|
|
22979
|
+
// ManagedSettings below classifies top-level names only, so it stops at
|
|
22980
|
+
// these boundaries.
|
|
22845
22981
|
controlPlane: external_exports.object({
|
|
22846
22982
|
endpoint: external_exports.string().min(1),
|
|
22847
22983
|
label: external_exports.string().min(1).optional()
|
|
@@ -22852,7 +22988,8 @@ var ManagedSettingsValues = external_exports.object({
|
|
|
22852
22988
|
vaultInlineReveal: external_exports.enum(["masked", "full", "off"]).optional(),
|
|
22853
22989
|
modelJudgeConsent: external_exports.boolean().optional(),
|
|
22854
22990
|
dataSharesInPlace: external_exports.boolean().optional(),
|
|
22855
|
-
redactFallback: RedactFallback.optional()
|
|
22991
|
+
redactFallback: RedactFallback.optional(),
|
|
22992
|
+
bodyRetention: BodyRetention.optional()
|
|
22856
22993
|
}).meta({ id: "ManagedSettingsValues" });
|
|
22857
22994
|
var ManagedSettings = external_exports.object({
|
|
22858
22995
|
specVersion: external_exports.number().int().positive().default(MANAGED_SETTINGS_SPEC_VERSION),
|
|
@@ -22860,7 +22997,21 @@ var ManagedSettings = external_exports.object({
|
|
|
22860
22997
|
// decision from a bug. Absent renders as a generic "your organization".
|
|
22861
22998
|
organization: external_exports.string().min(1).optional(),
|
|
22862
22999
|
// What the administrator pinned.
|
|
22863
|
-
|
|
23000
|
+
//
|
|
23001
|
+
// Parsed as a RECORD rather than as the nested schema, and split below for
|
|
23002
|
+
// the same reason `lockedFields` is parsed as names: a plain `z.object`
|
|
23003
|
+
// drops an unrecognised key and succeeds, so a pin this build does not know
|
|
23004
|
+
// vanished and nothing anywhere said so. A pin with no lock is a supported
|
|
23005
|
+
// shape — it is a DEFAULT the user may still change — so that silence hit
|
|
23006
|
+
// exactly the file an administrator is most likely to write while a fleet
|
|
23007
|
+
// is mid-upgrade.
|
|
23008
|
+
//
|
|
23009
|
+
// Splitting here rather than calling `.strict()`: strict would REFUSE the
|
|
23010
|
+
// file, which is the outcome the lock half already rejected — an older
|
|
23011
|
+
// build then runs entirely unmanaged, every pin and lock gone. A bad KNOWN
|
|
23012
|
+
// value still fails, because the nested schema is re-run over the known
|
|
23013
|
+
// subset and its issues are re-raised on this parse.
|
|
23014
|
+
values: external_exports.record(external_exports.string(), external_exports.unknown()).default({}),
|
|
22864
23015
|
// Which of those the user may not change. A key here with no matching value
|
|
22865
23016
|
// freezes whatever the user last chose; a value with no lock is a DEFAULT
|
|
22866
23017
|
// the user may still override. The two are separable on purpose.
|
|
@@ -22873,17 +23024,31 @@ var ManagedSettings = external_exports.object({
|
|
|
22873
23024
|
// the fleets most likely to carry a version skew. A name outside the enum
|
|
22874
23025
|
// is still never HONOURED: the lockable set stays explicit above.
|
|
22875
23026
|
lockedFields: external_exports.array(external_exports.string()).default([])
|
|
22876
|
-
}).transform(({ lockedFields, ...rest }) => {
|
|
23027
|
+
}).transform(({ lockedFields, values, ...rest }, ctx) => {
|
|
22877
23028
|
const known = [];
|
|
22878
23029
|
const unknown2 = [];
|
|
22879
23030
|
for (const name of lockedFields) {
|
|
22880
23031
|
if (isManagedSettingKey(name)) known.push(name);
|
|
22881
23032
|
else unknown2.push(name);
|
|
22882
23033
|
}
|
|
23034
|
+
const knownValues = /* @__PURE__ */ Object.create(null);
|
|
23035
|
+
const unknownValues = [];
|
|
23036
|
+
for (const [name, value] of Object.entries(values)) {
|
|
23037
|
+
if (Object.hasOwn(ManagedSettingsValues.shape, name)) knownValues[name] = value;
|
|
23038
|
+
else unknownValues.push(name);
|
|
23039
|
+
}
|
|
23040
|
+
const pinned = ManagedSettingsValues.safeParse(knownValues);
|
|
23041
|
+
if (!pinned.success) {
|
|
23042
|
+
for (const issue2 of pinned.error.issues)
|
|
23043
|
+
ctx.addIssue({ ...issue2, path: ["values", ...issue2.path] });
|
|
23044
|
+
return external_exports.NEVER;
|
|
23045
|
+
}
|
|
22883
23046
|
return {
|
|
22884
23047
|
...rest,
|
|
23048
|
+
values: pinned.data,
|
|
22885
23049
|
lockedFields: known,
|
|
22886
|
-
...unknown2.length > 0 ? { unknownLockedFields: unknown2 } : {}
|
|
23050
|
+
...unknown2.length > 0 ? { unknownLockedFields: unknown2 } : {},
|
|
23051
|
+
...unknownValues.length > 0 ? { unknownValueFields: unknownValues } : {}
|
|
22887
23052
|
};
|
|
22888
23053
|
}).meta({ id: "ManagedSettings" });
|
|
22889
23054
|
|
|
@@ -23141,7 +23306,23 @@ var SaveSettingsInput = external_exports.object({
|
|
|
23141
23306
|
modelJudgeConsent: ModelJudgeConsentChoice,
|
|
23142
23307
|
historySyncConsent: HistorySyncConsentChoice,
|
|
23143
23308
|
vaultConsent: external_exports.string(),
|
|
23144
|
-
vaultInlineReveal: external_exports.string()
|
|
23309
|
+
vaultInlineReveal: external_exports.string(),
|
|
23310
|
+
// Widened to `string` like its neighbours rather than typed as
|
|
23311
|
+
// `RedactFallback`, on this module's own layering rule: shape here, VALUE at
|
|
23312
|
+
// the call site, so the domain check receives the type it was written for.
|
|
23313
|
+
//
|
|
23314
|
+
// NOT because a narrower schema would reject differently. `parseActionInput`
|
|
23315
|
+
// is a `safeParse` wrapper and throws for no field schema, so either spelling
|
|
23316
|
+
// reaches a recoverable `{ ok: false }` and there is no rejected promise to
|
|
23317
|
+
// trade against. The real cost runs the other way and is the part worth
|
|
23318
|
+
// knowing: a value this schema admits and the domain enum then rejects lands
|
|
23319
|
+
// on the action's shared refusal, which names NO field, where a shape
|
|
23320
|
+
// rejection reaches `malformedInput` and names the schema key.
|
|
23321
|
+
redactFallback: external_exports.string(),
|
|
23322
|
+
// Shape only, the way the enum fields above are strings only: the RANGE is
|
|
23323
|
+
// `BodyRetention`'s and the action checks it there, so there is one place
|
|
23324
|
+
// that decides what a legal horizon is rather than two that can drift.
|
|
23325
|
+
bodyRetention: external_exports.object({ enabled: external_exports.boolean(), retainDays: external_exports.number() })
|
|
23145
23326
|
});
|
|
23146
23327
|
var AttachInput = external_exports.object({
|
|
23147
23328
|
endpoint: external_exports.string(),
|
|
@@ -23267,6 +23448,52 @@ var SetupHandoffOffer = external_exports.object({
|
|
|
23267
23448
|
path: ["liveKeys"]
|
|
23268
23449
|
});
|
|
23269
23450
|
|
|
23451
|
+
// ../../packages/schema/src/zod/web-capture.ts
|
|
23452
|
+
var WebUsageSource = external_exports.enum(["site", "estimated", "none"]);
|
|
23453
|
+
var WebUsage = external_exports.object({
|
|
23454
|
+
inputTokens: external_exports.number().int().nonnegative().optional(),
|
|
23455
|
+
outputTokens: external_exports.number().int().nonnegative().optional(),
|
|
23456
|
+
cacheReadInputTokens: external_exports.number().int().nonnegative().optional(),
|
|
23457
|
+
cacheCreationInputTokens: external_exports.number().int().nonnegative().optional()
|
|
23458
|
+
});
|
|
23459
|
+
var WebToolCall = external_exports.object({
|
|
23460
|
+
toolUseId: external_exports.string().min(1),
|
|
23461
|
+
toolName: external_exports.string().min(1),
|
|
23462
|
+
target: external_exports.string().optional(),
|
|
23463
|
+
isError: external_exports.boolean().optional(),
|
|
23464
|
+
inputSize: external_exports.number().int().nonnegative().optional(),
|
|
23465
|
+
outputSize: external_exports.number().int().nonnegative().optional()
|
|
23466
|
+
});
|
|
23467
|
+
var WebExchange = external_exports.object({
|
|
23468
|
+
messageId: external_exports.string().min(1),
|
|
23469
|
+
startedAt: external_exports.iso.datetime(),
|
|
23470
|
+
model: external_exports.string().optional(),
|
|
23471
|
+
usage: WebUsage.optional(),
|
|
23472
|
+
usageSource: WebUsageSource,
|
|
23473
|
+
stopReason: external_exports.string().optional(),
|
|
23474
|
+
conversationId: external_exports.string().optional(),
|
|
23475
|
+
turnIndex: external_exports.number().int().nonnegative().optional(),
|
|
23476
|
+
toolCalls: external_exports.array(WebToolCall).default([]),
|
|
23477
|
+
// Absent when the adapter recovered no text. Capped by the caller at
|
|
23478
|
+
// RESPONSE_TEXT_MAX_BYTES; `truncated` records that the cap was reached, so a
|
|
23479
|
+
// short capture is never mistaken for a short reply.
|
|
23480
|
+
responseText: external_exports.string().optional(),
|
|
23481
|
+
truncated: external_exports.boolean().default(false)
|
|
23482
|
+
});
|
|
23483
|
+
var RESPONSE_TEXT_MAX_BYTES = 2 * 1024 * 1024;
|
|
23484
|
+
var WebCaptureStatus = external_exports.object({
|
|
23485
|
+
patched: external_exports.boolean(),
|
|
23486
|
+
live: external_exports.boolean(),
|
|
23487
|
+
blind: external_exports.boolean(),
|
|
23488
|
+
sendsSeenDom: external_exports.number().int().nonnegative(),
|
|
23489
|
+
exchangesSeenNet: external_exports.number().int().nonnegative(),
|
|
23490
|
+
parseFailures: external_exports.number().int().nonnegative(),
|
|
23491
|
+
unparsedBodies: external_exports.number().int().nonnegative(),
|
|
23492
|
+
// The adapter-declared JSON key paths that were absent from a real payload —
|
|
23493
|
+
// the earliest signal that a site's contract moved.
|
|
23494
|
+
shapeMisses: external_exports.array(external_exports.string()).default([])
|
|
23495
|
+
});
|
|
23496
|
+
|
|
23270
23497
|
// ../../packages/persistence/src/paths.ts
|
|
23271
23498
|
import {
|
|
23272
23499
|
chmodSync,
|
|
@@ -23324,6 +23551,32 @@ var STALE_PARTIAL_MS = 5 * 6e4;
|
|
|
23324
23551
|
var SNAPSHOT_STAGING_SUFFIX = ".partial";
|
|
23325
23552
|
var STAGED_NAME_SUFFIX = `.bak${SNAPSHOT_STAGING_SUFFIX}`;
|
|
23326
23553
|
|
|
23554
|
+
// ../../packages/persistence/src/internal/sql-functions.ts
|
|
23555
|
+
var utf8 = new TextDecoder();
|
|
23556
|
+
|
|
23557
|
+
// ../../packages/persistence/src/internal/outbox-lane.ts
|
|
23558
|
+
var OUTBOX_CAPTURE_EVENT_TYPES = ["prompt", "response", "tool_use"];
|
|
23559
|
+
var OUTBOX_CAPTURE_TYPE_LIST = OUTBOX_CAPTURE_EVENT_TYPES.map((t) => `'${t}'`).join(", ");
|
|
23560
|
+
|
|
23561
|
+
// ../../packages/persistence/src/sync-failure.ts
|
|
23562
|
+
var SYNC_FAILURE_REASONS = SyncFailureReason.options;
|
|
23563
|
+
|
|
23564
|
+
// ../../packages/persistence/src/repositories/history-sync.ts
|
|
23565
|
+
var STRUCTURAL_EVENT_TYPES = ["session", "llm_call", "tool_call"];
|
|
23566
|
+
var TYPE_LIST = STRUCTURAL_EVENT_TYPES.map((t) => `'${t}'`).join(", ");
|
|
23567
|
+
var COUNTED_EVENT_TYPES = [
|
|
23568
|
+
...STRUCTURAL_EVENT_TYPES,
|
|
23569
|
+
...OUTBOX_CAPTURE_EVENT_TYPES
|
|
23570
|
+
];
|
|
23571
|
+
var COUNTED_TYPE_LIST = COUNTED_EVENT_TYPES.map((t) => `'${t}'`).join(", ");
|
|
23572
|
+
var COUNTED_SCOPE = `
|
|
23573
|
+
WHERE event_type IN (${COUNTED_TYPE_LIST})
|
|
23574
|
+
AND (
|
|
23575
|
+
event_type IN (${TYPE_LIST})
|
|
23576
|
+
OR synced_at IS NOT NULL
|
|
23577
|
+
OR outbox_owed = 1
|
|
23578
|
+
)`;
|
|
23579
|
+
|
|
23327
23580
|
// ../../packages/persistence/src/internal/json.ts
|
|
23328
23581
|
function parseJsonObject(s) {
|
|
23329
23582
|
if (s == null) return void 0;
|
|
@@ -23388,13 +23641,10 @@ var FINDING_ROW_COLUMNS_SQL = `f.id AS id, d.rule_id AS rule_id, d.category AS c
|
|
|
23388
23641
|
e.tool_name AS tool_name,
|
|
23389
23642
|
f.audit_event_id AS event_id, e.root_session_id AS session_id,
|
|
23390
23643
|
e.event_type AS kind, f.finding_key AS finding_key,
|
|
23391
|
-
${latestResolutionStatusSql("f")} AS latest_status
|
|
23392
|
-
|
|
23393
|
-
|
|
23394
|
-
|
|
23395
|
-
var TYPE_LIST = STRUCTURAL_EVENT_TYPES.map((t) => `'${t}'`).join(", ");
|
|
23396
|
-
var OUTBOX_CAPTURE_EVENT_TYPES = ["prompt", "response", "tool_use"];
|
|
23397
|
-
var CAPTURE_TYPE_LIST = OUTBOX_CAPTURE_EVENT_TYPES.map((t) => `'${t}'`).join(", ");
|
|
23644
|
+
${latestResolutionStatusSql("f")} AS latest_status,
|
|
23645
|
+
e.synced_at AS synced_at, e.sync_claimed_at AS sync_claimed_at,
|
|
23646
|
+
e.sync_failed_at AS sync_failed_at, e.sync_failure AS sync_failure,
|
|
23647
|
+
e.outbox_owed AS outbox_owed`;
|
|
23398
23648
|
|
|
23399
23649
|
// ../../packages/persistence/src/repositories/installed-packs.ts
|
|
23400
23650
|
import { createHash as createHash2, randomUUID as randomUUID4 } from "crypto";
|
|
@@ -23511,6 +23761,7 @@ function overlayManagedSettings(settings, managed, now = () => /* @__PURE__ */ n
|
|
|
23511
23761
|
if (values.vaultInlineReveal !== void 0) merged.vaultInlineReveal = values.vaultInlineReveal;
|
|
23512
23762
|
if (values.dataSharesInPlace !== void 0) merged.dataSharesInPlace = values.dataSharesInPlace;
|
|
23513
23763
|
if (values.redactFallback !== void 0) merged.redactFallback = values.redactFallback;
|
|
23764
|
+
if (values.bodyRetention !== void 0) merged.bodyRetention = values.bodyRetention;
|
|
23514
23765
|
if (values.vaultConsent !== void 0) {
|
|
23515
23766
|
merged.vaultConsent = values.vaultConsent ? (
|
|
23516
23767
|
// Keep an existing valid grant so its acknowledgedAt survives; mint one
|
|
@@ -23598,9 +23849,11 @@ import { randomUUID as randomUUID10 } from "crypto";
|
|
|
23598
23849
|
|
|
23599
23850
|
// ../../packages/persistence/src/database.ts
|
|
23600
23851
|
var CAPTURE_GRAIN = new Set(EventKind.options);
|
|
23852
|
+
var DEFERRED_TAGS = new Set(DEFERRED_MIGRATION_TAGS);
|
|
23601
23853
|
|
|
23602
23854
|
// ../../packages/persistence/src/egress-wire.ts
|
|
23603
23855
|
import { createHash as createHash3 } from "crypto";
|
|
23856
|
+
var SLASH = "/".charCodeAt(0);
|
|
23604
23857
|
|
|
23605
23858
|
// ../../packages/persistence/src/finding-key.ts
|
|
23606
23859
|
import { createHash as createHash4 } from "crypto";
|
|
@@ -23611,18 +23864,26 @@ import { existsSync as existsSync3, readFileSync as readFileSync6 } from "fs";
|
|
|
23611
23864
|
import { join as join8 } from "path";
|
|
23612
23865
|
import { DatabaseSync as DatabaseSync2 } from "node:sqlite";
|
|
23613
23866
|
|
|
23867
|
+
// ../../packages/persistence/src/forward-health.ts
|
|
23868
|
+
import { readFileSync as readFileSync7 } from "fs";
|
|
23869
|
+
import { join as join9 } from "path";
|
|
23870
|
+
|
|
23614
23871
|
// ../../packages/persistence/src/history-backfill.ts
|
|
23615
23872
|
import { existsSync as existsSync4 } from "fs";
|
|
23616
|
-
import { join as
|
|
23873
|
+
import { join as join10 } from "path";
|
|
23617
23874
|
|
|
23618
23875
|
// ../../packages/persistence/src/history-preview.ts
|
|
23619
23876
|
import { existsSync as existsSync5 } from "fs";
|
|
23620
|
-
import { join as
|
|
23877
|
+
import { join as join11 } from "path";
|
|
23621
23878
|
import { DatabaseSync as DatabaseSync3 } from "node:sqlite";
|
|
23622
23879
|
|
|
23880
|
+
// ../../packages/persistence/src/history-sync-state.ts
|
|
23881
|
+
import { readFileSync as readFileSync8 } from "fs";
|
|
23882
|
+
import { join as join12 } from "path";
|
|
23883
|
+
|
|
23623
23884
|
// ../../packages/persistence/src/store-symlinks.ts
|
|
23624
23885
|
import { existsSync as existsSync6, lstatSync as lstatSync3, readlinkSync, realpathSync, statSync as statSync4 } from "fs";
|
|
23625
|
-
import { dirname as dirname3, join as
|
|
23886
|
+
import { dirname as dirname3, join as join13, resolve } from "path";
|
|
23626
23887
|
var STORE_DB = "the store database (including the prompt corpus)";
|
|
23627
23888
|
var STORE_SETTINGS = "your settings file";
|
|
23628
23889
|
function storeContents(home) {
|
|
@@ -23631,7 +23892,7 @@ function storeContents(home) {
|
|
|
23631
23892
|
[settingsDir(home), STORE_SETTINGS],
|
|
23632
23893
|
[dataDir(home), STORE_DB],
|
|
23633
23894
|
[keysDir(home), "the vault key"],
|
|
23634
|
-
[
|
|
23895
|
+
[join13(settingsDir(home), "settings.json"), STORE_SETTINGS],
|
|
23635
23896
|
[dbPath(home), STORE_DB]
|
|
23636
23897
|
]);
|
|
23637
23898
|
}
|
|
@@ -23683,15 +23944,15 @@ import {
|
|
|
23683
23944
|
// ../../packages/persistence/src/vault/key-provider.ts
|
|
23684
23945
|
import { execFileSync } from "child_process";
|
|
23685
23946
|
import { randomBytes as randomBytes2 } from "crypto";
|
|
23686
|
-
import { chmodSync as chmodSync3, readFileSync as
|
|
23687
|
-
import { join as
|
|
23947
|
+
import { chmodSync as chmodSync3, readFileSync as readFileSync9, renameSync as renameSync4, rmSync as rmSync6, statSync as statSync5, writeFileSync as writeFileSync3 } from "fs";
|
|
23948
|
+
import { join as join14 } from "path";
|
|
23688
23949
|
|
|
23689
23950
|
// ../../packages/persistence/src/vault/vault.ts
|
|
23690
23951
|
import { randomBytes as randomBytes3, randomUUID as randomUUID12 } from "crypto";
|
|
23691
23952
|
|
|
23692
23953
|
// ../../packages/persistence/src/warn-era-cap.ts
|
|
23693
23954
|
import { existsSync as existsSync7, writeFileSync as writeFileSync4 } from "fs";
|
|
23694
|
-
import { join as
|
|
23955
|
+
import { join as join15 } from "path";
|
|
23695
23956
|
|
|
23696
23957
|
// ../../packages/plugin-sdk/src/provider-env.ts
|
|
23697
23958
|
var DEFAULT_ANTHROPIC_HOST = "api.anthropic.com";
|
|
@@ -23745,7 +24006,7 @@ function resolveProvider() {
|
|
|
23745
24006
|
function loadConfig(base = defaultDataDir(), resolveProviderFn = resolveProvider) {
|
|
23746
24007
|
try {
|
|
23747
24008
|
ensureLayoutDirSync(base);
|
|
23748
|
-
const settingsFile =
|
|
24009
|
+
const settingsFile = join16(settingsDir(base), "settings.json");
|
|
23749
24010
|
if (existsSync8(settingsFile)) tightenFile(settingsFile);
|
|
23750
24011
|
} catch {
|
|
23751
24012
|
}
|
|
@@ -23769,9 +24030,9 @@ function resolveProviderSafe(resolveProviderFn) {
|
|
|
23769
24030
|
}
|
|
23770
24031
|
|
|
23771
24032
|
// ../../packages/plugin-sdk/src/config-inventory.ts
|
|
23772
|
-
import { readdirSync as readdirSync2, readFileSync as
|
|
24033
|
+
import { readdirSync as readdirSync2, readFileSync as readFileSync11, realpathSync as realpathSync2, statSync as statSync7 } from "fs";
|
|
23773
24034
|
import { homedir as homedir2 } from "os";
|
|
23774
|
-
import { basename as basename3, join as
|
|
24035
|
+
import { basename as basename3, join as join18 } from "path";
|
|
23775
24036
|
|
|
23776
24037
|
// ../../packages/detections/src/egress/registry.ts
|
|
23777
24038
|
var EXTRACTOR_VERSION = "1";
|
|
@@ -24529,8 +24790,8 @@ var CPU_CORROBORATION_SHARE = 0.2;
|
|
|
24529
24790
|
var CORROBORATION_FLOOR_MS = BUDGET_MS * CPU_CORROBORATION_SHARE;
|
|
24530
24791
|
|
|
24531
24792
|
// ../../packages/plugin-sdk/src/repo.ts
|
|
24532
|
-
import { existsSync as existsSync9, readFileSync as
|
|
24533
|
-
import { basename as basename2, dirname as dirname4, isAbsolute, join as
|
|
24793
|
+
import { existsSync as existsSync9, readFileSync as readFileSync10, statSync as statSync6 } from "fs";
|
|
24794
|
+
import { basename as basename2, dirname as dirname4, isAbsolute, join as join17, sep as sep2 } from "path";
|
|
24534
24795
|
|
|
24535
24796
|
// ../../packages/plugin-sdk/src/events.ts
|
|
24536
24797
|
import { createHash as createHash5, randomUUID as randomUUID13 } from "crypto";
|
|
@@ -24541,8 +24802,8 @@ import { fileURLToPath } from "url";
|
|
|
24541
24802
|
import { Worker } from "worker_threads";
|
|
24542
24803
|
|
|
24543
24804
|
// ../../packages/plugin-sdk/src/host-floor.ts
|
|
24544
|
-
import { readFileSync as
|
|
24545
|
-
import { join as
|
|
24805
|
+
import { readFileSync as readFileSync13 } from "fs";
|
|
24806
|
+
import { join as join20 } from "path";
|
|
24546
24807
|
|
|
24547
24808
|
// ../../packages/plugin-sdk/src/model-governance.ts
|
|
24548
24809
|
import {
|
|
@@ -24550,18 +24811,18 @@ import {
|
|
|
24550
24811
|
fstatSync,
|
|
24551
24812
|
mkdirSync as mkdirSync2,
|
|
24552
24813
|
openSync as openSync2,
|
|
24553
|
-
readFileSync as
|
|
24814
|
+
readFileSync as readFileSync12,
|
|
24554
24815
|
readSync,
|
|
24555
24816
|
writeFileSync as writeFileSync5
|
|
24556
24817
|
} from "fs";
|
|
24557
|
-
import { join as
|
|
24818
|
+
import { join as join19 } from "path";
|
|
24558
24819
|
var SESSION_MODEL_MARKER = "session-model";
|
|
24559
24820
|
function recordSessionModel(dataDir2, sessionId, model) {
|
|
24560
24821
|
if (sessionId === void 0 || sessionId === "") return;
|
|
24561
24822
|
if (model === void 0 || model === "") return;
|
|
24562
24823
|
try {
|
|
24563
24824
|
mkdirSync2(dataDir2, { recursive: true, mode: DATA_DIR_MODE });
|
|
24564
|
-
writeFileSync5(
|
|
24825
|
+
writeFileSync5(join19(dataDir2, SESSION_MODEL_MARKER), JSON.stringify({ sessionId, model }), {
|
|
24565
24826
|
encoding: "utf8",
|
|
24566
24827
|
mode: DATA_FILE_MODE
|
|
24567
24828
|
});
|
|
@@ -24590,15 +24851,15 @@ var HOST_FLOORS = {
|
|
|
24590
24851
|
|
|
24591
24852
|
// ../../packages/plugin-sdk/src/ignore-layers.ts
|
|
24592
24853
|
var import_ignore = __toESM(require_ignore(), 1);
|
|
24593
|
-
import { readFileSync as
|
|
24594
|
-
import { join as
|
|
24854
|
+
import { readFileSync as readFileSync14 } from "fs";
|
|
24855
|
+
import { join as join21 } from "path";
|
|
24595
24856
|
|
|
24596
24857
|
// ../../packages/plugin-sdk/src/inventory-resolver.ts
|
|
24597
24858
|
import { arch, hostname as hostname4, platform, release } from "os";
|
|
24598
24859
|
|
|
24599
24860
|
// ../../packages/plugin-sdk/src/nudge.ts
|
|
24600
|
-
import { mkdirSync as mkdirSync3, readFileSync as
|
|
24601
|
-
import { join as
|
|
24861
|
+
import { mkdirSync as mkdirSync3, readFileSync as readFileSync15, writeFileSync as writeFileSync6 } from "fs";
|
|
24862
|
+
import { join as join22 } from "path";
|
|
24602
24863
|
|
|
24603
24864
|
// ../../packages/plugin-sdk/src/paths.ts
|
|
24604
24865
|
import { readdirSync as readdirSync3, realpathSync as realpathSync3 } from "fs";
|
|
@@ -24606,7 +24867,7 @@ import { basename as basename4, dirname as dirname5, sep as sep3 } from "path";
|
|
|
24606
24867
|
|
|
24607
24868
|
// ../../packages/plugin-sdk/src/project-files.ts
|
|
24608
24869
|
import { existsSync as existsSync11, readdirSync as readdirSync4 } from "fs";
|
|
24609
|
-
import { basename as basename5, join as
|
|
24870
|
+
import { basename as basename5, join as join23 } from "path";
|
|
24610
24871
|
|
|
24611
24872
|
// ../../packages/plugin-sdk/src/provider-env-antigravity.ts
|
|
24612
24873
|
var optionalBaseUrl2 = external_exports.preprocess((v) => {
|
|
@@ -24642,16 +24903,16 @@ var THIRTY_DAYS_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
|
24642
24903
|
|
|
24643
24904
|
// ../../packages/plugin-sdk/src/throttle.ts
|
|
24644
24905
|
import { mkdirSync as mkdirSync4, statSync as statSync8, writeFileSync as writeFileSync7 } from "fs";
|
|
24645
|
-
import { join as
|
|
24906
|
+
import { join as join24 } from "path";
|
|
24646
24907
|
|
|
24647
24908
|
// src/hooks/model-switch-run.ts
|
|
24648
24909
|
import { randomUUID as randomUUID16 } from "crypto";
|
|
24649
24910
|
|
|
24650
24911
|
// src/hooks/model-guard.ts
|
|
24651
24912
|
import { randomUUID as randomUUID15 } from "crypto";
|
|
24652
|
-
import { readFileSync as
|
|
24913
|
+
import { readFileSync as readFileSync16, statSync as statSync9 } from "fs";
|
|
24653
24914
|
import { homedir as homedir3 } from "os";
|
|
24654
|
-
import { dirname as dirname6, join as
|
|
24915
|
+
import { dirname as dirname6, join as join25 } from "path";
|
|
24655
24916
|
|
|
24656
24917
|
// src/hooks/model-switch-run.ts
|
|
24657
24918
|
function runPostModelSwitch(sessionId, toModel, deps) {
|
|
@@ -24697,7 +24958,7 @@ function getString(record2, key) {
|
|
|
24697
24958
|
|
|
24698
24959
|
// src/hooks/store-health.ts
|
|
24699
24960
|
import { mkdirSync as mkdirSync5, readFileSync as readFileSync20, writeFileSync as writeFileSync8 } from "fs";
|
|
24700
|
-
import { dirname as dirname7, join as
|
|
24961
|
+
import { dirname as dirname7, join as join31 } from "path";
|
|
24701
24962
|
|
|
24702
24963
|
// ../../packages/remote/src/http.ts
|
|
24703
24964
|
import { request as httpRequest } from "http";
|
|
@@ -24705,21 +24966,16 @@ import { request as httpsRequest } from "https";
|
|
|
24705
24966
|
var MAX_RESPONSE_BYTES = 8 * 1024 * 1024;
|
|
24706
24967
|
|
|
24707
24968
|
// ../../packages/remote/src/client.ts
|
|
24708
|
-
var
|
|
24969
|
+
var SLASH2 = "/".charCodeAt(0);
|
|
24709
24970
|
|
|
24710
24971
|
// ../../packages/plugin-runtime/src/attached/forward-drops.ts
|
|
24711
|
-
import { readFileSync as
|
|
24712
|
-
import { join as
|
|
24972
|
+
import { readFileSync as readFileSync17 } from "fs";
|
|
24973
|
+
import { join as join26 } from "path";
|
|
24713
24974
|
|
|
24714
24975
|
// ../../packages/plugin-runtime/src/attached/forward-policy.ts
|
|
24715
24976
|
import { randomUUID as randomUUID17 } from "crypto";
|
|
24716
|
-
import { readFileSync as readFileSync16 } from "fs";
|
|
24717
24977
|
import { readFile, rename, writeFile } from "fs/promises";
|
|
24718
|
-
import { join as
|
|
24719
|
-
|
|
24720
|
-
// ../../packages/plugin-runtime/src/attached/history-state.ts
|
|
24721
|
-
import { readFileSync as readFileSync17 } from "fs";
|
|
24722
|
-
import { join as join26 } from "path";
|
|
24978
|
+
import { join as join27 } from "path";
|
|
24723
24979
|
|
|
24724
24980
|
// ../../packages/plugin-runtime/src/attached/history-sync.ts
|
|
24725
24981
|
import { createHash as createHash6 } from "crypto";
|
|
@@ -24729,6 +24985,10 @@ import { hostname as hostname5 } from "os";
|
|
|
24729
24985
|
var CORRELATION_ID = EventMetadata.shape.correlationId;
|
|
24730
24986
|
var TRACE_ID = EventMetadata.shape.traceId;
|
|
24731
24987
|
var EXCEPTION_ID = EventMetadata.shape.exceptionIds.unwrap().element;
|
|
24988
|
+
var REDACT_DEGRADED_TO = EventMetadata.shape.redactDegradedTo.unwrap();
|
|
24989
|
+
|
|
24990
|
+
// ../../packages/plugin-runtime/src/attached/history-sync.ts
|
|
24991
|
+
var CAPTURE_BATCH_BYTES = 1024 * 1024;
|
|
24732
24992
|
|
|
24733
24993
|
// ../../packages/plugin-runtime/src/attached/history-sync-trigger.ts
|
|
24734
24994
|
import { spawn } from "child_process";
|
|
@@ -24741,7 +25001,7 @@ import { readFileSync as readFileSync18 } from "fs";
|
|
|
24741
25001
|
// ../../packages/plugin-runtime/src/attached/policy-store.ts
|
|
24742
25002
|
import { randomUUID as randomUUID18 } from "crypto";
|
|
24743
25003
|
import { readFile as readFile2, rm, writeFile as writeFile2 } from "fs/promises";
|
|
24744
|
-
import { join as
|
|
25004
|
+
import { join as join28 } from "path";
|
|
24745
25005
|
|
|
24746
25006
|
// ../../packages/plugin-runtime/src/attached/atomic-publish.ts
|
|
24747
25007
|
import { rename as rename2 } from "fs/promises";
|
|
@@ -24756,11 +25016,11 @@ import { DatabaseSync as DatabaseSync4 } from "node:sqlite";
|
|
|
24756
25016
|
// ../../packages/plugin-runtime/src/attached/posture-store.ts
|
|
24757
25017
|
import { randomUUID as randomUUID19 } from "crypto";
|
|
24758
25018
|
import { readFile as readFile3, rm as rm2, writeFile as writeFile3 } from "fs/promises";
|
|
24759
|
-
import { join as
|
|
25019
|
+
import { join as join29 } from "path";
|
|
24760
25020
|
|
|
24761
25021
|
// ../../packages/plugin-runtime/src/attached/sync-state.ts
|
|
24762
25022
|
import { readFileSync as readFileSync19 } from "fs";
|
|
24763
|
-
import { join as
|
|
25023
|
+
import { join as join30 } from "path";
|
|
24764
25024
|
|
|
24765
25025
|
// ../../packages/plugin-runtime/src/attached/status.ts
|
|
24766
25026
|
var REFUSAL_LINES = {
|
|
@@ -24781,6 +25041,14 @@ import { spawn as spawn2 } from "child_process";
|
|
|
24781
25041
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
24782
25042
|
var SYNC_THROTTLE_MS = 15 * 60 * 1e3;
|
|
24783
25043
|
|
|
25044
|
+
// ../../packages/plugin-runtime/src/content-retention-pass.ts
|
|
25045
|
+
var MAX_ROWS_PER_SWEEP = 50 * 1e3;
|
|
25046
|
+
|
|
25047
|
+
// ../../packages/plugin-runtime/src/content-retention-trigger.ts
|
|
25048
|
+
import { spawn as spawn3 } from "child_process";
|
|
25049
|
+
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
25050
|
+
var CONTENT_RETENTION_THROTTLE_MS = 60 * 60 * 1e3;
|
|
25051
|
+
|
|
24784
25052
|
// ../../packages/plugin-runtime/src/attached/factory.ts
|
|
24785
25053
|
import { hostname as hostname6 } from "os";
|
|
24786
25054
|
|
|
@@ -24799,7 +25067,7 @@ function markerDirs(dataDir2) {
|
|
|
24799
25067
|
function alreadyClaimed(dirs, marker, sessionId) {
|
|
24800
25068
|
return dirs.some((dir) => {
|
|
24801
25069
|
try {
|
|
24802
|
-
return readFileSync20(
|
|
25070
|
+
return readFileSync20(join31(dir, marker), "utf8") === sessionId;
|
|
24803
25071
|
} catch {
|
|
24804
25072
|
return false;
|
|
24805
25073
|
}
|
|
@@ -24809,7 +25077,7 @@ function recordClaim(dirs, marker, sessionId) {
|
|
|
24809
25077
|
for (const dir of dirs) {
|
|
24810
25078
|
try {
|
|
24811
25079
|
mkdirSync5(dir, { recursive: true, mode: DATA_DIR_MODE });
|
|
24812
|
-
writeFileSync8(
|
|
25080
|
+
writeFileSync8(join31(dir, marker), sessionId, { mode: DATA_FILE_MODE });
|
|
24813
25081
|
return;
|
|
24814
25082
|
} catch {
|
|
24815
25083
|
}
|