@akasecurity/ai-tc-antigravity 0.9.6 → 0.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -4
- package/plugin.json +1 -1
- package/scripts/apply-suppressions.js +1432 -976
- package/scripts/backfill.js +1429 -989
- package/scripts/dashboard.js +131 -10
- package/scripts/filescan.js +1458 -1009
- package/scripts/firstrun.js +1310 -904
- package/scripts/intro.js +1002 -896
- package/scripts/onboard.js +1333 -893
- package/scripts/post-tool-use.js +1069 -898
- package/scripts/pre-invocation.js +1430 -998
- package/scripts/pre-tool-use.js +1413 -978
- package/scripts/query.js +1315 -904
- package/scripts/reconcile.js +1320 -923
- package/scripts/remediate.js +1429 -989
- package/scripts/scan-worker.js +996 -916
- package/scripts/start-light.js +1009 -904
- package/scripts/stop.js +1069 -898
- package/skills/setup/SKILL.md +22 -16
package/scripts/intro.js
CHANGED
|
@@ -492,7 +492,7 @@ var require_ignore = __commonJS({
|
|
|
492
492
|
});
|
|
493
493
|
|
|
494
494
|
// src/intro.ts
|
|
495
|
-
import { readFileSync as
|
|
495
|
+
import { readFileSync as readFileSync12 } from "fs";
|
|
496
496
|
|
|
497
497
|
// src/present.ts
|
|
498
498
|
var SHADE = {
|
|
@@ -15126,6 +15126,47 @@ function date4(params) {
|
|
|
15126
15126
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
15127
15127
|
config(en_default());
|
|
15128
15128
|
|
|
15129
|
+
// ../../packages/schema/src/zod/harness-map.ts
|
|
15130
|
+
var HARNESS = {
|
|
15131
|
+
ClaudeCode: "claudecode",
|
|
15132
|
+
Cursor: "cursor",
|
|
15133
|
+
Copilot: "copilot",
|
|
15134
|
+
Codex: "codex",
|
|
15135
|
+
Antigravity: "antigravity",
|
|
15136
|
+
Windsurf: "windsurf",
|
|
15137
|
+
ClaudeDesktop: "claudedesktop",
|
|
15138
|
+
ChatGpt: "chatgpt",
|
|
15139
|
+
ClaudeAi: "claudeai",
|
|
15140
|
+
Api: "api"
|
|
15141
|
+
};
|
|
15142
|
+
var Harness = external_exports.enum(HARNESS).meta({ id: "Harness" });
|
|
15143
|
+
var SOURCE_TOOL = {
|
|
15144
|
+
ClaudeCode: "claude-code",
|
|
15145
|
+
ClaudeDesktop: "claude-desktop",
|
|
15146
|
+
Cursor: "cursor",
|
|
15147
|
+
ChatGpt: "chatgpt",
|
|
15148
|
+
ClaudeAi: "claude-ai",
|
|
15149
|
+
Copilot: "github-copilot",
|
|
15150
|
+
Codex: "codex",
|
|
15151
|
+
Antigravity: "antigravity",
|
|
15152
|
+
// No harness counterpart, deliberately: the CLI's own captures and a capture
|
|
15153
|
+
// whose tool could not be identified both render through the read side's
|
|
15154
|
+
// miss path rather than as a harness of their own.
|
|
15155
|
+
Cli: "cli",
|
|
15156
|
+
Unknown: "unknown"
|
|
15157
|
+
};
|
|
15158
|
+
var SourceTool = external_exports.enum(SOURCE_TOOL).meta({ id: "SourceTool" });
|
|
15159
|
+
var TOOL_TO_HARNESS = {
|
|
15160
|
+
[SOURCE_TOOL.ClaudeCode]: HARNESS.ClaudeCode,
|
|
15161
|
+
[SOURCE_TOOL.ClaudeDesktop]: HARNESS.ClaudeDesktop,
|
|
15162
|
+
[SOURCE_TOOL.Copilot]: HARNESS.Copilot,
|
|
15163
|
+
[SOURCE_TOOL.Cursor]: HARNESS.Cursor,
|
|
15164
|
+
[SOURCE_TOOL.ChatGpt]: HARNESS.ChatGpt,
|
|
15165
|
+
[SOURCE_TOOL.Codex]: HARNESS.Codex,
|
|
15166
|
+
[SOURCE_TOOL.Antigravity]: HARNESS.Antigravity,
|
|
15167
|
+
[SOURCE_TOOL.ClaudeAi]: HARNESS.ClaudeAi
|
|
15168
|
+
};
|
|
15169
|
+
|
|
15129
15170
|
// ../../packages/schema/src/zod/finding.ts
|
|
15130
15171
|
var DetectionCategory = external_exports.enum(["pii", "financial", "secret", "phi", "code_context", "code_flaw", "custom", "config"]).meta({ id: "DetectionCategory" });
|
|
15131
15172
|
var Severity = external_exports.enum(["critical", "high", "medium", "low"]).meta({ id: "Severity" });
|
|
@@ -15148,21 +15189,22 @@ var Finding = external_exports.object({
|
|
|
15148
15189
|
}).meta({ id: "Finding" });
|
|
15149
15190
|
var DetectedFinding = Finding.meta({ id: "DetectedFinding" });
|
|
15150
15191
|
var FindingAction = external_exports.enum(["blocked", "redacted", "warned", "allowed", "quarantined", "monitored"]).meta({ id: "FindingAction" });
|
|
15151
|
-
var FindingProvider =
|
|
15152
|
-
"
|
|
15153
|
-
"
|
|
15154
|
-
"
|
|
15155
|
-
"
|
|
15156
|
-
"
|
|
15157
|
-
"
|
|
15158
|
-
"
|
|
15159
|
-
"
|
|
15160
|
-
"
|
|
15192
|
+
var FindingProvider = Harness.extract([
|
|
15193
|
+
"ClaudeCode",
|
|
15194
|
+
"ClaudeDesktop",
|
|
15195
|
+
"Cursor",
|
|
15196
|
+
"Copilot",
|
|
15197
|
+
"ChatGpt",
|
|
15198
|
+
"ClaudeAi",
|
|
15199
|
+
"Codex",
|
|
15200
|
+
"Antigravity",
|
|
15201
|
+
"Api"
|
|
15161
15202
|
]).meta({ id: "FindingProvider" });
|
|
15162
15203
|
var FindingCategory = external_exports.enum([
|
|
15163
15204
|
"secret",
|
|
15164
15205
|
"pii",
|
|
15165
15206
|
"source_code",
|
|
15207
|
+
"code_flaw",
|
|
15166
15208
|
"external_share",
|
|
15167
15209
|
"mcp_server",
|
|
15168
15210
|
"customer_data",
|
|
@@ -15340,6 +15382,7 @@ var FindingInstanceDetail = FindingInstance.extend({
|
|
|
15340
15382
|
detection: FindingDetectionRef,
|
|
15341
15383
|
policy: FindingPolicyRef
|
|
15342
15384
|
}).meta({ id: "FindingInstanceDetail" });
|
|
15385
|
+
var MAX_FLAT_FINDINGS_LIMIT = 200;
|
|
15343
15386
|
var ListFindingInstancesQuery = external_exports.object({
|
|
15344
15387
|
severity: external_exports.array(Severity).optional(),
|
|
15345
15388
|
// Rule ids, the same vocabulary the grouped list's `subtype` carries.
|
|
@@ -15359,7 +15402,7 @@ var ListFindingInstancesQuery = external_exports.object({
|
|
|
15359
15402
|
q: external_exports.string().optional(),
|
|
15360
15403
|
sessionId: external_exports.string().optional(),
|
|
15361
15404
|
from: external_exports.iso.datetime().optional(),
|
|
15362
|
-
limit: external_exports.coerce.number().int().min(1).max(
|
|
15405
|
+
limit: external_exports.coerce.number().int().min(1).max(MAX_FLAT_FINDINGS_LIMIT).optional(),
|
|
15363
15406
|
cursor: external_exports.string().optional()
|
|
15364
15407
|
});
|
|
15365
15408
|
var ListFindingInstancesResponse = external_exports.object({
|
|
@@ -15421,20 +15464,6 @@ var ListFindingLocationsResponse = external_exports.object({
|
|
|
15421
15464
|
hasMore: external_exports.boolean()
|
|
15422
15465
|
}).meta({ id: "ListFindingLocationsResponse" });
|
|
15423
15466
|
|
|
15424
|
-
// ../../packages/schema/src/zod/harness-map.ts
|
|
15425
|
-
var Harness = external_exports.enum([
|
|
15426
|
-
"claudecode",
|
|
15427
|
-
"cursor",
|
|
15428
|
-
"copilot",
|
|
15429
|
-
"codex",
|
|
15430
|
-
"antigravity",
|
|
15431
|
-
"windsurf",
|
|
15432
|
-
"claudedesktop",
|
|
15433
|
-
"chatgpt",
|
|
15434
|
-
"claudeai",
|
|
15435
|
-
"api"
|
|
15436
|
-
]).meta({ id: "Harness" });
|
|
15437
|
-
|
|
15438
15467
|
// ../../packages/schema/src/zod/meta.ts
|
|
15439
15468
|
var InventoryObjectType = external_exports.enum(["host", "harness", "user", "skill", "hook", "mcp_server", "config_file"]).meta({ id: "InventoryObjectType" });
|
|
15440
15469
|
var AuditEventType = external_exports.enum([
|
|
@@ -15884,366 +15913,122 @@ var ActivityOverviewResponse = external_exports.object({
|
|
|
15884
15913
|
sessions: ListActivitySessionsResponse
|
|
15885
15914
|
}).meta({ id: "ActivityOverviewResponse" });
|
|
15886
15915
|
|
|
15887
|
-
// ../../packages/schema/src/zod/
|
|
15888
|
-
var
|
|
15889
|
-
var
|
|
15890
|
-
|
|
15891
|
-
|
|
15892
|
-
|
|
15893
|
-
|
|
15894
|
-
|
|
15895
|
-
|
|
15896
|
-
|
|
15897
|
-
|
|
15898
|
-
|
|
15899
|
-
|
|
15900
|
-
|
|
15901
|
-
|
|
15902
|
-
|
|
15903
|
-
|
|
15904
|
-
|
|
15905
|
-
filePath: external_exports.string().optional(),
|
|
15906
|
-
// The host tool whose input/output was scanned (e.g. 'Bash', 'WebFetch'),
|
|
15907
|
-
// set by the tool-scanning hooks. The tool NAME only — never the tool's
|
|
15908
|
-
// arguments or output, which can carry the very value a finding masked
|
|
15909
|
-
// (metadata is stored unredacted). Gives findings on non-file captures a
|
|
15910
|
-
// display location ("via Bash") when no filePath exists.
|
|
15911
|
-
toolName: external_exports.string().optional(),
|
|
15912
|
-
// Set (true) by the worktree scanner when the file is excluded by the
|
|
15913
|
-
// repo's .gitignore. Gitignored files ARE still scanned — local scratch and
|
|
15914
|
-
// generated code can leak real secrets — but the provenance is recorded so
|
|
15915
|
-
// policy/dashboards can treat those findings as informational rather than
|
|
15916
|
-
// blocking. Omitted (not false) for tracked files and non-scan events.
|
|
15917
|
-
gitignored: external_exports.boolean().optional(),
|
|
15918
|
-
// Set (true) ONLY when the event's `content` is the COMPLETE file at
|
|
15919
|
-
// capture time (a worktree scan reading from disk). Hook-captured edits
|
|
15920
|
-
// (e.g. an Edit tool's new_string) are partial fragments and MUST NOT set
|
|
15921
|
-
// this. The resolver-on-ingest keys its fixed-at-source dropout
|
|
15922
|
-
// diff on this marker: only a whole-file snapshot can prove a previously
|
|
15923
|
-
// open finding is gone; a fragment's absence proves nothing (the secret
|
|
15924
|
-
// may live outside the hunk). Omitted (not false) for fragments and
|
|
15925
|
-
// non-scan events, so pre-marker clients safely default to the
|
|
15926
|
-
// non-authoritative path.
|
|
15927
|
-
wholeFile: external_exports.boolean().optional(),
|
|
15928
|
-
model: external_exports.string().optional(),
|
|
15929
|
-
turnIndex: external_exports.number().int().nonnegative().optional(),
|
|
15930
|
-
// Distributed-tracing correlation. `correlationId` ties a recorded event back
|
|
15931
|
-
// to the request that captured/ingested it (a UUID, generated independently of
|
|
15932
|
-
// the trace id); `traceId` is the W3C trace id (32 lowercase hex chars) of the
|
|
15933
|
-
// originating span when telemetry is enabled. Both optional + backward
|
|
15934
|
-
// compatible — populated by the plugin (see @akasecurity/plugin-sdk).
|
|
15935
|
-
correlationId: external_exports.uuid().optional(),
|
|
15936
|
-
traceId: external_exports.string().regex(/^[0-9a-f]{32}$/).optional(),
|
|
15937
|
-
// Ids of the detection exceptions that downgraded findings in this capture
|
|
15938
|
-
// to 'allow' — the enforcement audit trail's link back to the grant that
|
|
15939
|
-
// authorized the bypass. Absent on captures where no exception applied.
|
|
15940
|
-
exceptionIds: external_exports.array(external_exports.guid()).optional()
|
|
15941
|
-
}).meta({ id: "EventMetadata" });
|
|
15942
|
-
var Event = external_exports.object({
|
|
15943
|
-
id: external_exports.guid(),
|
|
15944
|
-
sourceTool: SourceTool,
|
|
15945
|
-
kind: EventKind,
|
|
15946
|
-
occurredAt: external_exports.iso.datetime(),
|
|
15947
|
-
contentHash: external_exports.string(),
|
|
15948
|
-
content: external_exports.string(),
|
|
15949
|
-
metadata: EventMetadata.optional()
|
|
15950
|
-
}).meta({ id: "Event" });
|
|
15951
|
-
var IngestEvent = Event.meta({ id: "IngestEvent" });
|
|
15952
|
-
var IngestBatch = external_exports.object({
|
|
15953
|
-
events: external_exports.array(IngestEvent).min(1).max(100),
|
|
15954
|
-
// Dedup policy for this batch. Id-dedup ALWAYS applies. 'content-hash'
|
|
15955
|
-
// additionally rejects any event whose contentHash the store has already
|
|
15956
|
-
// recorded — for re-runnable bulk ingest (worktree scan, transcript
|
|
15957
|
-
// backfill), where a re-run mints fresh event ids for identical content and
|
|
15958
|
-
// would otherwise accumulate duplicates. Live hook traffic must NOT set it:
|
|
15959
|
-
// two genuinely separate prompts can be byte-identical and both belong on
|
|
15960
|
-
// the timeline.
|
|
15961
|
-
dedupe: external_exports.literal("content-hash").optional()
|
|
15962
|
-
}).meta({ id: "IngestBatch" });
|
|
15963
|
-
|
|
15964
|
-
// ../../packages/schema/src/zod/inventory.ts
|
|
15965
|
-
var AssetType = external_exports.enum(["project", "skill", "mcp", "hook", "config"]).meta({ id: "AssetType" });
|
|
15966
|
-
var AccessLevel = external_exports.enum(["open", "approved", "blocked"]).meta({ id: "AccessLevel" });
|
|
15967
|
-
var Origin = external_exports.enum(["source", "public-dep", "vendored", "config", "data", "docs", "generated"]).meta({ id: "Origin" });
|
|
15968
|
-
var TrustLevel = external_exports.enum(["known-good", "risky", "unapproved"]).meta({ id: "TrustLevel" });
|
|
15969
|
-
var Flag = external_exports.enum(["update", "stale", "conflict", "unknown", "change", "untracked", "risk", "findings"]).meta({ id: "Flag" });
|
|
15970
|
-
var Visibility = external_exports.enum(["public", "private"]).meta({ id: "Visibility" });
|
|
15971
|
-
var HarnessEventKind = external_exports.enum(["block", "redact", "warn"]).meta({ id: "HarnessEventKind" });
|
|
15972
|
-
var HarnessId = external_exports.enum(["claudecode", "cursor", "codex", "antigravity"]).meta({ id: "HarnessId" });
|
|
15973
|
-
var AccessCounts = external_exports.object({
|
|
15974
|
-
open: external_exports.number().int().nonnegative(),
|
|
15975
|
-
approved: external_exports.number().int().nonnegative(),
|
|
15976
|
-
blocked: external_exports.number().int().nonnegative(),
|
|
15977
|
-
total: external_exports.number().int().nonnegative()
|
|
15978
|
-
}).meta({ id: "AccessCounts" });
|
|
15979
|
-
var AssetSummary = external_exports.object({
|
|
15980
|
-
id: external_exports.string(),
|
|
15981
|
-
type: AssetType,
|
|
15982
|
-
name: external_exports.string(),
|
|
15983
|
-
sub: external_exports.string(),
|
|
15984
|
-
flags: external_exports.array(Flag),
|
|
15985
|
-
/** MCP servers only — omitted for all other types. */
|
|
15986
|
-
trust: TrustLevel.optional()
|
|
15987
|
-
}).meta({ id: "AssetSummary" });
|
|
15988
|
-
var ProjectSummary = external_exports.object({
|
|
15989
|
-
id: external_exports.string(),
|
|
15990
|
-
name: external_exports.string(),
|
|
15991
|
-
repo: external_exports.string(),
|
|
15992
|
-
visibility: Visibility,
|
|
15993
|
-
language: external_exports.string(),
|
|
15994
|
-
policyDefault: AccessLevel,
|
|
15995
|
-
updatedAt: external_exports.iso.datetime(),
|
|
15996
|
-
accessCounts: AccessCounts,
|
|
15997
|
-
findingsCount: external_exports.number().int().nonnegative()
|
|
15998
|
-
}).meta({ id: "ProjectSummary" });
|
|
15999
|
-
var HarnessCategory = external_exports.object({
|
|
16000
|
-
/** One of config/skill/mcp/hook — never project (enforced at service layer). */
|
|
16001
|
-
type: AssetType,
|
|
16002
|
-
assets: external_exports.array(AssetSummary)
|
|
15916
|
+
// ../../packages/schema/src/zod/config-inventory.ts
|
|
15917
|
+
var ConfigScope = external_exports.enum(["user", "project", "local", "plugin"]);
|
|
15918
|
+
var SkillScanEntry = external_exports.object({
|
|
15919
|
+
name: external_exports.string().min(1),
|
|
15920
|
+
// The identity source: a marketplace repo for plugin skills (e.g.
|
|
15921
|
+
// 'anthropics/skills'), 'local' for personal ~/.claude/skills, or
|
|
15922
|
+
// 'project:<repo-identity>' for checked-in project skills. The surrogate keeps
|
|
15923
|
+
// a personal skill named 'pdf' from colliding with the marketplace 'pdf'.
|
|
15924
|
+
source: external_exports.string().min(1),
|
|
15925
|
+
scope: ConfigScope,
|
|
15926
|
+
pluginName: external_exports.string().optional(),
|
|
15927
|
+
// Volatile — rides the attribute bag, never the identity hash.
|
|
15928
|
+
version: external_exports.string().optional(),
|
|
15929
|
+
description: external_exports.string().optional(),
|
|
15930
|
+
// Skill directory mtime (ISO) — the "updated Nd ago" freshness signal.
|
|
15931
|
+
updatedAt: external_exports.iso.datetime().optional(),
|
|
15932
|
+
// Filesystem path — the promoted inventory `location` column.
|
|
15933
|
+
location: external_exports.string().optional()
|
|
16003
15934
|
});
|
|
16004
|
-
var
|
|
16005
|
-
|
|
16006
|
-
|
|
16007
|
-
|
|
16008
|
-
|
|
16009
|
-
|
|
16010
|
-
|
|
16011
|
-
|
|
16012
|
-
|
|
16013
|
-
|
|
16014
|
-
|
|
16015
|
-
|
|
16016
|
-
var AssetGroup = external_exports.object({
|
|
16017
|
-
/** Group key — never project (enforced at service layer). */
|
|
16018
|
-
type: AssetType,
|
|
16019
|
-
total: external_exports.number().int().nonnegative(),
|
|
16020
|
-
/**
|
|
16021
|
-
* MCP group only — omitted for all other types.
|
|
16022
|
-
* Partial: only TrustLevel keys with non-zero counts are included.
|
|
16023
|
-
* Strict: unknown keys are rejected — only TrustLevel values are valid keys.
|
|
16024
|
-
*/
|
|
16025
|
-
trustRollup: external_exports.object({
|
|
16026
|
-
"known-good": external_exports.number().int().nonnegative(),
|
|
16027
|
-
risky: external_exports.number().int().nonnegative(),
|
|
16028
|
-
unapproved: external_exports.number().int().nonnegative()
|
|
16029
|
-
}).partial().strict().optional(),
|
|
16030
|
-
/**
|
|
16031
|
-
* Partial: only Flag keys with non-zero counts are included.
|
|
16032
|
-
* Strict: unknown keys are rejected — only Flag values are valid keys.
|
|
16033
|
-
*/
|
|
16034
|
-
flagRollup: external_exports.object({
|
|
16035
|
-
update: external_exports.number().int().nonnegative(),
|
|
16036
|
-
stale: external_exports.number().int().nonnegative(),
|
|
16037
|
-
conflict: external_exports.number().int().nonnegative(),
|
|
16038
|
-
unknown: external_exports.number().int().nonnegative(),
|
|
16039
|
-
change: external_exports.number().int().nonnegative(),
|
|
16040
|
-
untracked: external_exports.number().int().nonnegative(),
|
|
16041
|
-
risk: external_exports.number().int().nonnegative(),
|
|
16042
|
-
findings: external_exports.number().int().nonnegative()
|
|
16043
|
-
}).partial().strict(),
|
|
16044
|
-
items: external_exports.array(AssetSummary)
|
|
16045
|
-
}).meta({ id: "AssetGroup" });
|
|
16046
|
-
var ListAssetsResponse = external_exports.object({ groups: external_exports.array(AssetGroup) }).meta({ id: "ListAssetsResponse" });
|
|
16047
|
-
var McpTool = external_exports.object({
|
|
16048
|
-
name: external_exports.string(),
|
|
16049
|
-
signature: external_exports.string(),
|
|
16050
|
-
description: external_exports.string(),
|
|
16051
|
-
write: external_exports.boolean(),
|
|
16052
|
-
/** Non-null string when tool is dangerous / blocked; null otherwise. */
|
|
16053
|
-
risk: external_exports.string().nullable()
|
|
16054
|
-
}).meta({ id: "McpTool" });
|
|
16055
|
-
var AssetFindingRef = external_exports.object({
|
|
16056
|
-
id: external_exports.string(),
|
|
16057
|
-
title: external_exports.string(),
|
|
16058
|
-
note: external_exports.string()
|
|
15935
|
+
var HookScanEntry = external_exports.object({
|
|
15936
|
+
// Hook event name (PreToolUse, PostToolUse, …). Open string, not an enum: the
|
|
15937
|
+
// set is harness-defined and grows without a schema change.
|
|
15938
|
+
event: external_exports.string().min(1),
|
|
15939
|
+
// The tool matcher ('Bash', 'Edit|Write', …). Absent = matches all tools.
|
|
15940
|
+
matcher: external_exports.string().optional(),
|
|
15941
|
+
command: external_exports.string().min(1),
|
|
15942
|
+
timeout: external_exports.number().optional(),
|
|
15943
|
+
scope: ConfigScope,
|
|
15944
|
+
pluginName: external_exports.string().optional(),
|
|
15945
|
+
// The settings file / hooks.json the entry came from.
|
|
15946
|
+
location: external_exports.string().optional()
|
|
16059
15947
|
});
|
|
16060
|
-
var
|
|
16061
|
-
|
|
16062
|
-
|
|
16063
|
-
|
|
16064
|
-
|
|
16065
|
-
|
|
16066
|
-
|
|
16067
|
-
|
|
16068
|
-
|
|
16069
|
-
|
|
16070
|
-
|
|
16071
|
-
|
|
16072
|
-
|
|
16073
|
-
|
|
16074
|
-
|
|
16075
|
-
|
|
16076
|
-
|
|
16077
|
-
|
|
16078
|
-
|
|
16079
|
-
|
|
16080
|
-
|
|
16081
|
-
|
|
16082
|
-
|
|
16083
|
-
|
|
16084
|
-
|
|
16085
|
-
|
|
16086
|
-
|
|
16087
|
-
|
|
16088
|
-
|
|
16089
|
-
|
|
16090
|
-
|
|
16091
|
-
path: external_exports.string(),
|
|
16092
|
-
name: external_exports.string(),
|
|
16093
|
-
origin: Origin,
|
|
16094
|
-
/** Effective access (override applied). */
|
|
16095
|
-
access: AccessLevel,
|
|
16096
|
-
/** True when a file_access_override differs from the computed default. */
|
|
16097
|
-
isCustom: external_exports.boolean(),
|
|
16098
|
-
findings: external_exports.number().int().nonnegative(),
|
|
16099
|
-
/** When the file was auto-blocked by a detection; null when not blocked. */
|
|
16100
|
-
blockedAt: external_exports.iso.datetime().nullable().optional(),
|
|
16101
|
-
/** Why the file was blocked; null when absent. */
|
|
16102
|
-
note: external_exports.string().nullable().optional()
|
|
16103
|
-
}).meta({ id: "FileSummary" });
|
|
16104
|
-
var FolderSummary = external_exports.object({
|
|
16105
|
-
name: external_exports.string(),
|
|
16106
|
-
path: external_exports.string(),
|
|
16107
|
-
/** Rollup of effective access across all descendants. */
|
|
16108
|
-
accessCounts: AccessCounts
|
|
16109
|
-
}).meta({ id: "FolderSummary" });
|
|
16110
|
-
var ProjectTreeResponse = external_exports.object({
|
|
16111
|
-
project: external_exports.object({
|
|
16112
|
-
id: external_exports.string(),
|
|
16113
|
-
repo: external_exports.string(),
|
|
16114
|
-
visibility: Visibility
|
|
16115
|
-
}),
|
|
16116
|
-
path: external_exports.string(),
|
|
16117
|
-
/** Browse mode: one-level folders at the current path. Omitted in search mode. */
|
|
16118
|
-
folders: external_exports.array(FolderSummary).optional(),
|
|
16119
|
-
files: external_exports.array(FileSummary)
|
|
16120
|
-
}).meta({ id: "ProjectTreeResponse" });
|
|
16121
|
-
var FileDetail = FileSummary.extend({
|
|
16122
|
-
project: external_exports.object({
|
|
16123
|
-
repo: external_exports.string(),
|
|
16124
|
-
visibility: Visibility,
|
|
16125
|
-
language: external_exports.string(),
|
|
16126
|
-
policyDefault: AccessLevel,
|
|
16127
|
-
updatedAt: external_exports.iso.datetime()
|
|
16128
|
-
}),
|
|
16129
|
-
findingsRefs: external_exports.array(external_exports.object({ id: external_exports.string(), title: external_exports.string() }))
|
|
16130
|
-
}).meta({ id: "FileDetail" });
|
|
16131
|
-
var SetFileAccessBody = external_exports.object({
|
|
16132
|
-
path: external_exports.string(),
|
|
16133
|
-
access: AccessLevel
|
|
16134
|
-
}).meta({ id: "SetFileAccessBody" });
|
|
16135
|
-
var SetFileAccessResponse = external_exports.object({
|
|
16136
|
-
file: FileSummary,
|
|
16137
|
-
accessCounts: AccessCounts
|
|
16138
|
-
}).meta({ id: "SetFileAccessResponse" });
|
|
16139
|
-
var SetMcpTrustBody = external_exports.object({ trust: TrustLevel }).meta({ id: "SetMcpTrustBody" });
|
|
16140
|
-
var HarnessEventItem = external_exports.object({
|
|
16141
|
-
kind: HarnessEventKind,
|
|
16142
|
-
title: external_exports.string(),
|
|
16143
|
-
detail: external_exports.string(),
|
|
16144
|
-
occurredAt: external_exports.iso.datetime(),
|
|
16145
|
-
findingId: external_exports.string().nullable().optional()
|
|
16146
|
-
}).meta({ id: "HarnessEventItem" });
|
|
16147
|
-
var HarnessEventsResponse = external_exports.object({
|
|
16148
|
-
counts: external_exports.object({
|
|
16149
|
-
block: external_exports.number().int().nonnegative(),
|
|
16150
|
-
redact: external_exports.number().int().nonnegative(),
|
|
16151
|
-
warn: external_exports.number().int().nonnegative()
|
|
16152
|
-
}),
|
|
16153
|
-
items: external_exports.array(HarnessEventItem)
|
|
16154
|
-
}).meta({ id: "HarnessEventsResponse" });
|
|
16155
|
-
var RescanResponse = external_exports.object({
|
|
16156
|
-
jobId: external_exports.string(),
|
|
16157
|
-
startedAt: external_exports.iso.datetime()
|
|
16158
|
-
}).meta({ id: "RescanResponse" });
|
|
16159
|
-
var ConnectProjectBody = external_exports.object({ repo: external_exports.string() }).meta({ id: "ConnectProjectBody" });
|
|
16160
|
-
var ListAssetsQuery = external_exports.object({
|
|
16161
|
-
/** Filter by one or more AssetType values; absent means all types. */
|
|
16162
|
-
type: external_exports.array(AssetType).optional(),
|
|
16163
|
-
/** Free-text search term. */
|
|
16164
|
-
q: external_exports.string().optional()
|
|
16165
|
-
});
|
|
16166
|
-
var GetProjectTreeQuery = external_exports.object({
|
|
16167
|
-
/** Subtree root path; defaults to repository root when absent. */
|
|
16168
|
-
path: external_exports.string().optional(),
|
|
16169
|
-
/** Free-text filter applied to file paths. */
|
|
16170
|
-
q: external_exports.string().optional(),
|
|
16171
|
-
/**
|
|
16172
|
-
* Special listing mode. `blocked` returns every effectively-blocked, auto-blocked
|
|
16173
|
-
* file across the whole repo (folders omitted, most-recent first), ignoring
|
|
16174
|
-
* `path`/`q` — powers the project-wide "recently blocked" strip.
|
|
16175
|
-
*/
|
|
16176
|
-
filter: external_exports.enum(["blocked"]).optional()
|
|
15948
|
+
var McpServerScanEntry = external_exports.object({
|
|
15949
|
+
// The server's config key ("github", "filesystem", …) — identity, with the
|
|
15950
|
+
// qualified scope (see mcpServerIdentityKey).
|
|
15951
|
+
name: external_exports.string().min(1),
|
|
15952
|
+
scope: ConfigScope,
|
|
15953
|
+
pluginName: external_exports.string().optional(),
|
|
15954
|
+
// The owning plugin's marketplace — part of PLUGIN-scope identity: two
|
|
15955
|
+
// marketplaces can each ship a plugin named `guard`, and without this their
|
|
15956
|
+
// same-named servers would collapse to one row (the second silently dropped,
|
|
15957
|
+
// inheriting the first's trust).
|
|
15958
|
+
marketplace: external_exports.string().optional(),
|
|
15959
|
+
// The repo identity (remote url, or the cwd for un-remoted repos) — part of
|
|
15960
|
+
// PROJECT/LOCAL-scope identity: a server named `github` in repo A and one in
|
|
15961
|
+
// repo B are different servers with different commands, and MUST NOT share a
|
|
15962
|
+
// row — a shared row would let a cloned repo's .mcp.json inherit the trust
|
|
15963
|
+
// the user granted elsewhere.
|
|
15964
|
+
project: external_exports.string().optional(),
|
|
15965
|
+
// 'stdio' when the entry carries a command; otherwise the config's `type`
|
|
15966
|
+
// ('http' / 'sse' / …). Open string — the transport set is harness-defined.
|
|
15967
|
+
transport: external_exports.string().min(1),
|
|
15968
|
+
// Volatile on purpose (unlike hook `command`): a changed command/url is drift
|
|
15969
|
+
// on a stable row — visible across config_scan snapshots and preserving the
|
|
15970
|
+
// user's trust decision — never a quiet new row. One of the two is present.
|
|
15971
|
+
// Secret-masked at collection time (the scanner runs the bundled detection
|
|
15972
|
+
// packs over both — tokens routinely ride command args and URLs).
|
|
15973
|
+
command: external_exports.string().optional(),
|
|
15974
|
+
url: external_exports.string().optional(),
|
|
15975
|
+
// Env var NAMES only, never values (the no-secrets rule).
|
|
15976
|
+
envKeys: external_exports.array(external_exports.string()).optional(),
|
|
15977
|
+
// The config file the entry came from.
|
|
15978
|
+
location: external_exports.string().optional()
|
|
16177
15979
|
});
|
|
16178
|
-
var
|
|
16179
|
-
|
|
16180
|
-
|
|
15980
|
+
var ConfigFileScanEntry = external_exports.object({
|
|
15981
|
+
// Basename (settings.json, CLAUDE.md) or dir name (commands/, agents/).
|
|
15982
|
+
name: external_exports.string().min(1),
|
|
15983
|
+
// The absolute path — identity (with scope) and the promoted `location`.
|
|
15984
|
+
path: external_exports.string().min(1),
|
|
15985
|
+
scope: ConfigScope,
|
|
15986
|
+
// Human label: "User settings", "Project memory", "Slash commands", …
|
|
15987
|
+
kind: external_exports.string().min(1),
|
|
15988
|
+
// Derived SHAPE summary — top-level key names, entry counts, line counts.
|
|
15989
|
+
// Never file content or values (memory files can carry sensitive detail).
|
|
15990
|
+
detail: external_exports.string().optional(),
|
|
15991
|
+
// Dir configs (commands/, agents/) and .mcp.json: how many entries.
|
|
15992
|
+
entryCount: external_exports.number().optional(),
|
|
15993
|
+
// File mtime (ISO) — the freshness signal.
|
|
15994
|
+
updatedAt: external_exports.iso.datetime().optional()
|
|
16181
15995
|
});
|
|
16182
|
-
var
|
|
16183
|
-
|
|
16184
|
-
|
|
15996
|
+
var ConfigScanResult = external_exports.object({
|
|
15997
|
+
scannedAt: external_exports.iso.datetime(),
|
|
15998
|
+
skills: external_exports.array(SkillScanEntry),
|
|
15999
|
+
hooks: external_exports.array(HookScanEntry),
|
|
16000
|
+
mcpServers: external_exports.array(McpServerScanEntry),
|
|
16001
|
+
configFiles: external_exports.array(ConfigFileScanEntry),
|
|
16002
|
+
errors: external_exports.array(external_exports.object({ source: external_exports.string(), reason: external_exports.string() }))
|
|
16185
16003
|
});
|
|
16186
|
-
|
|
16187
|
-
|
|
16188
|
-
|
|
16189
|
-
|
|
16190
|
-
|
|
16191
|
-
|
|
16192
|
-
|
|
16193
|
-
|
|
16194
|
-
|
|
16195
|
-
|
|
16196
|
-
id: external_exports.guid(),
|
|
16197
|
-
ruleId: external_exports.string(),
|
|
16198
|
-
// Denormalized from the rule, for reporting — never matched on.
|
|
16199
|
-
category: DetectionCategory,
|
|
16200
|
-
// HMAC-SHA256 hex of the raw match under a machine-local key: a KEYED
|
|
16201
|
-
// fingerprint, never the raw value, and never reversible. Matching recomputes
|
|
16202
|
-
// the fingerprint from a fresh capture; the value itself is never stored.
|
|
16203
|
-
// Shape-constrained so a malformed — or accidentally raw — value is rejected
|
|
16204
|
-
// at the boundary rather than persisted.
|
|
16205
|
-
valueFingerprint: external_exports.string().regex(/^[0-9a-f]{64}$/),
|
|
16206
|
-
// Version of the fingerprint key the grant was written under; a rotated key
|
|
16207
|
-
// invalidates old grants rather than silently mismatching them.
|
|
16208
|
-
keyVersion: external_exports.number().int().positive(),
|
|
16209
|
-
// maskMatch() preview of the approved value — never the raw value.
|
|
16210
|
-
maskedValue: external_exports.string(),
|
|
16211
|
-
capability: ExceptionCapability.default("suppress"),
|
|
16212
|
-
scope: ExceptionScope,
|
|
16213
|
-
expiresAt: external_exports.iso.datetime().nullable(),
|
|
16214
|
-
maxUses: external_exports.number().int().positive().nullable(),
|
|
16215
|
-
useCount: external_exports.number().int().nonnegative(),
|
|
16216
|
-
lastUsedAt: external_exports.iso.datetime().nullable(),
|
|
16217
|
-
// Mandatory: every grant carries the human reason it exists.
|
|
16218
|
-
justification: external_exports.string().min(1),
|
|
16219
|
-
conditions: ExceptionConditions.nullable(),
|
|
16220
|
-
createdBy: external_exports.string(),
|
|
16221
|
-
createdVia: external_exports.enum(["cli-approve", "cli-add", "web-approve", "web-add", "api", "setup-triage"]),
|
|
16222
|
-
createdAt: external_exports.iso.datetime(),
|
|
16223
|
-
updatedAt: external_exports.iso.datetime(),
|
|
16224
|
-
// Revocation is terminal and retained — consumed/expired/revoked rows are
|
|
16225
|
-
// audit evidence; nothing in the exception lifecycle hard-deletes.
|
|
16226
|
-
revokedAt: external_exports.iso.datetime().nullable(),
|
|
16227
|
-
revokedBy: external_exports.string().nullable(),
|
|
16228
|
-
revokeReason: external_exports.string().nullable()
|
|
16004
|
+
var ConfigPostureFindingInput = external_exports.object({
|
|
16005
|
+
ruleId: external_exports.string().min(1),
|
|
16006
|
+
version: external_exports.string().min(1),
|
|
16007
|
+
span: Span,
|
|
16008
|
+
// For posture rules this is the offending COMMAND (config the user already
|
|
16009
|
+
// holds locally, not captured secret content) — it is also the correlation
|
|
16010
|
+
// key the read surface matches back to a hook row.
|
|
16011
|
+
maskedMatch: external_exports.string(),
|
|
16012
|
+
actionTaken: ActionTaken,
|
|
16013
|
+
confidence: external_exports.number().min(0).max(1)
|
|
16229
16014
|
});
|
|
16230
|
-
var
|
|
16231
|
-
|
|
16232
|
-
|
|
16233
|
-
|
|
16234
|
-
|
|
16235
|
-
capability: true,
|
|
16236
|
-
expiresAt: true,
|
|
16237
|
-
maxUses: true,
|
|
16238
|
-
useCount: true,
|
|
16239
|
-
conditions: true
|
|
16015
|
+
var ConfigScanRecord = external_exports.object({
|
|
16016
|
+
items: external_exports.array(InventoryInput),
|
|
16017
|
+
scanEvent: AuditEventInput,
|
|
16018
|
+
definitions: external_exports.array(InspectionDefinitionInput).optional(),
|
|
16019
|
+
findings: external_exports.array(ConfigPostureFindingInput).optional()
|
|
16240
16020
|
});
|
|
16241
|
-
|
|
16021
|
+
|
|
16022
|
+
// ../../packages/schema/src/zod/registry.ts
|
|
16023
|
+
var Namespace = external_exports.string().regex(/^[a-z][a-z0-9-]*$/);
|
|
16024
|
+
var PackId = external_exports.string().regex(/^[a-z][a-z0-9-]*$/);
|
|
16025
|
+
var SemVer = external_exports.string().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-.]+)?$/);
|
|
16026
|
+
var PublisherKind = external_exports.enum(["labs", "user", "org"]);
|
|
16242
16027
|
|
|
16243
16028
|
// ../../packages/schema/src/zod/rule.ts
|
|
16244
|
-
var MatcherType = external_exports.enum(["keyword", "regex"
|
|
16029
|
+
var MatcherType = external_exports.enum(["keyword", "regex"]).meta({ id: "MatcherType" });
|
|
16245
16030
|
var RuleProbeVerdict = external_exports.enum(["safe", "quarantined"]).meta({ id: "RuleProbeVerdict" });
|
|
16246
|
-
var KeywordMatcher = external_exports.
|
|
16031
|
+
var KeywordMatcher = external_exports.strictObject({
|
|
16247
16032
|
type: external_exports.literal("keyword"),
|
|
16248
16033
|
// An empty keyword matches at every position, yielding one zero-length span
|
|
16249
16034
|
// per character. Rejected here because a keyword that matches everything is
|
|
@@ -16259,16 +16044,31 @@ function isValidRegex(pattern, flags) {
|
|
|
16259
16044
|
return false;
|
|
16260
16045
|
}
|
|
16261
16046
|
}
|
|
16047
|
+
function probeFlags(flags) {
|
|
16048
|
+
return flags.replace(/[gy]/g, "");
|
|
16049
|
+
}
|
|
16262
16050
|
function matchesEmptyString(pattern, flags) {
|
|
16263
16051
|
try {
|
|
16264
|
-
const re = new RegExp(pattern, flags
|
|
16052
|
+
const re = new RegExp(pattern, probeFlags(flags));
|
|
16265
16053
|
return re.exec("")?.[0].length === 0;
|
|
16266
16054
|
} catch {
|
|
16267
16055
|
return false;
|
|
16268
16056
|
}
|
|
16269
16057
|
}
|
|
16058
|
+
function spansWholeMatch(captureGroup) {
|
|
16059
|
+
return captureGroup === void 0 || captureGroup === 0;
|
|
16060
|
+
}
|
|
16061
|
+
function captureGroupCount(pattern, flags) {
|
|
16062
|
+
try {
|
|
16063
|
+
const probe = new RegExp(`${pattern}|`, probeFlags(flags));
|
|
16064
|
+
const result = probe.exec("");
|
|
16065
|
+
return result ? result.length - 1 : void 0;
|
|
16066
|
+
} catch {
|
|
16067
|
+
return void 0;
|
|
16068
|
+
}
|
|
16069
|
+
}
|
|
16270
16070
|
var MAX_PATTERN_LENGTH = 2e3;
|
|
16271
|
-
var RegexMatcher = external_exports.
|
|
16071
|
+
var RegexMatcher = external_exports.strictObject({
|
|
16272
16072
|
type: external_exports.literal("regex"),
|
|
16273
16073
|
pattern: external_exports.string().min(1).max(MAX_PATTERN_LENGTH),
|
|
16274
16074
|
flags: external_exports.string().default("gi"),
|
|
@@ -16276,28 +16076,47 @@ var RegexMatcher = external_exports.object({
|
|
|
16276
16076
|
}).refine((v) => isValidRegex(v.pattern, v.flags), {
|
|
16277
16077
|
message: "pattern/flags do not form a valid JavaScript regular expression",
|
|
16278
16078
|
path: ["pattern"]
|
|
16279
|
-
}).refine((v) => v.captureGroup
|
|
16079
|
+
}).refine((v) => !spansWholeMatch(v.captureGroup) || !matchesEmptyString(v.pattern, v.flags), {
|
|
16280
16080
|
message: 'a whole-match regex that can match the empty string (e.g. "\\d*", "a?", "(?:)") can hang the matcher \u2014 scope the quantifier to a captureGroup, or require at least one character',
|
|
16281
16081
|
path: ["pattern"]
|
|
16082
|
+
}).superRefine((v, ctx) => {
|
|
16083
|
+
if (v.captureGroup === void 0) return;
|
|
16084
|
+
const groups = captureGroupCount(v.pattern, v.flags);
|
|
16085
|
+
if (groups === void 0 || v.captureGroup <= groups) return;
|
|
16086
|
+
ctx.addIssue({
|
|
16087
|
+
code: "custom",
|
|
16088
|
+
path: ["captureGroup"],
|
|
16089
|
+
message: `captureGroup ${String(v.captureGroup)} is out of range \u2014 the pattern declares ${String(groups)} capture group(s), so valid values are 0-${String(groups)}. An out-of-range group never matches, which would make the rule silently never fire.`
|
|
16090
|
+
});
|
|
16282
16091
|
});
|
|
16283
|
-
var
|
|
16284
|
-
|
|
16285
|
-
|
|
16286
|
-
config: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
|
|
16287
|
-
});
|
|
16288
|
-
var Matcher = external_exports.discriminatedUnion("type", [KeywordMatcher, RegexMatcher, ValidatorMatcher]).meta({ id: "Matcher" });
|
|
16289
|
-
var AppliesTo = external_exports.object({
|
|
16092
|
+
var Matcher = external_exports.discriminatedUnion("type", [KeywordMatcher, RegexMatcher]).meta({ id: "Matcher" });
|
|
16093
|
+
var MATCHER_TYPES = MatcherType.options;
|
|
16094
|
+
var AppliesTo = external_exports.strictObject({
|
|
16290
16095
|
// Dot-prefixed, e.g. ".py" — matches the scanner's SOURCE_EXTENSIONS shape.
|
|
16291
16096
|
extensions: external_exports.array(external_exports.string().regex(/^\.[A-Za-z0-9]+$/)).min(1)
|
|
16292
16097
|
}).meta({ id: "AppliesTo" });
|
|
16293
|
-
var
|
|
16294
|
-
|
|
16295
|
-
|
|
16296
|
-
|
|
16297
|
-
|
|
16298
|
-
|
|
16299
|
-
|
|
16300
|
-
|
|
16098
|
+
var PostValidatorName = external_exports.enum(["entropy", "luhn"]).meta({ id: "PostValidatorName" });
|
|
16099
|
+
var PostValidatorRef = external_exports.union(
|
|
16100
|
+
[
|
|
16101
|
+
PostValidatorName,
|
|
16102
|
+
external_exports.strictObject({
|
|
16103
|
+
name: PostValidatorName,
|
|
16104
|
+
config: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
|
|
16105
|
+
})
|
|
16106
|
+
],
|
|
16107
|
+
{
|
|
16108
|
+
// A union reports one collapsed issue for every way its arms can fail, so
|
|
16109
|
+
// this has to describe the whole shape rather than just the name — it is
|
|
16110
|
+
// what an author sees for a misspelled name AND for a stray key in the
|
|
16111
|
+
// object form. The names come from the enum so the message cannot go
|
|
16112
|
+
// stale. Without it Zod says only "Invalid input", which is precisely the
|
|
16113
|
+
// no-feedback outcome this schema exists to remove.
|
|
16114
|
+
error: () => `not a valid post-validator: use a bare name (${PostValidatorName.options.map((name) => JSON.stringify(name)).join(
|
|
16115
|
+
" or "
|
|
16116
|
+
)}) or { "name": ..., "config": { ... } }. An unrecognized name would be a false-positive guard that never runs.`
|
|
16117
|
+
}
|
|
16118
|
+
).meta({ id: "PostValidatorRef" });
|
|
16119
|
+
var RequiresNearby = external_exports.strictObject({
|
|
16301
16120
|
// Each array, when present, must be non-empty and contain non-empty strings —
|
|
16302
16121
|
// an empty/blank criterion would either never fire or (for labels) match
|
|
16303
16122
|
// everything.
|
|
@@ -16312,16 +16131,23 @@ var RequiresNearby = external_exports.object({
|
|
|
16312
16131
|
(v) => (v.categories?.length ?? 0) + (v.ruleIds?.length ?? 0) + (v.labels?.length ?? 0) > 0,
|
|
16313
16132
|
{ message: "requiresNearby needs at least one of categories, ruleIds, or labels" }
|
|
16314
16133
|
).meta({ id: "RequiresNearby" });
|
|
16315
|
-
var RuleFixture = external_exports.
|
|
16134
|
+
var RuleFixture = external_exports.strictObject({
|
|
16316
16135
|
label: external_exports.string(),
|
|
16317
16136
|
text: external_exports.string().max(5e4),
|
|
16318
16137
|
shouldMatch: external_exports.boolean(),
|
|
16319
16138
|
// Simulated file context for the scan, so fixtures can assert `appliesTo`
|
|
16320
16139
|
// gating (e.g. a Python-only pattern must NOT fire in a .ts file).
|
|
16321
16140
|
filePath: external_exports.string().optional(),
|
|
16322
|
-
expectedSpans: external_exports.array(external_exports.
|
|
16141
|
+
expectedSpans: external_exports.array(external_exports.strictObject({ start: external_exports.number(), end: external_exports.number() })).optional()
|
|
16323
16142
|
}).meta({ id: "RuleFixture" });
|
|
16324
|
-
var Rule = external_exports.
|
|
16143
|
+
var Rule = external_exports.strictObject({
|
|
16144
|
+
// A pinned literal over a STRICT object, and the two together decide how this
|
|
16145
|
+
// format may grow. A rule carrying a key not listed below is refused with
|
|
16146
|
+
// `unrecognized_keys`; a rule declaring `specVersion: 2` is refused with
|
|
16147
|
+
// `invalid_value`. So the only additive path is adding an OPTIONAL field here
|
|
16148
|
+
// — that keeps every rule authored before it valid — and a rule author has no
|
|
16149
|
+
// way to introduce a field of their own or to opt into a later version.
|
|
16150
|
+
// Widening the format means changing this literal and every consumer of it.
|
|
16325
16151
|
specVersion: external_exports.literal(1),
|
|
16326
16152
|
// `packId/ruleName` (e.g. `secrets/aws-access-key`). NOTE the first segment is
|
|
16327
16153
|
// the PACK id, NOT a namespace — this is a DIFFERENT slug space from a
|
|
@@ -16357,287 +16183,6 @@ var PackManifest = external_exports.object({
|
|
|
16357
16183
|
sourceUrl: external_exports.url().optional()
|
|
16358
16184
|
}).meta({ id: "PackManifest" });
|
|
16359
16185
|
|
|
16360
|
-
// ../../packages/schema/src/zod/policy.ts
|
|
16361
|
-
var PolicyScope = external_exports.enum(["global", "repo", "user"]).meta({ id: "PolicyScope" });
|
|
16362
|
-
var PolicyTarget = external_exports.union([external_exports.object({ ruleId: external_exports.string() }), external_exports.object({ category: DetectionCategory })]).meta({ id: "PolicyTarget" });
|
|
16363
|
-
var Policy = external_exports.object({
|
|
16364
|
-
id: external_exports.guid(),
|
|
16365
|
-
scope: PolicyScope,
|
|
16366
|
-
target: PolicyTarget,
|
|
16367
|
-
action: ActionTaken,
|
|
16368
|
-
enabled: external_exports.boolean().default(true),
|
|
16369
|
-
customKeywords: external_exports.array(external_exports.string()).optional(),
|
|
16370
|
-
// Display name — optional so older policy rows without name still parse.
|
|
16371
|
-
// Added for the findings API (policy.name column migration).
|
|
16372
|
-
name: external_exports.string().optional()
|
|
16373
|
-
}).meta({ id: "Policy" });
|
|
16374
|
-
var PolicyBundle = external_exports.object({
|
|
16375
|
-
version: external_exports.string(),
|
|
16376
|
-
policies: external_exports.array(Policy),
|
|
16377
|
-
// Rules from the installed marketplace packs (snapshotted by the
|
|
16378
|
-
// control plane). The plugin registers these in addition to its bundled
|
|
16379
|
-
// packs. Optional so older backends — and older on-disk caches — that omit
|
|
16380
|
-
// the field still parse; consumers read `bundle.rules ?? []`.
|
|
16381
|
-
rules: external_exports.array(Rule).optional(),
|
|
16382
|
-
// When true, `rules` IS the complete effective ruleset and the runtime must
|
|
16383
|
-
// NOT merge its compiled-in bundled packs — the standalone gateway sets this
|
|
16384
|
-
// after reading the user's installed snapshot (installed_packs, enabled
|
|
16385
|
-
// packs only), which is how detection updates stay manual: new bundled
|
|
16386
|
-
// rules run only after the user applies the pack update. Absent/false keeps
|
|
16387
|
-
// the historical composition (bundled packs + rules) — older caches.
|
|
16388
|
-
rulesComplete: external_exports.boolean().optional(),
|
|
16389
|
-
// Active detection exceptions, evaluation subset only (see
|
|
16390
|
-
// ExceptionBundleEntry). Optional so older bundle producers — and older
|
|
16391
|
-
// on-disk caches — that omit the field still parse; consumers read
|
|
16392
|
-
// `bundle.exceptions ?? []`.
|
|
16393
|
-
exceptions: external_exports.array(ExceptionBundleEntry).optional(),
|
|
16394
|
-
// Installed pack version, keyed by ruleId, for rules in `rules` that came
|
|
16395
|
-
// from a versioned installed pack. Optional so older backends — and older
|
|
16396
|
-
// on-disk caches — that omit the field still parse; consumers fall back to
|
|
16397
|
-
// the rule's own spec version. NOT the bundle version above — see
|
|
16398
|
-
// installedRuleset's ruleVersions for the source of truth.
|
|
16399
|
-
ruleVersions: external_exports.record(external_exports.string(), external_exports.string()).optional(),
|
|
16400
|
-
customKeywords: external_exports.array(external_exports.string()),
|
|
16401
|
-
fetchedAt: external_exports.iso.datetime()
|
|
16402
|
-
}).meta({ id: "PolicyBundle" });
|
|
16403
|
-
var OBSERVE_ONLY_CATEGORIES = ["config"];
|
|
16404
|
-
var ENFORCEABLE_CATEGORIES = DetectionCategory.options.filter((c) => !OBSERVE_ONLY_CATEGORIES.includes(c));
|
|
16405
|
-
var CATEGORY_PEAK_SEVERITY = {
|
|
16406
|
-
secret: "critical",
|
|
16407
|
-
financial: "critical",
|
|
16408
|
-
// core-financial/credit-card
|
|
16409
|
-
code_flaw: "critical",
|
|
16410
|
-
pii: "high",
|
|
16411
|
-
phi: "high",
|
|
16412
|
-
custom: "high",
|
|
16413
|
-
// user-defined; conservative
|
|
16414
|
-
code_context: "low",
|
|
16415
|
-
config: "low"
|
|
16416
|
-
// observe-only; floors to monitor regardless
|
|
16417
|
-
};
|
|
16418
|
-
function severityFloorPolicy(category) {
|
|
16419
|
-
if (OBSERVE_ONLY_CATEGORIES.includes(category)) return "monitor";
|
|
16420
|
-
const peak = CATEGORY_PEAK_SEVERITY[category];
|
|
16421
|
-
return peak === "critical" || peak === "high" ? "warn" : "monitor";
|
|
16422
|
-
}
|
|
16423
|
-
var PolicyKind = external_exports.enum(["builtin", "custom"]).meta({ id: "PolicyKind" });
|
|
16424
|
-
var KNOWN_BUILTIN_IDS = ["monitor", "warn", "redact", "block"];
|
|
16425
|
-
var BuiltinPolicyId = external_exports.enum(KNOWN_BUILTIN_IDS).meta({ id: "BuiltinPolicyId" });
|
|
16426
|
-
var BUILTIN_POLICY_SPECS = {
|
|
16427
|
-
monitor: {
|
|
16428
|
-
name: "Monitor",
|
|
16429
|
-
action: "log",
|
|
16430
|
-
description: "Log every match for audit. The request is allowed through untouched."
|
|
16431
|
-
},
|
|
16432
|
-
warn: {
|
|
16433
|
-
name: "Warn",
|
|
16434
|
-
action: "warn",
|
|
16435
|
-
description: "Allow the request, but warn the user inline before it is sent."
|
|
16436
|
-
},
|
|
16437
|
-
redact: {
|
|
16438
|
-
name: "Redact",
|
|
16439
|
-
action: "redact",
|
|
16440
|
-
description: "Automatically strip the matched value from the request, then continue."
|
|
16441
|
-
},
|
|
16442
|
-
block: {
|
|
16443
|
-
name: "Block",
|
|
16444
|
-
action: "block",
|
|
16445
|
-
description: "Refuse the request entirely whenever any rule in this detection matches."
|
|
16446
|
-
}
|
|
16447
|
-
};
|
|
16448
|
-
function builtinPolicyToAction(id) {
|
|
16449
|
-
return BUILTIN_POLICY_SPECS[id].action;
|
|
16450
|
-
}
|
|
16451
|
-
var DEFAULT_ACTIONS = Object.fromEntries(
|
|
16452
|
-
DetectionCategory.options.map((c) => [c, builtinPolicyToAction(severityFloorPolicy(c))])
|
|
16453
|
-
);
|
|
16454
|
-
var BUILTIN_POLICIES = Object.fromEntries(
|
|
16455
|
-
KNOWN_BUILTIN_IDS.map((id) => [id, { id, ...BUILTIN_POLICY_SPECS[id] }])
|
|
16456
|
-
);
|
|
16457
|
-
var UsedByItem = external_exports.object({
|
|
16458
|
-
id: external_exports.string(),
|
|
16459
|
-
name: external_exports.string(),
|
|
16460
|
-
ruleCount: external_exports.number().int().nonnegative(),
|
|
16461
|
-
enabled: external_exports.boolean()
|
|
16462
|
-
}).meta({ id: "UsedByItem" });
|
|
16463
|
-
var PolicyListItem = external_exports.object({
|
|
16464
|
-
id: external_exports.string(),
|
|
16465
|
-
kind: PolicyKind,
|
|
16466
|
-
name: external_exports.string(),
|
|
16467
|
-
enabled: external_exports.boolean(),
|
|
16468
|
-
usedByCount: external_exports.number().int().nonnegative()
|
|
16469
|
-
}).meta({ id: "PolicyListItem" });
|
|
16470
|
-
var PolicyDetail = external_exports.object({
|
|
16471
|
-
specVersion: external_exports.literal(1),
|
|
16472
|
-
id: external_exports.string(),
|
|
16473
|
-
kind: PolicyKind,
|
|
16474
|
-
name: external_exports.string(),
|
|
16475
|
-
enabled: external_exports.boolean(),
|
|
16476
|
-
description: external_exports.string(),
|
|
16477
|
-
usedBy: external_exports.array(UsedByItem)
|
|
16478
|
-
}).meta({ id: "PolicyDetail" });
|
|
16479
|
-
var PolicyStatsResponse = external_exports.object({
|
|
16480
|
-
policies: external_exports.number().int().nonnegative(),
|
|
16481
|
-
builtin: external_exports.number().int().nonnegative(),
|
|
16482
|
-
custom: external_exports.number().int().nonnegative(),
|
|
16483
|
-
detectionsGoverned: external_exports.number().int().nonnegative()
|
|
16484
|
-
}).meta({ id: "PolicyStatsResponse" });
|
|
16485
|
-
|
|
16486
|
-
// ../../packages/schema/src/zod/api.ts
|
|
16487
|
-
var LIST_QUERY_MAX_LIMIT = 200;
|
|
16488
|
-
var ListEventsQuery = external_exports.object({
|
|
16489
|
-
cursor: external_exports.string().optional(),
|
|
16490
|
-
limit: external_exports.coerce.number().int().min(1).max(LIST_QUERY_MAX_LIMIT).default(50),
|
|
16491
|
-
sourceTool: external_exports.string().optional(),
|
|
16492
|
-
kind: external_exports.string().optional(),
|
|
16493
|
-
from: external_exports.iso.datetime().optional(),
|
|
16494
|
-
to: external_exports.iso.datetime().optional()
|
|
16495
|
-
});
|
|
16496
|
-
var ListEventsResponse = external_exports.object({
|
|
16497
|
-
items: external_exports.array(Event),
|
|
16498
|
-
nextCursor: external_exports.string().nullable()
|
|
16499
|
-
}).meta({ id: "ListEventsResponse" });
|
|
16500
|
-
var IngestResponse = external_exports.object({
|
|
16501
|
-
accepted: external_exports.number().int().nonnegative(),
|
|
16502
|
-
duplicates: external_exports.number().int().nonnegative()
|
|
16503
|
-
}).meta({ id: "IngestResponse" });
|
|
16504
|
-
var ListFindingsQuery = external_exports.object({
|
|
16505
|
-
cursor: external_exports.string().optional(),
|
|
16506
|
-
limit: external_exports.coerce.number().int().min(1).max(LIST_QUERY_MAX_LIMIT).default(50),
|
|
16507
|
-
severity: external_exports.string().optional(),
|
|
16508
|
-
category: external_exports.string().optional(),
|
|
16509
|
-
eventId: external_exports.guid().optional()
|
|
16510
|
-
});
|
|
16511
|
-
var ListFindingsResponse = external_exports.object({
|
|
16512
|
-
items: external_exports.array(Finding),
|
|
16513
|
-
nextCursor: external_exports.string().nullable()
|
|
16514
|
-
}).meta({ id: "ListFindingsResponse" });
|
|
16515
|
-
var ListPoliciesResponse = external_exports.object({ items: external_exports.array(PolicyListItem) }).meta({ id: "ListPoliciesResponse" });
|
|
16516
|
-
var CreatePolicyRequest = Policy.omit({ id: true }).meta({
|
|
16517
|
-
id: "CreatePolicyRequest"
|
|
16518
|
-
});
|
|
16519
|
-
var UpdatePolicyRequest = Policy.partial().required({ id: true }).meta({ id: "UpdatePolicyRequest" });
|
|
16520
|
-
var RecordAuditEventResponse = external_exports.object({ accepted: external_exports.boolean() }).meta({ id: "RecordAuditEventResponse" });
|
|
16521
|
-
var ErrorResponse = external_exports.object({
|
|
16522
|
-
error: external_exports.object({
|
|
16523
|
-
code: external_exports.string(),
|
|
16524
|
-
message: external_exports.string(),
|
|
16525
|
-
details: external_exports.unknown().optional()
|
|
16526
|
-
})
|
|
16527
|
-
}).meta({ id: "ErrorResponse" });
|
|
16528
|
-
|
|
16529
|
-
// ../../packages/schema/src/zod/config-inventory.ts
|
|
16530
|
-
var ConfigScope = external_exports.enum(["user", "project", "local", "plugin"]);
|
|
16531
|
-
var SkillScanEntry = external_exports.object({
|
|
16532
|
-
name: external_exports.string().min(1),
|
|
16533
|
-
// The identity source: a marketplace repo for plugin skills (e.g.
|
|
16534
|
-
// 'anthropics/skills'), 'local' for personal ~/.claude/skills, or
|
|
16535
|
-
// 'project:<repo-identity>' for checked-in project skills. The surrogate keeps
|
|
16536
|
-
// a personal skill named 'pdf' from colliding with the marketplace 'pdf'.
|
|
16537
|
-
source: external_exports.string().min(1),
|
|
16538
|
-
scope: ConfigScope,
|
|
16539
|
-
pluginName: external_exports.string().optional(),
|
|
16540
|
-
// Volatile — rides the attribute bag, never the identity hash.
|
|
16541
|
-
version: external_exports.string().optional(),
|
|
16542
|
-
description: external_exports.string().optional(),
|
|
16543
|
-
// Skill directory mtime (ISO) — the "updated Nd ago" freshness signal.
|
|
16544
|
-
updatedAt: external_exports.iso.datetime().optional(),
|
|
16545
|
-
// Filesystem path — the promoted inventory `location` column.
|
|
16546
|
-
location: external_exports.string().optional()
|
|
16547
|
-
});
|
|
16548
|
-
var HookScanEntry = external_exports.object({
|
|
16549
|
-
// Hook event name (PreToolUse, PostToolUse, …). Open string, not an enum: the
|
|
16550
|
-
// set is harness-defined and grows without a schema change.
|
|
16551
|
-
event: external_exports.string().min(1),
|
|
16552
|
-
// The tool matcher ('Bash', 'Edit|Write', …). Absent = matches all tools.
|
|
16553
|
-
matcher: external_exports.string().optional(),
|
|
16554
|
-
command: external_exports.string().min(1),
|
|
16555
|
-
timeout: external_exports.number().optional(),
|
|
16556
|
-
scope: ConfigScope,
|
|
16557
|
-
pluginName: external_exports.string().optional(),
|
|
16558
|
-
// The settings file / hooks.json the entry came from.
|
|
16559
|
-
location: external_exports.string().optional()
|
|
16560
|
-
});
|
|
16561
|
-
var McpServerScanEntry = external_exports.object({
|
|
16562
|
-
// The server's config key ("github", "filesystem", …) — identity, with the
|
|
16563
|
-
// qualified scope (see mcpServerIdentityKey).
|
|
16564
|
-
name: external_exports.string().min(1),
|
|
16565
|
-
scope: ConfigScope,
|
|
16566
|
-
pluginName: external_exports.string().optional(),
|
|
16567
|
-
// The owning plugin's marketplace — part of PLUGIN-scope identity: two
|
|
16568
|
-
// marketplaces can each ship a plugin named `guard`, and without this their
|
|
16569
|
-
// same-named servers would collapse to one row (the second silently dropped,
|
|
16570
|
-
// inheriting the first's trust).
|
|
16571
|
-
marketplace: external_exports.string().optional(),
|
|
16572
|
-
// The repo identity (remote url, or the cwd for un-remoted repos) — part of
|
|
16573
|
-
// PROJECT/LOCAL-scope identity: a server named `github` in repo A and one in
|
|
16574
|
-
// repo B are different servers with different commands, and MUST NOT share a
|
|
16575
|
-
// row — a shared row would let a cloned repo's .mcp.json inherit the trust
|
|
16576
|
-
// the user granted elsewhere.
|
|
16577
|
-
project: external_exports.string().optional(),
|
|
16578
|
-
// 'stdio' when the entry carries a command; otherwise the config's `type`
|
|
16579
|
-
// ('http' / 'sse' / …). Open string — the transport set is harness-defined.
|
|
16580
|
-
transport: external_exports.string().min(1),
|
|
16581
|
-
// Volatile on purpose (unlike hook `command`): a changed command/url is drift
|
|
16582
|
-
// on a stable row — visible across config_scan snapshots and preserving the
|
|
16583
|
-
// user's trust decision — never a quiet new row. One of the two is present.
|
|
16584
|
-
// Secret-masked at collection time (the scanner runs the bundled detection
|
|
16585
|
-
// packs over both — tokens routinely ride command args and URLs).
|
|
16586
|
-
command: external_exports.string().optional(),
|
|
16587
|
-
url: external_exports.string().optional(),
|
|
16588
|
-
// Env var NAMES only, never values (the no-secrets rule).
|
|
16589
|
-
envKeys: external_exports.array(external_exports.string()).optional(),
|
|
16590
|
-
// The config file the entry came from.
|
|
16591
|
-
location: external_exports.string().optional()
|
|
16592
|
-
});
|
|
16593
|
-
var ConfigFileScanEntry = external_exports.object({
|
|
16594
|
-
// Basename (settings.json, CLAUDE.md) or dir name (commands/, agents/).
|
|
16595
|
-
name: external_exports.string().min(1),
|
|
16596
|
-
// The absolute path — identity (with scope) and the promoted `location`.
|
|
16597
|
-
path: external_exports.string().min(1),
|
|
16598
|
-
scope: ConfigScope,
|
|
16599
|
-
// Human label: "User settings", "Project memory", "Slash commands", …
|
|
16600
|
-
kind: external_exports.string().min(1),
|
|
16601
|
-
// Derived SHAPE summary — top-level key names, entry counts, line counts.
|
|
16602
|
-
// Never file content or values (memory files can carry sensitive detail).
|
|
16603
|
-
detail: external_exports.string().optional(),
|
|
16604
|
-
// Dir configs (commands/, agents/) and .mcp.json: how many entries.
|
|
16605
|
-
entryCount: external_exports.number().optional(),
|
|
16606
|
-
// File mtime (ISO) — the freshness signal.
|
|
16607
|
-
updatedAt: external_exports.iso.datetime().optional()
|
|
16608
|
-
});
|
|
16609
|
-
var ConfigScanResult = external_exports.object({
|
|
16610
|
-
scannedAt: external_exports.iso.datetime(),
|
|
16611
|
-
skills: external_exports.array(SkillScanEntry),
|
|
16612
|
-
hooks: external_exports.array(HookScanEntry),
|
|
16613
|
-
mcpServers: external_exports.array(McpServerScanEntry),
|
|
16614
|
-
configFiles: external_exports.array(ConfigFileScanEntry),
|
|
16615
|
-
errors: external_exports.array(external_exports.object({ source: external_exports.string(), reason: external_exports.string() }))
|
|
16616
|
-
});
|
|
16617
|
-
var ConfigPostureFindingInput = external_exports.object({
|
|
16618
|
-
ruleId: external_exports.string().min(1),
|
|
16619
|
-
version: external_exports.string().min(1),
|
|
16620
|
-
span: Span,
|
|
16621
|
-
// For posture rules this is the offending COMMAND (config the user already
|
|
16622
|
-
// holds locally, not captured secret content) — it is also the correlation
|
|
16623
|
-
// key the read surface matches back to a hook row.
|
|
16624
|
-
maskedMatch: external_exports.string(),
|
|
16625
|
-
actionTaken: ActionTaken,
|
|
16626
|
-
confidence: external_exports.number().min(0).max(1)
|
|
16627
|
-
});
|
|
16628
|
-
var ConfigScanRecord = external_exports.object({
|
|
16629
|
-
items: external_exports.array(InventoryInput),
|
|
16630
|
-
scanEvent: AuditEventInput,
|
|
16631
|
-
definitions: external_exports.array(InspectionDefinitionInput).optional(),
|
|
16632
|
-
findings: external_exports.array(ConfigPostureFindingInput).optional()
|
|
16633
|
-
});
|
|
16634
|
-
|
|
16635
|
-
// ../../packages/schema/src/zod/registry.ts
|
|
16636
|
-
var Namespace = external_exports.string().regex(/^[a-z][a-z0-9-]*$/);
|
|
16637
|
-
var PackId = external_exports.string().regex(/^[a-z][a-z0-9-]*$/);
|
|
16638
|
-
var SemVer = external_exports.string().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-.]+)?$/);
|
|
16639
|
-
var PublisherKind = external_exports.enum(["labs", "user", "org"]);
|
|
16640
|
-
|
|
16641
16186
|
// ../../packages/schema/src/zod/detection.ts
|
|
16642
16187
|
var OriginEnum = external_exports.enum(["library"]).meta({ id: "OriginEnum" });
|
|
16643
16188
|
var DetectionFilterEnum = external_exports.enum(["all", "library", "custom", "customized", "updates"]);
|
|
@@ -16682,81 +16227,306 @@ var ListDetectionsQuery = external_exports.object({
|
|
|
16682
16227
|
filter: DetectionFilterEnum.optional().default("all"),
|
|
16683
16228
|
q: external_exports.string().optional()
|
|
16684
16229
|
});
|
|
16685
|
-
var DetectionStats = external_exports.object({
|
|
16686
|
-
detections: external_exports.number().int().nonnegative(),
|
|
16687
|
-
rules: external_exports.number().int().nonnegative(),
|
|
16688
|
-
active: external_exports.number().int().nonnegative(),
|
|
16689
|
-
findingsLast30d: external_exports.number().int().nonnegative()
|
|
16690
|
-
}).meta({ id: "DetectionStats" });
|
|
16691
|
-
var DetectionRule = external_exports.object({
|
|
16692
|
-
id: external_exports.string(),
|
|
16693
|
-
name: external_exports.string(),
|
|
16694
|
-
category: DetectionCategory,
|
|
16695
|
-
severity: Severity,
|
|
16696
|
-
matcher: Matcher
|
|
16697
|
-
}).meta({ id: "DetectionRule" });
|
|
16698
|
-
var DetectionUpdate = external_exports.object({
|
|
16699
|
-
available: external_exports.boolean(),
|
|
16700
|
-
latestVersion: SemVer,
|
|
16701
|
-
// Rule count of the latest snapshot. Lets the update UI show a meaningful
|
|
16702
|
-
// delta ("2 rules → 14 rules") when the version did NOT change but the rule
|
|
16703
|
-
// content did — the OSS store compares content, not just version. Optional:
|
|
16704
|
-
// registry-backed updates omit it.
|
|
16705
|
-
latestRuleCount: external_exports.number().int().nonnegative().optional()
|
|
16706
|
-
}).nullable().meta({ id: "DetectionUpdate" });
|
|
16707
|
-
var DetectionDetail = external_exports.object({
|
|
16708
|
-
id: external_exports.string(),
|
|
16709
|
-
name: external_exports.string(),
|
|
16710
|
-
version: SemVer,
|
|
16711
|
-
enabled: external_exports.boolean(),
|
|
16712
|
-
origin: OriginEnum,
|
|
16713
|
-
publisher: Namespace.optional(),
|
|
16714
|
-
publisherKind: PublisherKind.optional(),
|
|
16715
|
-
ruleCount: external_exports.number().int().nonnegative(),
|
|
16716
|
-
namespace: Namespace,
|
|
16717
|
-
packId: PackId,
|
|
16718
|
-
description: external_exports.string().optional(),
|
|
16719
|
-
editedAt: external_exports.iso.datetime(),
|
|
16720
|
-
findingsLast30d: external_exports.number().int().nonnegative(),
|
|
16721
|
-
latestVersion: SemVer.nullable().optional(),
|
|
16722
|
-
update: DetectionUpdate,
|
|
16723
|
-
rules: external_exports.array(DetectionRule),
|
|
16724
|
-
modified: external_exports.boolean(),
|
|
16725
|
-
// Per-pack enforcement-policy assignment. Holds a BuiltinPolicyId ARCHETYPE
|
|
16726
|
-
// (monitor|warn|redact|block) — NOT a policies-table Policy.id guid; a
|
|
16727
|
-
// detection is a PACK, and its policy is the archetype applied to all its
|
|
16728
|
-
// rules. Absent == unassigned, which resolves to Monitor everywhere
|
|
16729
|
-
// (DEFAULT_PACK_POLICY_ID). Every enforcement surface expands it into
|
|
16730
|
-
// per-rule policies (see policyIdToAction). Typed z.string() (not
|
|
16731
|
-
// the enum) to keep the OpenAPI response tolerant of a future custom id.
|
|
16732
|
-
policyId: external_exports.string().optional()
|
|
16733
|
-
}).meta({ id: "DetectionDetail" });
|
|
16734
|
-
var LibraryItem = external_exports.object({
|
|
16735
|
-
id: external_exports.string(),
|
|
16736
|
-
name: external_exports.string(),
|
|
16737
|
-
publisher: Namespace,
|
|
16738
|
-
publisherKind: PublisherKind.optional(),
|
|
16739
|
-
// LOSSY single-category view of a pack. A pack MAY span several categories;
|
|
16740
|
-
// this carries only the canonical-first one for display. Do NOT filter/facet
|
|
16741
|
-
// on it — the library filter matches a pack's full category set (see
|
|
16742
|
-
// ListLibraryResponse.categories).
|
|
16743
|
-
category: DetectionCategory.optional(),
|
|
16744
|
-
version: SemVer,
|
|
16745
|
-
ruleCount: external_exports.number().int().nonnegative(),
|
|
16746
|
-
description: external_exports.string().optional(),
|
|
16747
|
-
updatedAt: external_exports.iso.datetime(),
|
|
16748
|
-
state: LibraryStateEnum,
|
|
16749
|
-
importedAs: external_exports.string().nullable()
|
|
16750
|
-
}).meta({ id: "LibraryItem" });
|
|
16751
|
-
var ListLibraryResponse = external_exports.object({
|
|
16752
|
-
categories: external_exports.array(DetectionCategory),
|
|
16753
|
-
items: external_exports.array(LibraryItem)
|
|
16754
|
-
}).meta({ id: "ListLibraryResponse" });
|
|
16755
|
-
var ImportDetectionRequest = external_exports.object({
|
|
16756
|
-
libraryId: external_exports.string().refine((v) => /^[^/]+\/[^/]+$/.test(v), {
|
|
16757
|
-
message: "libraryId must be in namespace/packId format"
|
|
16758
|
-
})
|
|
16759
|
-
}).meta({ id: "ImportDetectionRequest" });
|
|
16230
|
+
var DetectionStats = external_exports.object({
|
|
16231
|
+
detections: external_exports.number().int().nonnegative(),
|
|
16232
|
+
rules: external_exports.number().int().nonnegative(),
|
|
16233
|
+
active: external_exports.number().int().nonnegative(),
|
|
16234
|
+
findingsLast30d: external_exports.number().int().nonnegative()
|
|
16235
|
+
}).meta({ id: "DetectionStats" });
|
|
16236
|
+
var DetectionRule = external_exports.object({
|
|
16237
|
+
id: external_exports.string(),
|
|
16238
|
+
name: external_exports.string(),
|
|
16239
|
+
category: DetectionCategory,
|
|
16240
|
+
severity: Severity,
|
|
16241
|
+
matcher: Matcher
|
|
16242
|
+
}).meta({ id: "DetectionRule" });
|
|
16243
|
+
var DetectionUpdate = external_exports.object({
|
|
16244
|
+
available: external_exports.boolean(),
|
|
16245
|
+
latestVersion: SemVer,
|
|
16246
|
+
// Rule count of the latest snapshot. Lets the update UI show a meaningful
|
|
16247
|
+
// delta ("2 rules → 14 rules") when the version did NOT change but the rule
|
|
16248
|
+
// content did — the OSS store compares content, not just version. Optional:
|
|
16249
|
+
// registry-backed updates omit it.
|
|
16250
|
+
latestRuleCount: external_exports.number().int().nonnegative().optional()
|
|
16251
|
+
}).nullable().meta({ id: "DetectionUpdate" });
|
|
16252
|
+
var DetectionDetail = external_exports.object({
|
|
16253
|
+
id: external_exports.string(),
|
|
16254
|
+
name: external_exports.string(),
|
|
16255
|
+
version: SemVer,
|
|
16256
|
+
enabled: external_exports.boolean(),
|
|
16257
|
+
origin: OriginEnum,
|
|
16258
|
+
publisher: Namespace.optional(),
|
|
16259
|
+
publisherKind: PublisherKind.optional(),
|
|
16260
|
+
ruleCount: external_exports.number().int().nonnegative(),
|
|
16261
|
+
namespace: Namespace,
|
|
16262
|
+
packId: PackId,
|
|
16263
|
+
description: external_exports.string().optional(),
|
|
16264
|
+
editedAt: external_exports.iso.datetime(),
|
|
16265
|
+
findingsLast30d: external_exports.number().int().nonnegative(),
|
|
16266
|
+
latestVersion: SemVer.nullable().optional(),
|
|
16267
|
+
update: DetectionUpdate,
|
|
16268
|
+
rules: external_exports.array(DetectionRule),
|
|
16269
|
+
modified: external_exports.boolean(),
|
|
16270
|
+
// Per-pack enforcement-policy assignment. Holds a BuiltinPolicyId ARCHETYPE
|
|
16271
|
+
// (monitor|warn|redact|block) — NOT a policies-table Policy.id guid; a
|
|
16272
|
+
// detection is a PACK, and its policy is the archetype applied to all its
|
|
16273
|
+
// rules. Absent == unassigned, which resolves to Monitor everywhere
|
|
16274
|
+
// (DEFAULT_PACK_POLICY_ID). Every enforcement surface expands it into
|
|
16275
|
+
// per-rule policies (see policyIdToAction). Typed z.string() (not
|
|
16276
|
+
// the enum) to keep the OpenAPI response tolerant of a future custom id.
|
|
16277
|
+
policyId: external_exports.string().optional()
|
|
16278
|
+
}).meta({ id: "DetectionDetail" });
|
|
16279
|
+
var LibraryItem = external_exports.object({
|
|
16280
|
+
id: external_exports.string(),
|
|
16281
|
+
name: external_exports.string(),
|
|
16282
|
+
publisher: Namespace,
|
|
16283
|
+
publisherKind: PublisherKind.optional(),
|
|
16284
|
+
// LOSSY single-category view of a pack. A pack MAY span several categories;
|
|
16285
|
+
// this carries only the canonical-first one for display. Do NOT filter/facet
|
|
16286
|
+
// on it — the library filter matches a pack's full category set (see
|
|
16287
|
+
// ListLibraryResponse.categories).
|
|
16288
|
+
category: DetectionCategory.optional(),
|
|
16289
|
+
version: SemVer,
|
|
16290
|
+
ruleCount: external_exports.number().int().nonnegative(),
|
|
16291
|
+
description: external_exports.string().optional(),
|
|
16292
|
+
updatedAt: external_exports.iso.datetime(),
|
|
16293
|
+
state: LibraryStateEnum,
|
|
16294
|
+
importedAs: external_exports.string().nullable()
|
|
16295
|
+
}).meta({ id: "LibraryItem" });
|
|
16296
|
+
var ListLibraryResponse = external_exports.object({
|
|
16297
|
+
categories: external_exports.array(DetectionCategory),
|
|
16298
|
+
items: external_exports.array(LibraryItem)
|
|
16299
|
+
}).meta({ id: "ListLibraryResponse" });
|
|
16300
|
+
var ImportDetectionRequest = external_exports.object({
|
|
16301
|
+
libraryId: external_exports.string().refine((v) => /^[^/]+\/[^/]+$/.test(v), {
|
|
16302
|
+
message: "libraryId must be in namespace/packId format"
|
|
16303
|
+
})
|
|
16304
|
+
}).meta({ id: "ImportDetectionRequest" });
|
|
16305
|
+
|
|
16306
|
+
// ../../packages/schema/src/zod/inventory.ts
|
|
16307
|
+
var AssetType = external_exports.enum(["project", "skill", "mcp", "hook", "config"]).meta({ id: "AssetType" });
|
|
16308
|
+
var AccessLevel = external_exports.enum(["open", "approved", "blocked"]).meta({ id: "AccessLevel" });
|
|
16309
|
+
var Origin = external_exports.enum(["source", "public-dep", "vendored", "config", "data", "docs", "generated"]).meta({ id: "Origin" });
|
|
16310
|
+
var TrustLevel = external_exports.enum(["known-good", "risky", "unapproved"]).meta({ id: "TrustLevel" });
|
|
16311
|
+
var Flag = external_exports.enum(["update", "stale", "conflict", "unknown", "change", "untracked", "risk", "findings"]).meta({ id: "Flag" });
|
|
16312
|
+
var Visibility = external_exports.enum(["public", "private"]).meta({ id: "Visibility" });
|
|
16313
|
+
var HarnessEventKind = external_exports.enum(["block", "redact", "warn"]).meta({ id: "HarnessEventKind" });
|
|
16314
|
+
var HarnessId = Harness.extract(["ClaudeCode", "Cursor", "Codex", "Antigravity"]).meta({
|
|
16315
|
+
id: "HarnessId"
|
|
16316
|
+
});
|
|
16317
|
+
var AccessCounts = external_exports.object({
|
|
16318
|
+
open: external_exports.number().int().nonnegative(),
|
|
16319
|
+
approved: external_exports.number().int().nonnegative(),
|
|
16320
|
+
blocked: external_exports.number().int().nonnegative(),
|
|
16321
|
+
total: external_exports.number().int().nonnegative()
|
|
16322
|
+
}).meta({ id: "AccessCounts" });
|
|
16323
|
+
var AssetSummary = external_exports.object({
|
|
16324
|
+
id: external_exports.string(),
|
|
16325
|
+
type: AssetType,
|
|
16326
|
+
name: external_exports.string(),
|
|
16327
|
+
sub: external_exports.string(),
|
|
16328
|
+
flags: external_exports.array(Flag),
|
|
16329
|
+
/** MCP servers only — omitted for all other types. */
|
|
16330
|
+
trust: TrustLevel.optional()
|
|
16331
|
+
}).meta({ id: "AssetSummary" });
|
|
16332
|
+
var ProjectSummary = external_exports.object({
|
|
16333
|
+
id: external_exports.string(),
|
|
16334
|
+
name: external_exports.string(),
|
|
16335
|
+
repo: external_exports.string(),
|
|
16336
|
+
visibility: Visibility,
|
|
16337
|
+
language: external_exports.string(),
|
|
16338
|
+
policyDefault: AccessLevel,
|
|
16339
|
+
updatedAt: external_exports.iso.datetime(),
|
|
16340
|
+
accessCounts: AccessCounts,
|
|
16341
|
+
findingsCount: external_exports.number().int().nonnegative()
|
|
16342
|
+
}).meta({ id: "ProjectSummary" });
|
|
16343
|
+
var HarnessCategory = external_exports.object({
|
|
16344
|
+
/** One of config/skill/mcp/hook — never project (enforced at service layer). */
|
|
16345
|
+
type: AssetType,
|
|
16346
|
+
assets: external_exports.array(AssetSummary)
|
|
16347
|
+
});
|
|
16348
|
+
var HarnessSummary = external_exports.object({
|
|
16349
|
+
id: HarnessId,
|
|
16350
|
+
label: external_exports.string(),
|
|
16351
|
+
kind: external_exports.string(),
|
|
16352
|
+
version: external_exports.string(),
|
|
16353
|
+
sessions: external_exports.number().int().nonnegative(),
|
|
16354
|
+
assetCount: external_exports.number().int().nonnegative(),
|
|
16355
|
+
flagCount: external_exports.number().int().nonnegative(),
|
|
16356
|
+
projects: external_exports.array(ProjectSummary),
|
|
16357
|
+
categories: external_exports.array(HarnessCategory)
|
|
16358
|
+
}).meta({ id: "HarnessSummary" });
|
|
16359
|
+
var ListHarnessesResponse = external_exports.object({ items: external_exports.array(HarnessSummary) }).meta({ id: "ListHarnessesResponse" });
|
|
16360
|
+
var AssetGroup = external_exports.object({
|
|
16361
|
+
/** Group key — never project (enforced at service layer). */
|
|
16362
|
+
type: AssetType,
|
|
16363
|
+
total: external_exports.number().int().nonnegative(),
|
|
16364
|
+
/**
|
|
16365
|
+
* MCP group only — omitted for all other types.
|
|
16366
|
+
* Partial: only TrustLevel keys with non-zero counts are included.
|
|
16367
|
+
* Strict: unknown keys are rejected — only TrustLevel values are valid keys.
|
|
16368
|
+
*/
|
|
16369
|
+
trustRollup: external_exports.object({
|
|
16370
|
+
"known-good": external_exports.number().int().nonnegative(),
|
|
16371
|
+
risky: external_exports.number().int().nonnegative(),
|
|
16372
|
+
unapproved: external_exports.number().int().nonnegative()
|
|
16373
|
+
}).partial().strict().optional(),
|
|
16374
|
+
/**
|
|
16375
|
+
* Partial: only Flag keys with non-zero counts are included.
|
|
16376
|
+
* Strict: unknown keys are rejected — only Flag values are valid keys.
|
|
16377
|
+
*/
|
|
16378
|
+
flagRollup: external_exports.object({
|
|
16379
|
+
update: external_exports.number().int().nonnegative(),
|
|
16380
|
+
stale: external_exports.number().int().nonnegative(),
|
|
16381
|
+
conflict: external_exports.number().int().nonnegative(),
|
|
16382
|
+
unknown: external_exports.number().int().nonnegative(),
|
|
16383
|
+
change: external_exports.number().int().nonnegative(),
|
|
16384
|
+
untracked: external_exports.number().int().nonnegative(),
|
|
16385
|
+
risk: external_exports.number().int().nonnegative(),
|
|
16386
|
+
findings: external_exports.number().int().nonnegative()
|
|
16387
|
+
}).partial().strict(),
|
|
16388
|
+
items: external_exports.array(AssetSummary)
|
|
16389
|
+
}).meta({ id: "AssetGroup" });
|
|
16390
|
+
var ListAssetsResponse = external_exports.object({ groups: external_exports.array(AssetGroup) }).meta({ id: "ListAssetsResponse" });
|
|
16391
|
+
var McpTool = external_exports.object({
|
|
16392
|
+
name: external_exports.string(),
|
|
16393
|
+
signature: external_exports.string(),
|
|
16394
|
+
description: external_exports.string(),
|
|
16395
|
+
write: external_exports.boolean(),
|
|
16396
|
+
/** Non-null string when tool is dangerous / blocked; null otherwise. */
|
|
16397
|
+
risk: external_exports.string().nullable()
|
|
16398
|
+
}).meta({ id: "McpTool" });
|
|
16399
|
+
var AssetFindingRef = external_exports.object({
|
|
16400
|
+
id: external_exports.string(),
|
|
16401
|
+
title: external_exports.string(),
|
|
16402
|
+
note: external_exports.string()
|
|
16403
|
+
});
|
|
16404
|
+
var AssetDetail = AssetSummary.extend({
|
|
16405
|
+
/** string | null — null when no description is available. */
|
|
16406
|
+
description: external_exports.string().nullable(),
|
|
16407
|
+
/** trustLevel | null — null for non-MCP assets. */
|
|
16408
|
+
trust: TrustLevel.nullable(),
|
|
16409
|
+
/** Type-specific raw key/values — FE renders the grid. */
|
|
16410
|
+
meta: external_exports.record(external_exports.string(), external_exports.unknown()),
|
|
16411
|
+
/** always present — object when there is an active finding, null when absent. */
|
|
16412
|
+
finding: AssetFindingRef.nullable(),
|
|
16413
|
+
/** MCP exposed-tools list — omitted for non-mcp. */
|
|
16414
|
+
tools: external_exports.array(McpTool).optional()
|
|
16415
|
+
}).meta({ id: "AssetDetail" });
|
|
16416
|
+
var ListProjectsResponse = external_exports.object({ items: external_exports.array(ProjectSummary) }).meta({ id: "ListProjectsResponse" });
|
|
16417
|
+
var InventoryStats = external_exports.object({
|
|
16418
|
+
/** Total assets/projects with ≥1 flag or finding (drives the attention header chip). */
|
|
16419
|
+
attention: external_exports.number().int().nonnegative(),
|
|
16420
|
+
byType: external_exports.object({
|
|
16421
|
+
project: external_exports.number().int().nonnegative(),
|
|
16422
|
+
skill: external_exports.number().int().nonnegative(),
|
|
16423
|
+
mcp: external_exports.number().int().nonnegative(),
|
|
16424
|
+
hook: external_exports.number().int().nonnegative(),
|
|
16425
|
+
config: external_exports.number().int().nonnegative()
|
|
16426
|
+
}),
|
|
16427
|
+
harnesses: external_exports.number().int().nonnegative(),
|
|
16428
|
+
mcpTrust: external_exports.object({
|
|
16429
|
+
"known-good": external_exports.number().int().nonnegative(),
|
|
16430
|
+
risky: external_exports.number().int().nonnegative(),
|
|
16431
|
+
unapproved: external_exports.number().int().nonnegative()
|
|
16432
|
+
})
|
|
16433
|
+
}).meta({ id: "InventoryStats" });
|
|
16434
|
+
var FileSummary = external_exports.object({
|
|
16435
|
+
path: external_exports.string(),
|
|
16436
|
+
name: external_exports.string(),
|
|
16437
|
+
origin: Origin,
|
|
16438
|
+
/** Effective access (override applied). */
|
|
16439
|
+
access: AccessLevel,
|
|
16440
|
+
/** True when a file_access_override differs from the computed default. */
|
|
16441
|
+
isCustom: external_exports.boolean(),
|
|
16442
|
+
findings: external_exports.number().int().nonnegative(),
|
|
16443
|
+
/** When the file was auto-blocked by a detection; null when not blocked. */
|
|
16444
|
+
blockedAt: external_exports.iso.datetime().nullable().optional(),
|
|
16445
|
+
/** Why the file was blocked; null when absent. */
|
|
16446
|
+
note: external_exports.string().nullable().optional()
|
|
16447
|
+
}).meta({ id: "FileSummary" });
|
|
16448
|
+
var FolderSummary = external_exports.object({
|
|
16449
|
+
name: external_exports.string(),
|
|
16450
|
+
path: external_exports.string(),
|
|
16451
|
+
/** Rollup of effective access across all descendants. */
|
|
16452
|
+
accessCounts: AccessCounts
|
|
16453
|
+
}).meta({ id: "FolderSummary" });
|
|
16454
|
+
var ProjectTreeResponse = external_exports.object({
|
|
16455
|
+
project: external_exports.object({
|
|
16456
|
+
id: external_exports.string(),
|
|
16457
|
+
repo: external_exports.string(),
|
|
16458
|
+
visibility: Visibility
|
|
16459
|
+
}),
|
|
16460
|
+
path: external_exports.string(),
|
|
16461
|
+
/** Browse mode: one-level folders at the current path. Omitted in search mode. */
|
|
16462
|
+
folders: external_exports.array(FolderSummary).optional(),
|
|
16463
|
+
files: external_exports.array(FileSummary)
|
|
16464
|
+
}).meta({ id: "ProjectTreeResponse" });
|
|
16465
|
+
var FileDetail = FileSummary.extend({
|
|
16466
|
+
project: external_exports.object({
|
|
16467
|
+
repo: external_exports.string(),
|
|
16468
|
+
visibility: Visibility,
|
|
16469
|
+
language: external_exports.string(),
|
|
16470
|
+
policyDefault: AccessLevel,
|
|
16471
|
+
updatedAt: external_exports.iso.datetime()
|
|
16472
|
+
}),
|
|
16473
|
+
findingsRefs: external_exports.array(external_exports.object({ id: external_exports.string(), title: external_exports.string() }))
|
|
16474
|
+
}).meta({ id: "FileDetail" });
|
|
16475
|
+
var SetFileAccessBody = external_exports.object({
|
|
16476
|
+
path: external_exports.string(),
|
|
16477
|
+
access: AccessLevel
|
|
16478
|
+
}).meta({ id: "SetFileAccessBody" });
|
|
16479
|
+
var SetFileAccessResponse = external_exports.object({
|
|
16480
|
+
file: FileSummary,
|
|
16481
|
+
accessCounts: AccessCounts
|
|
16482
|
+
}).meta({ id: "SetFileAccessResponse" });
|
|
16483
|
+
var SetMcpTrustBody = external_exports.object({ trust: TrustLevel }).meta({ id: "SetMcpTrustBody" });
|
|
16484
|
+
var HarnessEventItem = external_exports.object({
|
|
16485
|
+
kind: HarnessEventKind,
|
|
16486
|
+
title: external_exports.string(),
|
|
16487
|
+
detail: external_exports.string(),
|
|
16488
|
+
occurredAt: external_exports.iso.datetime(),
|
|
16489
|
+
findingId: external_exports.string().nullable().optional()
|
|
16490
|
+
}).meta({ id: "HarnessEventItem" });
|
|
16491
|
+
var HarnessEventsResponse = external_exports.object({
|
|
16492
|
+
counts: external_exports.object({
|
|
16493
|
+
block: external_exports.number().int().nonnegative(),
|
|
16494
|
+
redact: external_exports.number().int().nonnegative(),
|
|
16495
|
+
warn: external_exports.number().int().nonnegative()
|
|
16496
|
+
}),
|
|
16497
|
+
items: external_exports.array(HarnessEventItem)
|
|
16498
|
+
}).meta({ id: "HarnessEventsResponse" });
|
|
16499
|
+
var RescanResponse = external_exports.object({
|
|
16500
|
+
jobId: external_exports.string(),
|
|
16501
|
+
startedAt: external_exports.iso.datetime()
|
|
16502
|
+
}).meta({ id: "RescanResponse" });
|
|
16503
|
+
var ConnectProjectBody = external_exports.object({ repo: external_exports.string() }).meta({ id: "ConnectProjectBody" });
|
|
16504
|
+
var ListAssetsQuery = external_exports.object({
|
|
16505
|
+
/** Filter by one or more AssetType values; absent means all types. */
|
|
16506
|
+
type: external_exports.array(AssetType).optional(),
|
|
16507
|
+
/** Free-text search term. */
|
|
16508
|
+
q: external_exports.string().optional()
|
|
16509
|
+
});
|
|
16510
|
+
var GetProjectTreeQuery = external_exports.object({
|
|
16511
|
+
/** Subtree root path; defaults to repository root when absent. */
|
|
16512
|
+
path: external_exports.string().optional(),
|
|
16513
|
+
/** Free-text filter applied to file paths. */
|
|
16514
|
+
q: external_exports.string().optional(),
|
|
16515
|
+
/**
|
|
16516
|
+
* Special listing mode. `blocked` returns every effectively-blocked, auto-blocked
|
|
16517
|
+
* file across the whole repo (folders omitted, most-recent first), ignoring
|
|
16518
|
+
* `path`/`q` — powers the project-wide "recently blocked" strip.
|
|
16519
|
+
*/
|
|
16520
|
+
filter: external_exports.enum(["blocked"]).optional()
|
|
16521
|
+
});
|
|
16522
|
+
var GetProjectFileQuery = external_exports.object({
|
|
16523
|
+
/** Repository-relative file path; absent or empty → 400. */
|
|
16524
|
+
path: external_exports.string()
|
|
16525
|
+
});
|
|
16526
|
+
var GetHarnessEventsQuery = external_exports.object({
|
|
16527
|
+
/** Maximum number of events to return. Range: 1–50; default: 7. */
|
|
16528
|
+
limit: external_exports.coerce.number().int().min(1).max(50).default(7)
|
|
16529
|
+
});
|
|
16760
16530
|
|
|
16761
16531
|
// ../../packages/schema/src/zod/shares.ts
|
|
16762
16532
|
var DestinationKind = external_exports.enum(["provider", "internal", "external", "ip"]).meta({ id: "DestinationKind" });
|
|
@@ -16892,77 +16662,198 @@ var ListShareDestinationsQuery = external_exports.object({
|
|
|
16892
16662
|
*/
|
|
16893
16663
|
review: external_exports.stringbool().default(false)
|
|
16894
16664
|
});
|
|
16895
|
-
var ExportSharesQuery = external_exports.object({
|
|
16896
|
-
format: external_exports.enum(["csv", "json"]).default("csv"),
|
|
16897
|
-
q: external_exports.string().optional(),
|
|
16898
|
-
kind: external_exports.array(DestinationKind).optional()
|
|
16665
|
+
var ExportSharesQuery = external_exports.object({
|
|
16666
|
+
format: external_exports.enum(["csv", "json"]).default("csv"),
|
|
16667
|
+
q: external_exports.string().optional(),
|
|
16668
|
+
kind: external_exports.array(DestinationKind).optional()
|
|
16669
|
+
});
|
|
16670
|
+
|
|
16671
|
+
// ../../packages/schema/src/zod/egress-extraction.ts
|
|
16672
|
+
var EgressEcosystem = external_exports.enum(["npm", "pypi", "go", "maven", "rubygems", "cargo", "composer", "nuget"]).meta({ id: "EgressEcosystem" });
|
|
16673
|
+
var ProviderRegistryEntry = external_exports.object({
|
|
16674
|
+
id: external_exports.string(),
|
|
16675
|
+
name: external_exports.string(),
|
|
16676
|
+
category: external_exports.string(),
|
|
16677
|
+
/** Suffix-matched: 'stripe.com' matches api.stripe.com, never evilstripe.com. */
|
|
16678
|
+
hostSuffixes: external_exports.array(external_exports.string()).min(1),
|
|
16679
|
+
/** Canonical API base URL recorded for manifest-derived (method 'SDK') endpoints. */
|
|
16680
|
+
apiBase: external_exports.string(),
|
|
16681
|
+
/** Most-sensitive first; index 0 becomes the endpoint dataClass. */
|
|
16682
|
+
defaultDataClasses: external_exports.array(DataClass).min(1),
|
|
16683
|
+
/** SDK identifiers per ecosystem ('go' prefix-matched by path, 'maven' by group-id prefix). */
|
|
16684
|
+
sdks: external_exports.partialRecord(EgressEcosystem, external_exports.array(external_exports.string()))
|
|
16685
|
+
}).meta({ id: "ProviderRegistryEntry" });
|
|
16686
|
+
var EgressCallSiteHit = external_exports.object({
|
|
16687
|
+
file: external_exports.string(),
|
|
16688
|
+
line: external_exports.number().int().positive(),
|
|
16689
|
+
snippet: external_exports.string(),
|
|
16690
|
+
dynamic: external_exports.boolean(),
|
|
16691
|
+
vendored: external_exports.boolean()
|
|
16692
|
+
}).meta({ id: "EgressCallSiteHit" });
|
|
16693
|
+
var ResolvedEgressHit = external_exports.object({
|
|
16694
|
+
host: external_exports.string(),
|
|
16695
|
+
kind: DestinationKind,
|
|
16696
|
+
name: external_exports.string(),
|
|
16697
|
+
category: external_exports.string(),
|
|
16698
|
+
trust: ShareTrustLevel,
|
|
16699
|
+
network: DestinationNetwork.nullable(),
|
|
16700
|
+
method: HttpMethod,
|
|
16701
|
+
transport: Transport,
|
|
16702
|
+
url: external_exports.string(),
|
|
16703
|
+
template: external_exports.boolean(),
|
|
16704
|
+
dataClass: DataClass,
|
|
16705
|
+
site: EgressCallSiteHit
|
|
16706
|
+
}).meta({ id: "ResolvedEgressHit" });
|
|
16707
|
+
var EgressReconcile = external_exports.discriminatedUnion("mode", [
|
|
16708
|
+
external_exports.object({ mode: external_exports.literal("walk"), walkedPrefix: external_exports.string() }),
|
|
16709
|
+
external_exports.object({
|
|
16710
|
+
mode: external_exports.literal("ledger"),
|
|
16711
|
+
scannedFiles: external_exports.array(external_exports.string()),
|
|
16712
|
+
deletedFiles: external_exports.array(external_exports.string())
|
|
16713
|
+
})
|
|
16714
|
+
]).meta({ id: "EgressReconcile" });
|
|
16715
|
+
var RecordProjectEgressInput = external_exports.object({
|
|
16716
|
+
/** Stable reconcile key: 'git:<repo identity>' or 'path:<abs root>' (non-git). */
|
|
16717
|
+
projectKey: external_exports.string().min(1),
|
|
16718
|
+
/** Display name only — never keys reconciliation. */
|
|
16719
|
+
project: external_exports.string(),
|
|
16720
|
+
projectId: external_exports.string().nullable(),
|
|
16721
|
+
reconcile: EgressReconcile,
|
|
16722
|
+
hits: external_exports.array(ResolvedEgressHit)
|
|
16723
|
+
}).meta({ id: "RecordProjectEgressInput" });
|
|
16724
|
+
var EgressWriteSummary = external_exports.object({
|
|
16725
|
+
destinations: external_exports.number().int().nonnegative(),
|
|
16726
|
+
endpoints: external_exports.number().int().nonnegative(),
|
|
16727
|
+
callSites: external_exports.number().int().nonnegative(),
|
|
16728
|
+
truncated: external_exports.boolean(),
|
|
16729
|
+
/**
|
|
16730
|
+
* Files the cap dropped whole. Their stored rows were left untouched, so a
|
|
16731
|
+
* ledger-keeping caller must withhold their ledger entries and read them
|
|
16732
|
+
* again next scan.
|
|
16733
|
+
*/
|
|
16734
|
+
droppedFiles: external_exports.array(external_exports.string()).default([])
|
|
16735
|
+
}).meta({ id: "EgressWriteSummary" });
|
|
16736
|
+
|
|
16737
|
+
// ../../packages/schema/src/zod/event.ts
|
|
16738
|
+
var EventKind = external_exports.enum(["prompt", "response", "code_change", "tool_use"]).meta({ id: "EventKind" });
|
|
16739
|
+
var CAPTURE_EVENT_TYPES_SQL = EventKind.options.map((k) => `'${k}'`).join(",");
|
|
16740
|
+
var EventMetadata = external_exports.object({
|
|
16741
|
+
sessionId: external_exports.string().optional(),
|
|
16742
|
+
repo: external_exports.string().optional(),
|
|
16743
|
+
filePath: external_exports.string().optional(),
|
|
16744
|
+
// The host tool whose input/output was scanned (e.g. 'Bash', 'WebFetch'),
|
|
16745
|
+
// set by the tool-scanning hooks. The tool NAME only — never the tool's
|
|
16746
|
+
// arguments or output, which can carry the very value a finding masked
|
|
16747
|
+
// (metadata is stored unredacted). Gives findings on non-file captures a
|
|
16748
|
+
// display location ("via Bash") when no filePath exists.
|
|
16749
|
+
toolName: external_exports.string().optional(),
|
|
16750
|
+
// Set (true) by the worktree scanner when the file is excluded by the
|
|
16751
|
+
// repo's .gitignore. Gitignored files ARE still scanned — local scratch and
|
|
16752
|
+
// generated code can leak real secrets — but the provenance is recorded so
|
|
16753
|
+
// policy/dashboards can treat those findings as informational rather than
|
|
16754
|
+
// blocking. Omitted (not false) for tracked files and non-scan events.
|
|
16755
|
+
gitignored: external_exports.boolean().optional(),
|
|
16756
|
+
// Set (true) ONLY when the event's `content` is the COMPLETE file at
|
|
16757
|
+
// capture time (a worktree scan reading from disk). Hook-captured edits
|
|
16758
|
+
// (e.g. an Edit tool's new_string) are partial fragments and MUST NOT set
|
|
16759
|
+
// this. The resolver-on-ingest keys its fixed-at-source dropout
|
|
16760
|
+
// diff on this marker: only a whole-file snapshot can prove a previously
|
|
16761
|
+
// open finding is gone; a fragment's absence proves nothing (the secret
|
|
16762
|
+
// may live outside the hunk). Omitted (not false) for fragments and
|
|
16763
|
+
// non-scan events, so pre-marker clients safely default to the
|
|
16764
|
+
// non-authoritative path.
|
|
16765
|
+
wholeFile: external_exports.boolean().optional(),
|
|
16766
|
+
model: external_exports.string().optional(),
|
|
16767
|
+
turnIndex: external_exports.number().int().nonnegative().optional(),
|
|
16768
|
+
// Distributed-tracing correlation. `correlationId` ties a recorded event back
|
|
16769
|
+
// to the request that captured/ingested it (a UUID, generated independently of
|
|
16770
|
+
// the trace id); `traceId` is the W3C trace id (32 lowercase hex chars) of the
|
|
16771
|
+
// originating span when telemetry is enabled. Both optional + backward
|
|
16772
|
+
// compatible — populated by the plugin (see @akasecurity/plugin-sdk).
|
|
16773
|
+
correlationId: external_exports.uuid().optional(),
|
|
16774
|
+
traceId: external_exports.string().regex(/^[0-9a-f]{32}$/).optional(),
|
|
16775
|
+
// Ids of the detection exceptions that downgraded findings in this capture
|
|
16776
|
+
// to 'allow' — the enforcement audit trail's link back to the grant that
|
|
16777
|
+
// authorized the bypass. Absent on captures where no exception applied.
|
|
16778
|
+
exceptionIds: external_exports.array(external_exports.guid()).optional()
|
|
16779
|
+
}).meta({ id: "EventMetadata" });
|
|
16780
|
+
var Event = external_exports.object({
|
|
16781
|
+
id: external_exports.guid(),
|
|
16782
|
+
sourceTool: SourceTool,
|
|
16783
|
+
kind: EventKind,
|
|
16784
|
+
occurredAt: external_exports.iso.datetime(),
|
|
16785
|
+
contentHash: external_exports.string(),
|
|
16786
|
+
content: external_exports.string(),
|
|
16787
|
+
metadata: EventMetadata.optional()
|
|
16788
|
+
}).meta({ id: "Event" });
|
|
16789
|
+
var IngestEvent = Event.meta({ id: "IngestEvent" });
|
|
16790
|
+
var IngestBatch = external_exports.object({
|
|
16791
|
+
events: external_exports.array(IngestEvent).min(1).max(100),
|
|
16792
|
+
// Dedup policy for this batch. Id-dedup ALWAYS applies. 'content-hash'
|
|
16793
|
+
// additionally rejects any event whose contentHash the store has already
|
|
16794
|
+
// recorded — for re-runnable bulk ingest (worktree scan, transcript
|
|
16795
|
+
// backfill), where a re-run mints fresh event ids for identical content and
|
|
16796
|
+
// would otherwise accumulate duplicates. Live hook traffic must NOT set it:
|
|
16797
|
+
// two genuinely separate prompts can be byte-identical and both belong on
|
|
16798
|
+
// the timeline.
|
|
16799
|
+
dedupe: external_exports.literal("content-hash").optional()
|
|
16800
|
+
}).meta({ id: "IngestBatch" });
|
|
16801
|
+
|
|
16802
|
+
// ../../packages/schema/src/zod/exception.ts
|
|
16803
|
+
var ExceptionScope = external_exports.enum(["once", "temporary", "permanent"]);
|
|
16804
|
+
var ExceptionConditions = external_exports.object({
|
|
16805
|
+
repo: external_exports.string().optional(),
|
|
16806
|
+
sourceTool: external_exports.string().optional(),
|
|
16807
|
+
provider: external_exports.string().optional()
|
|
16808
|
+
}).strict();
|
|
16809
|
+
var ExceptionCapability = external_exports.enum(["suppress", "reveal_to_model"]);
|
|
16810
|
+
var DetectionException = external_exports.object({
|
|
16811
|
+
id: external_exports.guid(),
|
|
16812
|
+
ruleId: external_exports.string(),
|
|
16813
|
+
// Denormalized from the rule, for reporting — never matched on.
|
|
16814
|
+
category: DetectionCategory,
|
|
16815
|
+
// HMAC-SHA256 hex of the raw match under a machine-local key: a KEYED
|
|
16816
|
+
// fingerprint, never the raw value, and never reversible. Matching recomputes
|
|
16817
|
+
// the fingerprint from a fresh capture; the value itself is never stored.
|
|
16818
|
+
// Shape-constrained so a malformed — or accidentally raw — value is rejected
|
|
16819
|
+
// at the boundary rather than persisted.
|
|
16820
|
+
valueFingerprint: external_exports.string().regex(/^[0-9a-f]{64}$/),
|
|
16821
|
+
// Version of the fingerprint key the grant was written under; a rotated key
|
|
16822
|
+
// invalidates old grants rather than silently mismatching them.
|
|
16823
|
+
keyVersion: external_exports.number().int().positive(),
|
|
16824
|
+
// maskMatch() preview of the approved value — never the raw value.
|
|
16825
|
+
maskedValue: external_exports.string(),
|
|
16826
|
+
capability: ExceptionCapability.default("suppress"),
|
|
16827
|
+
scope: ExceptionScope,
|
|
16828
|
+
expiresAt: external_exports.iso.datetime().nullable(),
|
|
16829
|
+
maxUses: external_exports.number().int().positive().nullable(),
|
|
16830
|
+
useCount: external_exports.number().int().nonnegative(),
|
|
16831
|
+
lastUsedAt: external_exports.iso.datetime().nullable(),
|
|
16832
|
+
// Mandatory: every grant carries the human reason it exists.
|
|
16833
|
+
justification: external_exports.string().min(1),
|
|
16834
|
+
conditions: ExceptionConditions.nullable(),
|
|
16835
|
+
createdBy: external_exports.string(),
|
|
16836
|
+
createdVia: external_exports.enum(["cli-approve", "cli-add", "web-approve", "web-add", "api", "setup-triage"]),
|
|
16837
|
+
createdAt: external_exports.iso.datetime(),
|
|
16838
|
+
updatedAt: external_exports.iso.datetime(),
|
|
16839
|
+
// Revocation is terminal and retained — consumed/expired/revoked rows are
|
|
16840
|
+
// audit evidence; nothing in the exception lifecycle hard-deletes.
|
|
16841
|
+
revokedAt: external_exports.iso.datetime().nullable(),
|
|
16842
|
+
revokedBy: external_exports.string().nullable(),
|
|
16843
|
+
revokeReason: external_exports.string().nullable()
|
|
16844
|
+
});
|
|
16845
|
+
var ExceptionBundleEntry = DetectionException.pick({
|
|
16846
|
+
id: true,
|
|
16847
|
+
ruleId: true,
|
|
16848
|
+
valueFingerprint: true,
|
|
16849
|
+
keyVersion: true,
|
|
16850
|
+
capability: true,
|
|
16851
|
+
expiresAt: true,
|
|
16852
|
+
maxUses: true,
|
|
16853
|
+
useCount: true,
|
|
16854
|
+
conditions: true
|
|
16899
16855
|
});
|
|
16900
|
-
|
|
16901
|
-
// ../../packages/schema/src/zod/egress-extraction.ts
|
|
16902
|
-
var EgressEcosystem = external_exports.enum(["npm", "pypi", "go", "maven", "rubygems", "cargo", "composer", "nuget"]).meta({ id: "EgressEcosystem" });
|
|
16903
|
-
var ProviderRegistryEntry = external_exports.object({
|
|
16904
|
-
id: external_exports.string(),
|
|
16905
|
-
name: external_exports.string(),
|
|
16906
|
-
category: external_exports.string(),
|
|
16907
|
-
/** Suffix-matched: 'stripe.com' matches api.stripe.com, never evilstripe.com. */
|
|
16908
|
-
hostSuffixes: external_exports.array(external_exports.string()).min(1),
|
|
16909
|
-
/** Canonical API base URL recorded for manifest-derived (method 'SDK') endpoints. */
|
|
16910
|
-
apiBase: external_exports.string(),
|
|
16911
|
-
/** Most-sensitive first; index 0 becomes the endpoint dataClass. */
|
|
16912
|
-
defaultDataClasses: external_exports.array(DataClass).min(1),
|
|
16913
|
-
/** SDK identifiers per ecosystem ('go' prefix-matched by path, 'maven' by group-id prefix). */
|
|
16914
|
-
sdks: external_exports.partialRecord(EgressEcosystem, external_exports.array(external_exports.string()))
|
|
16915
|
-
}).meta({ id: "ProviderRegistryEntry" });
|
|
16916
|
-
var EgressCallSiteHit = external_exports.object({
|
|
16917
|
-
file: external_exports.string(),
|
|
16918
|
-
line: external_exports.number().int().positive(),
|
|
16919
|
-
snippet: external_exports.string(),
|
|
16920
|
-
dynamic: external_exports.boolean(),
|
|
16921
|
-
vendored: external_exports.boolean()
|
|
16922
|
-
}).meta({ id: "EgressCallSiteHit" });
|
|
16923
|
-
var ResolvedEgressHit = external_exports.object({
|
|
16924
|
-
host: external_exports.string(),
|
|
16925
|
-
kind: DestinationKind,
|
|
16926
|
-
name: external_exports.string(),
|
|
16927
|
-
category: external_exports.string(),
|
|
16928
|
-
trust: ShareTrustLevel,
|
|
16929
|
-
network: DestinationNetwork.nullable(),
|
|
16930
|
-
method: HttpMethod,
|
|
16931
|
-
transport: Transport,
|
|
16932
|
-
url: external_exports.string(),
|
|
16933
|
-
template: external_exports.boolean(),
|
|
16934
|
-
dataClass: DataClass,
|
|
16935
|
-
site: EgressCallSiteHit
|
|
16936
|
-
}).meta({ id: "ResolvedEgressHit" });
|
|
16937
|
-
var EgressReconcile = external_exports.discriminatedUnion("mode", [
|
|
16938
|
-
external_exports.object({ mode: external_exports.literal("walk"), walkedPrefix: external_exports.string() }),
|
|
16939
|
-
external_exports.object({
|
|
16940
|
-
mode: external_exports.literal("ledger"),
|
|
16941
|
-
scannedFiles: external_exports.array(external_exports.string()),
|
|
16942
|
-
deletedFiles: external_exports.array(external_exports.string())
|
|
16943
|
-
})
|
|
16944
|
-
]).meta({ id: "EgressReconcile" });
|
|
16945
|
-
var RecordProjectEgressInput = external_exports.object({
|
|
16946
|
-
/** Stable reconcile key: 'git:<repo identity>' or 'path:<abs root>' (non-git). */
|
|
16947
|
-
projectKey: external_exports.string().min(1),
|
|
16948
|
-
/** Display name only — never keys reconciliation. */
|
|
16949
|
-
project: external_exports.string(),
|
|
16950
|
-
projectId: external_exports.string().nullable(),
|
|
16951
|
-
reconcile: EgressReconcile,
|
|
16952
|
-
hits: external_exports.array(ResolvedEgressHit)
|
|
16953
|
-
}).meta({ id: "RecordProjectEgressInput" });
|
|
16954
|
-
var EgressWriteSummary = external_exports.object({
|
|
16955
|
-
destinations: external_exports.number().int().nonnegative(),
|
|
16956
|
-
endpoints: external_exports.number().int().nonnegative(),
|
|
16957
|
-
callSites: external_exports.number().int().nonnegative(),
|
|
16958
|
-
truncated: external_exports.boolean(),
|
|
16959
|
-
/**
|
|
16960
|
-
* Files the cap dropped whole. Their stored rows were left untouched, so a
|
|
16961
|
-
* ledger-keeping caller must withhold their ledger entries and read them
|
|
16962
|
-
* again next scan.
|
|
16963
|
-
*/
|
|
16964
|
-
droppedFiles: external_exports.array(external_exports.string()).default([])
|
|
16965
|
-
}).meta({ id: "EgressWriteSummary" });
|
|
16856
|
+
var ExceptionDescriptor = DetectionException.omit({ valueFingerprint: true });
|
|
16966
16857
|
|
|
16967
16858
|
// ../../packages/schema/src/zod/exception-action.ts
|
|
16968
16859
|
var confirmation = external_exports.string().optional();
|
|
@@ -17175,7 +17066,13 @@ var VaultConsent = external_exports.object({
|
|
|
17175
17066
|
|
|
17176
17067
|
// ../../packages/schema/src/zod/local.ts
|
|
17177
17068
|
var WORKSPACE_SETTINGS_SPEC_VERSION = 5;
|
|
17178
|
-
var RunMode = external_exports.enum(["standalone"]);
|
|
17069
|
+
var RunMode = external_exports.enum(["standalone", "attached"]);
|
|
17070
|
+
var ControlPlaneConnection = external_exports.object({
|
|
17071
|
+
endpoint: external_exports.string().min(1),
|
|
17072
|
+
// Display name for the deployment, shown instead of the raw endpoint.
|
|
17073
|
+
label: external_exports.string().min(1).optional(),
|
|
17074
|
+
attachedAt: external_exports.iso.datetime()
|
|
17075
|
+
}).meta({ id: "ControlPlaneConnection" });
|
|
17179
17076
|
var SimpleDetectionPolicy = external_exports.enum(["redact", "warn"]);
|
|
17180
17077
|
var HistoricalAccess = external_exports.enum(["full", "session-only"]);
|
|
17181
17078
|
var ModelJudgeConsent = external_exports.object({
|
|
@@ -17184,12 +17081,10 @@ var ModelJudgeConsent = external_exports.object({
|
|
|
17184
17081
|
});
|
|
17185
17082
|
var WorkspaceSettings = external_exports.object({
|
|
17186
17083
|
specVersion: external_exports.number().int().positive().default(WORKSPACE_SETTINGS_SPEC_VERSION),
|
|
17187
|
-
|
|
17188
|
-
//
|
|
17189
|
-
runMode:
|
|
17190
|
-
|
|
17191
|
-
RunMode.default("standalone")
|
|
17192
|
-
),
|
|
17084
|
+
runMode: RunMode.default("standalone"),
|
|
17085
|
+
// Present only while attached; a detach clears it. Its presence is what makes
|
|
17086
|
+
// `runMode: 'attached'` mean anything — see isAttached.
|
|
17087
|
+
controlPlane: ControlPlaneConnection.optional(),
|
|
17193
17088
|
policy: SimpleDetectionPolicy.default("redact"),
|
|
17194
17089
|
// Consent for scanning pre-install surfaces; opt-in (see HistoricalAccess).
|
|
17195
17090
|
historicalAccess: HistoricalAccess.default("session-only"),
|
|
@@ -17215,6 +17110,195 @@ var WorkspaceSettings = external_exports.object({
|
|
|
17215
17110
|
modelJudgeConsent: ModelJudgeConsent.optional()
|
|
17216
17111
|
});
|
|
17217
17112
|
|
|
17113
|
+
// ../../packages/schema/src/zod/managed.ts
|
|
17114
|
+
var MANAGED_SETTINGS_SPEC_VERSION = 1;
|
|
17115
|
+
var ManagedSettingKey = external_exports.enum([
|
|
17116
|
+
"runMode",
|
|
17117
|
+
"historicalAccess",
|
|
17118
|
+
"vaultConsent",
|
|
17119
|
+
"vaultKeyCustody",
|
|
17120
|
+
"vaultInlineReveal",
|
|
17121
|
+
"modelJudgeConsent",
|
|
17122
|
+
"dataSharesInPlace"
|
|
17123
|
+
]).meta({ id: "ManagedSettingKey" });
|
|
17124
|
+
var ManagedSettingsValues = external_exports.object({
|
|
17125
|
+
runMode: external_exports.enum(["standalone", "attached"]).optional(),
|
|
17126
|
+
controlPlane: external_exports.object({
|
|
17127
|
+
endpoint: external_exports.string().min(1),
|
|
17128
|
+
label: external_exports.string().min(1).optional()
|
|
17129
|
+
}).optional(),
|
|
17130
|
+
historicalAccess: external_exports.enum(["full", "session-only"]).optional(),
|
|
17131
|
+
vaultConsent: external_exports.boolean().optional(),
|
|
17132
|
+
vaultKeyCustody: external_exports.enum(["file", "keychain"]).optional(),
|
|
17133
|
+
vaultInlineReveal: external_exports.enum(["masked", "full", "off"]).optional(),
|
|
17134
|
+
modelJudgeConsent: external_exports.boolean().optional(),
|
|
17135
|
+
dataSharesInPlace: external_exports.boolean().optional()
|
|
17136
|
+
}).meta({ id: "ManagedSettingsValues" });
|
|
17137
|
+
var ManagedSettings = external_exports.object({
|
|
17138
|
+
specVersion: external_exports.number().int().positive().default(MANAGED_SETTINGS_SPEC_VERSION),
|
|
17139
|
+
// Shown on every locked control, so the user can tell an administrative
|
|
17140
|
+
// decision from a bug. Absent renders as a generic "your organization".
|
|
17141
|
+
organization: external_exports.string().min(1).optional(),
|
|
17142
|
+
// What the administrator pinned.
|
|
17143
|
+
values: ManagedSettingsValues.default({}),
|
|
17144
|
+
// Which of those the user may not change. A key here with no matching value
|
|
17145
|
+
// freezes whatever the user last chose; a value with no lock is a DEFAULT
|
|
17146
|
+
// the user may still override. The two are separable on purpose.
|
|
17147
|
+
lockedFields: external_exports.array(ManagedSettingKey).default([])
|
|
17148
|
+
}).meta({ id: "ManagedSettings" });
|
|
17149
|
+
|
|
17150
|
+
// ../../packages/schema/src/zod/policy.ts
|
|
17151
|
+
var PolicyScope = external_exports.enum(["global", "repo", "user"]).meta({ id: "PolicyScope" });
|
|
17152
|
+
var PolicyTarget = external_exports.union([external_exports.object({ ruleId: external_exports.string() }), external_exports.object({ category: DetectionCategory })]).meta({ id: "PolicyTarget" });
|
|
17153
|
+
var Policy = external_exports.object({
|
|
17154
|
+
id: external_exports.guid(),
|
|
17155
|
+
scope: PolicyScope,
|
|
17156
|
+
target: PolicyTarget,
|
|
17157
|
+
action: ActionTaken,
|
|
17158
|
+
enabled: external_exports.boolean().default(true),
|
|
17159
|
+
customKeywords: external_exports.array(external_exports.string()).optional(),
|
|
17160
|
+
// Display name — optional so older policy rows without name still parse.
|
|
17161
|
+
// Added for the findings API (policy.name column migration).
|
|
17162
|
+
name: external_exports.string().optional()
|
|
17163
|
+
}).meta({ id: "Policy" });
|
|
17164
|
+
var PolicyBundle = external_exports.object({
|
|
17165
|
+
version: external_exports.string(),
|
|
17166
|
+
policies: external_exports.array(Policy),
|
|
17167
|
+
// Rules from the installed marketplace packs (snapshotted by the
|
|
17168
|
+
// control plane). The plugin registers these in addition to its bundled
|
|
17169
|
+
// packs. Optional so older backends — and older on-disk caches — that omit
|
|
17170
|
+
// the field still parse; consumers read `bundle.rules ?? []`.
|
|
17171
|
+
rules: external_exports.array(Rule).optional(),
|
|
17172
|
+
// When true, `rules` IS the complete effective ruleset and the runtime must
|
|
17173
|
+
// NOT merge its compiled-in bundled packs — the standalone gateway sets this
|
|
17174
|
+
// after reading the user's installed snapshot (installed_packs, enabled
|
|
17175
|
+
// packs only), which is how detection updates stay manual: new bundled
|
|
17176
|
+
// rules run only after the user applies the pack update. Absent/false keeps
|
|
17177
|
+
// the historical composition (bundled packs + rules) — older caches.
|
|
17178
|
+
rulesComplete: external_exports.boolean().optional(),
|
|
17179
|
+
// Active detection exceptions, evaluation subset only (see
|
|
17180
|
+
// ExceptionBundleEntry). Optional so older bundle producers — and older
|
|
17181
|
+
// on-disk caches — that omit the field still parse; consumers read
|
|
17182
|
+
// `bundle.exceptions ?? []`.
|
|
17183
|
+
exceptions: external_exports.array(ExceptionBundleEntry).optional(),
|
|
17184
|
+
// Rule ids whose pack is assigned a REVERSIBLE archetype (Redact & Vault).
|
|
17185
|
+
// A second axis over the same `redact` action, carried beside the policies
|
|
17186
|
+
// rather than on them: nothing writes ruleId-targeted policies to disk, so
|
|
17187
|
+
// widening Policy itself would change a persisted shape to express something
|
|
17188
|
+
// only the in-memory bundle needs. Optional so an older producer — or an
|
|
17189
|
+
// older on-disk cache — still parses; consumers read `?? []` and get the
|
|
17190
|
+
// pre-existing one-way behaviour, which is the safe direction to default.
|
|
17191
|
+
reversibleRuleIds: external_exports.array(external_exports.string()).optional(),
|
|
17192
|
+
// Installed pack version, keyed by ruleId, for rules in `rules` that came
|
|
17193
|
+
// from a versioned installed pack. Optional so older backends — and older
|
|
17194
|
+
// on-disk caches — that omit the field still parse; consumers fall back to
|
|
17195
|
+
// the rule's own spec version. NOT the bundle version above — see
|
|
17196
|
+
// installedRuleset's ruleVersions for the source of truth.
|
|
17197
|
+
ruleVersions: external_exports.record(external_exports.string(), external_exports.string()).optional(),
|
|
17198
|
+
customKeywords: external_exports.array(external_exports.string()),
|
|
17199
|
+
fetchedAt: external_exports.iso.datetime()
|
|
17200
|
+
}).meta({ id: "PolicyBundle" });
|
|
17201
|
+
var OBSERVE_ONLY_CATEGORIES = ["config"];
|
|
17202
|
+
var ENFORCEABLE_CATEGORIES = DetectionCategory.options.filter((c) => !OBSERVE_ONLY_CATEGORIES.includes(c));
|
|
17203
|
+
var CATEGORY_PEAK_SEVERITY = {
|
|
17204
|
+
secret: "critical",
|
|
17205
|
+
financial: "critical",
|
|
17206
|
+
// core-financial/credit-card
|
|
17207
|
+
code_flaw: "critical",
|
|
17208
|
+
pii: "high",
|
|
17209
|
+
phi: "high",
|
|
17210
|
+
custom: "high",
|
|
17211
|
+
// user-defined; conservative
|
|
17212
|
+
code_context: "low",
|
|
17213
|
+
config: "low"
|
|
17214
|
+
// observe-only; floors to monitor regardless
|
|
17215
|
+
};
|
|
17216
|
+
function severityFloorPolicy(category) {
|
|
17217
|
+
if (OBSERVE_ONLY_CATEGORIES.includes(category)) return "monitor";
|
|
17218
|
+
const peak = CATEGORY_PEAK_SEVERITY[category];
|
|
17219
|
+
return peak === "critical" || peak === "high" ? "warn" : "monitor";
|
|
17220
|
+
}
|
|
17221
|
+
var PolicyKind = external_exports.enum(["builtin", "custom"]).meta({ id: "PolicyKind" });
|
|
17222
|
+
var KNOWN_BUILTIN_IDS = ["monitor", "warn", "redact", "vault", "block"];
|
|
17223
|
+
var BuiltinPolicyId = external_exports.enum(KNOWN_BUILTIN_IDS).meta({ id: "BuiltinPolicyId" });
|
|
17224
|
+
var BUILTIN_POLICY_SPECS = {
|
|
17225
|
+
monitor: {
|
|
17226
|
+
name: "Monitor",
|
|
17227
|
+
action: "log",
|
|
17228
|
+
reversible: false,
|
|
17229
|
+
description: "Log every match for audit. The request is allowed through untouched."
|
|
17230
|
+
},
|
|
17231
|
+
warn: {
|
|
17232
|
+
name: "Warn",
|
|
17233
|
+
action: "warn",
|
|
17234
|
+
reversible: false,
|
|
17235
|
+
description: "Allow the request, but warn the user inline before it is sent."
|
|
17236
|
+
},
|
|
17237
|
+
redact: {
|
|
17238
|
+
name: "Redact",
|
|
17239
|
+
action: "redact",
|
|
17240
|
+
reversible: false,
|
|
17241
|
+
description: "Strip the matched value from the request and destroy it, then continue. What was removed cannot be recovered."
|
|
17242
|
+
},
|
|
17243
|
+
vault: {
|
|
17244
|
+
name: "Redact & Vault",
|
|
17245
|
+
action: "redact",
|
|
17246
|
+
reversible: true,
|
|
17247
|
+
description: "Strip the matched value from the request and keep an encrypted, recoverable copy in the local vault, leaving a pointer in its place. Needs the vault consent granted under Settings; without it this behaves as Redact."
|
|
17248
|
+
},
|
|
17249
|
+
block: {
|
|
17250
|
+
name: "Block",
|
|
17251
|
+
action: "block",
|
|
17252
|
+
reversible: false,
|
|
17253
|
+
description: "Refuse the request entirely whenever any rule in this detection matches."
|
|
17254
|
+
}
|
|
17255
|
+
};
|
|
17256
|
+
function builtinPolicyToAction(id) {
|
|
17257
|
+
return BUILTIN_POLICY_SPECS[id].action;
|
|
17258
|
+
}
|
|
17259
|
+
var CATEGORY_EXPRESSIBLE_IDS = KNOWN_BUILTIN_IDS.filter(
|
|
17260
|
+
(id) => !BUILTIN_POLICY_SPECS[id].reversible
|
|
17261
|
+
);
|
|
17262
|
+
var CATEGORY_INEXPRESSIBLE_IDS = KNOWN_BUILTIN_IDS.filter(
|
|
17263
|
+
(id) => BUILTIN_POLICY_SPECS[id].reversible
|
|
17264
|
+
);
|
|
17265
|
+
var CategoryPolicyId = external_exports.enum(CATEGORY_EXPRESSIBLE_IDS).meta({ id: "CategoryPolicyId" });
|
|
17266
|
+
var DEFAULT_ACTIONS = Object.fromEntries(
|
|
17267
|
+
DetectionCategory.options.map((c) => [c, builtinPolicyToAction(severityFloorPolicy(c))])
|
|
17268
|
+
);
|
|
17269
|
+
var BUILTIN_POLICIES = Object.fromEntries(
|
|
17270
|
+
KNOWN_BUILTIN_IDS.map((id) => [id, { id, ...BUILTIN_POLICY_SPECS[id] }])
|
|
17271
|
+
);
|
|
17272
|
+
var UsedByItem = external_exports.object({
|
|
17273
|
+
id: external_exports.string(),
|
|
17274
|
+
name: external_exports.string(),
|
|
17275
|
+
ruleCount: external_exports.number().int().nonnegative(),
|
|
17276
|
+
enabled: external_exports.boolean()
|
|
17277
|
+
}).meta({ id: "UsedByItem" });
|
|
17278
|
+
var PolicyListItem = external_exports.object({
|
|
17279
|
+
id: external_exports.string(),
|
|
17280
|
+
kind: PolicyKind,
|
|
17281
|
+
name: external_exports.string(),
|
|
17282
|
+
enabled: external_exports.boolean(),
|
|
17283
|
+
usedByCount: external_exports.number().int().nonnegative()
|
|
17284
|
+
}).meta({ id: "PolicyListItem" });
|
|
17285
|
+
var ListPoliciesResponse = external_exports.object({ items: external_exports.array(PolicyListItem) }).meta({ id: "ListPoliciesResponse" });
|
|
17286
|
+
var PolicyDetail = external_exports.object({
|
|
17287
|
+
specVersion: external_exports.literal(1),
|
|
17288
|
+
id: external_exports.string(),
|
|
17289
|
+
kind: PolicyKind,
|
|
17290
|
+
name: external_exports.string(),
|
|
17291
|
+
enabled: external_exports.boolean(),
|
|
17292
|
+
description: external_exports.string(),
|
|
17293
|
+
usedBy: external_exports.array(UsedByItem)
|
|
17294
|
+
}).meta({ id: "PolicyDetail" });
|
|
17295
|
+
var PolicyStatsResponse = external_exports.object({
|
|
17296
|
+
policies: external_exports.number().int().nonnegative(),
|
|
17297
|
+
builtin: external_exports.number().int().nonnegative(),
|
|
17298
|
+
custom: external_exports.number().int().nonnegative(),
|
|
17299
|
+
detectionsGoverned: external_exports.number().int().nonnegative()
|
|
17300
|
+
}).meta({ id: "PolicyStatsResponse" });
|
|
17301
|
+
|
|
17218
17302
|
// ../../packages/schema/src/zod/project-files.ts
|
|
17219
17303
|
var ProjectFileInput = external_exports.object({
|
|
17220
17304
|
path: external_exports.string().min(1),
|
|
@@ -17287,44 +17371,6 @@ var BatchedRemediation = external_exports.discriminatedUnion("kind", [
|
|
|
17287
17371
|
NoRemediationDecision
|
|
17288
17372
|
]);
|
|
17289
17373
|
|
|
17290
|
-
// ../../packages/schema/src/zod/rule-test.ts
|
|
17291
|
-
var TestRulesRequest = external_exports.object({
|
|
17292
|
-
rules: external_exports.array(Rule).min(1).max(100),
|
|
17293
|
-
text: external_exports.string().max(5e4).optional(),
|
|
17294
|
-
fixtures: external_exports.array(RuleFixture).max(200).optional()
|
|
17295
|
-
}).refine((v) => v.text !== void 0 || (v.fixtures?.length ?? 0) > 0, {
|
|
17296
|
-
message: "Provide `text`, `fixtures`, or both \u2014 there must be something to test"
|
|
17297
|
-
}).meta({ id: "TestRulesRequest" });
|
|
17298
|
-
var RuleTestMatch = external_exports.object({
|
|
17299
|
-
ruleId: external_exports.string(),
|
|
17300
|
-
category: DetectionCategory,
|
|
17301
|
-
severity: Severity,
|
|
17302
|
-
span: Span,
|
|
17303
|
-
confidence: external_exports.number().min(0).max(1),
|
|
17304
|
-
match: external_exports.string()
|
|
17305
|
-
}).meta({ id: "RuleTestMatch" });
|
|
17306
|
-
var FixtureResult = external_exports.object({
|
|
17307
|
-
label: external_exports.string(),
|
|
17308
|
-
shouldMatch: external_exports.boolean(),
|
|
17309
|
-
didMatch: external_exports.boolean(),
|
|
17310
|
-
passed: external_exports.boolean(),
|
|
17311
|
-
matches: external_exports.array(RuleTestMatch)
|
|
17312
|
-
}).meta({ id: "FixtureResult" });
|
|
17313
|
-
var TestRulesResponse = external_exports.object({
|
|
17314
|
-
// Present only when the request supplied `text`.
|
|
17315
|
-
adhoc: external_exports.object({ matches: external_exports.array(RuleTestMatch) }).optional(),
|
|
17316
|
-
fixtures: external_exports.array(FixtureResult),
|
|
17317
|
-
summary: external_exports.object({
|
|
17318
|
-
total: external_exports.number().int().nonnegative(),
|
|
17319
|
-
passed: external_exports.number().int().nonnegative(),
|
|
17320
|
-
failed: external_exports.number().int().nonnegative()
|
|
17321
|
-
}),
|
|
17322
|
-
// Ids of rules whose matcher type the engine cannot evaluate today (e.g.
|
|
17323
|
-
// `validator`), so they silently never match. Surfaced so an author is not
|
|
17324
|
-
// misled by a green run that actually skipped a rule.
|
|
17325
|
-
unsupportedRuleIds: external_exports.array(external_exports.string())
|
|
17326
|
-
}).meta({ id: "TestRulesResponse" });
|
|
17327
|
-
|
|
17328
17374
|
// ../../packages/schema/src/zod/security.ts
|
|
17329
17375
|
var SeveritySummaryItem = external_exports.object({
|
|
17330
17376
|
severity: Severity,
|
|
@@ -17422,10 +17468,22 @@ var TopSourcesQuery = external_exports.object({
|
|
|
17422
17468
|
// Omit for both kinds.
|
|
17423
17469
|
kind: external_exports.enum(SOURCE_KINDS).optional()
|
|
17424
17470
|
});
|
|
17425
|
-
var Provider =
|
|
17471
|
+
var Provider = Harness.extract([
|
|
17472
|
+
"ClaudeCode",
|
|
17473
|
+
"Cursor",
|
|
17474
|
+
"Codex",
|
|
17475
|
+
"Antigravity",
|
|
17476
|
+
"ClaudeAi",
|
|
17477
|
+
"ChatGpt",
|
|
17478
|
+
"Copilot",
|
|
17479
|
+
"Api"
|
|
17480
|
+
]).meta({ id: "Provider" });
|
|
17426
17481
|
var ScanCoverageProvider = external_exports.object({
|
|
17427
17482
|
provider: Provider,
|
|
17428
|
-
// Percent of that provider's traffic
|
|
17483
|
+
// Percent of that provider's traffic the shipped capture surface reaches.
|
|
17484
|
+
// A curated business fact, constant across every `range` — not a measured
|
|
17485
|
+
// per-window metric. 0 exactly when `supported` is false. See the comment
|
|
17486
|
+
// above the block for where these numbers are decided.
|
|
17429
17487
|
coverage: external_exports.number().int().min(0).max(100),
|
|
17430
17488
|
supported: external_exports.boolean()
|
|
17431
17489
|
}).meta({ id: "ScanCoverageProvider" });
|
|
@@ -17479,6 +17537,18 @@ var ApplyRecommendedActionResponse = external_exports.object({
|
|
|
17479
17537
|
var DismissRecommendedActionResponse = external_exports.object({ id: external_exports.string(), status: external_exports.literal("dismissed") }).meta({ id: "DismissRecommendedActionResponse" });
|
|
17480
17538
|
var RecommendedActionIdParam = external_exports.object({ id: external_exports.string() });
|
|
17481
17539
|
|
|
17540
|
+
// ../../packages/schema/src/zod/settings-action.ts
|
|
17541
|
+
var SaveSettingsInput = external_exports.object({
|
|
17542
|
+
historicalAccess: external_exports.string(),
|
|
17543
|
+
modelJudgeConsent: external_exports.boolean(),
|
|
17544
|
+
vaultConsent: external_exports.string(),
|
|
17545
|
+
vaultInlineReveal: external_exports.string()
|
|
17546
|
+
});
|
|
17547
|
+
var AttachInput = external_exports.object({
|
|
17548
|
+
endpoint: external_exports.string(),
|
|
17549
|
+
label: external_exports.string().optional()
|
|
17550
|
+
});
|
|
17551
|
+
|
|
17482
17552
|
// ../../packages/schema/src/zod/triage.ts
|
|
17483
17553
|
var TriageHit = external_exports.object({
|
|
17484
17554
|
ruleId: external_exports.string(),
|
|
@@ -17493,7 +17563,7 @@ var TriageHit = external_exports.object({
|
|
|
17493
17563
|
valueFingerprint: external_exports.string().optional(),
|
|
17494
17564
|
keyVersion: external_exports.number().int().nonnegative().optional()
|
|
17495
17565
|
});
|
|
17496
|
-
var TriagePolicy =
|
|
17566
|
+
var TriagePolicy = CategoryPolicyId;
|
|
17497
17567
|
var TriageCategoryRec = external_exports.object({
|
|
17498
17568
|
category: DetectionCategory,
|
|
17499
17569
|
action: TriagePolicy,
|
|
@@ -17609,9 +17679,12 @@ import { threadId } from "worker_threads";
|
|
|
17609
17679
|
|
|
17610
17680
|
// ../../packages/persistence/src/internal/snapshot.ts
|
|
17611
17681
|
var STALE_PARTIAL_MS = 5 * 6e4;
|
|
17682
|
+
var SNAPSHOT_STAGING_SUFFIX = ".partial";
|
|
17683
|
+
var STAGED_NAME_SUFFIX = `.bak${SNAPSHOT_STAGING_SUFFIX}`;
|
|
17612
17684
|
|
|
17613
17685
|
// ../../packages/persistence/src/repositories/activity.ts
|
|
17614
17686
|
var LIVE_ACTIVITY_WINDOW_MS = 30 * 6e4;
|
|
17687
|
+
var DEFAULT_HARNESS = HARNESS.ClaudeCode;
|
|
17615
17688
|
|
|
17616
17689
|
// ../../packages/persistence/src/repositories/exceptions.ts
|
|
17617
17690
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
@@ -17630,7 +17703,20 @@ import { createHash as createHash2, randomUUID as randomUUID3 } from "crypto";
|
|
|
17630
17703
|
// ../../packages/persistence/src/repositories/inventory-assets.ts
|
|
17631
17704
|
import { randomUUID as randomUUID4 } from "crypto";
|
|
17632
17705
|
var VALID_HARNESS_IDS = new Set(HarnessId.options);
|
|
17706
|
+
var HARNESS_LABELS = {
|
|
17707
|
+
[HARNESS.ClaudeCode]: "Claude Code",
|
|
17708
|
+
[HARNESS.Cursor]: "Cursor",
|
|
17709
|
+
[HARNESS.Codex]: "Codex",
|
|
17710
|
+
[HARNESS.Antigravity]: "Antigravity"
|
|
17711
|
+
};
|
|
17633
17712
|
var HARNESS_LIVENESS_WINDOW_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
17713
|
+
var stripSeparators = (value) => value.toLowerCase().replace(/[\s-]/g, "");
|
|
17714
|
+
var TITLE_NEEDLES = {
|
|
17715
|
+
ClaudeCode: stripSeparators(SOURCE_TOOL.ClaudeCode),
|
|
17716
|
+
Cursor: stripSeparators(SOURCE_TOOL.Cursor),
|
|
17717
|
+
Codex: stripSeparators(SOURCE_TOOL.Codex),
|
|
17718
|
+
Antigravity: stripSeparators(SOURCE_TOOL.Antigravity)
|
|
17719
|
+
};
|
|
17634
17720
|
|
|
17635
17721
|
// ../../packages/persistence/src/repositories/policies.ts
|
|
17636
17722
|
import { randomUUID as randomUUID5 } from "crypto";
|
|
@@ -17644,6 +17730,18 @@ import { randomUUID as randomUUID7 } from "crypto";
|
|
|
17644
17730
|
// ../../packages/persistence/src/repositories/secret-vault.ts
|
|
17645
17731
|
import { randomUUID as randomUUID8 } from "crypto";
|
|
17646
17732
|
|
|
17733
|
+
// ../../packages/persistence/src/repositories/security.ts
|
|
17734
|
+
var SCAN_COVERAGE = {
|
|
17735
|
+
[HARNESS.Antigravity]: { coverage: 60, supported: true },
|
|
17736
|
+
[HARNESS.Api]: { coverage: 0, supported: false },
|
|
17737
|
+
[HARNESS.ChatGpt]: { coverage: 40, supported: true },
|
|
17738
|
+
[HARNESS.ClaudeAi]: { coverage: 40, supported: true },
|
|
17739
|
+
[HARNESS.ClaudeCode]: { coverage: 100, supported: true },
|
|
17740
|
+
[HARNESS.Codex]: { coverage: 80, supported: true },
|
|
17741
|
+
[HARNESS.Copilot]: { coverage: 0, supported: false },
|
|
17742
|
+
[HARNESS.Cursor]: { coverage: 0, supported: false }
|
|
17743
|
+
};
|
|
17744
|
+
|
|
17647
17745
|
// ../../packages/persistence/src/repositories/shares.ts
|
|
17648
17746
|
import { randomUUID as randomUUID9 } from "crypto";
|
|
17649
17747
|
|
|
@@ -17676,8 +17774,12 @@ import { mkdir } from "fs/promises";
|
|
|
17676
17774
|
import { homedir } from "os";
|
|
17677
17775
|
import { join as join4 } from "path";
|
|
17678
17776
|
|
|
17679
|
-
// ../../packages/persistence/src/settings.ts
|
|
17777
|
+
// ../../packages/persistence/src/managed-settings.ts
|
|
17680
17778
|
import { readFileSync as readFileSync3 } from "fs";
|
|
17779
|
+
import { posix, win32 } from "path";
|
|
17780
|
+
|
|
17781
|
+
// ../../packages/persistence/src/settings.ts
|
|
17782
|
+
import { readFileSync as readFileSync4 } from "fs";
|
|
17681
17783
|
import { join as join5 } from "path";
|
|
17682
17784
|
|
|
17683
17785
|
// ../../packages/persistence/src/vault/crypto.ts
|
|
@@ -17692,15 +17794,7 @@ import {
|
|
|
17692
17794
|
// ../../packages/persistence/src/vault/key-provider.ts
|
|
17693
17795
|
import { execFileSync } from "child_process";
|
|
17694
17796
|
import { randomBytes as randomBytes2 } from "crypto";
|
|
17695
|
-
import {
|
|
17696
|
-
chmodSync as chmodSync2,
|
|
17697
|
-
mkdirSync as mkdirSync2,
|
|
17698
|
-
readFileSync as readFileSync4,
|
|
17699
|
-
renameSync as renameSync4,
|
|
17700
|
-
rmSync as rmSync4,
|
|
17701
|
-
statSync as statSync3,
|
|
17702
|
-
writeFileSync as writeFileSync3
|
|
17703
|
-
} from "fs";
|
|
17797
|
+
import { chmodSync as chmodSync2, readFileSync as readFileSync5, renameSync as renameSync4, rmSync as rmSync4, statSync as statSync3, writeFileSync as writeFileSync3 } from "fs";
|
|
17704
17798
|
import { join as join6 } from "path";
|
|
17705
17799
|
|
|
17706
17800
|
// ../../packages/persistence/src/vault/vault.ts
|
|
@@ -17729,7 +17823,7 @@ var providerEnvShape = {
|
|
|
17729
17823
|
var ProviderEnvSchema = external_exports.object(providerEnvShape);
|
|
17730
17824
|
|
|
17731
17825
|
// ../../packages/plugin-sdk/src/config-inventory.ts
|
|
17732
|
-
import { readdirSync as readdirSync2, readFileSync as
|
|
17826
|
+
import { readdirSync as readdirSync2, readFileSync as readFileSync7, realpathSync, statSync as statSync5 } from "fs";
|
|
17733
17827
|
import { homedir as homedir2 } from "os";
|
|
17734
17828
|
import { basename as basename3, join as join10 } from "path";
|
|
17735
17829
|
|
|
@@ -18461,6 +18555,7 @@ var CONFIG_POSTURE_RULES = [
|
|
|
18461
18555
|
];
|
|
18462
18556
|
|
|
18463
18557
|
// ../../packages/detections/src/security/redos-probe.ts
|
|
18558
|
+
var BUDGET_MS = 100;
|
|
18464
18559
|
var EXPONENTIAL_UNITS = [
|
|
18465
18560
|
"a",
|
|
18466
18561
|
"0",
|
|
@@ -18484,9 +18579,11 @@ var EXPONENTIAL_PROBES = EXPONENTIAL_UNITS.flatMap(
|
|
|
18484
18579
|
var POLYNOMIAL_PROBES = ["abc-", "a.", "a ", "a=", "x", "0", "a@", "a/", "ab"].map(
|
|
18485
18580
|
(unit) => unit.repeat(1e4).slice(0, 4e4) + "!"
|
|
18486
18581
|
);
|
|
18582
|
+
var CPU_CORROBORATION_SHARE = 0.2;
|
|
18583
|
+
var CORROBORATION_FLOOR_MS = BUDGET_MS * CPU_CORROBORATION_SHARE;
|
|
18487
18584
|
|
|
18488
18585
|
// ../../packages/plugin-sdk/src/repo.ts
|
|
18489
|
-
import { existsSync as existsSync6, readFileSync as
|
|
18586
|
+
import { existsSync as existsSync6, readFileSync as readFileSync6, statSync as statSync4 } from "fs";
|
|
18490
18587
|
import { basename as basename2, dirname as dirname2, isAbsolute, join as join9, sep as sep2 } from "path";
|
|
18491
18588
|
|
|
18492
18589
|
// ../../packages/plugin-sdk/src/events.ts
|
|
@@ -18497,21 +18594,25 @@ import { existsSync as existsSync7 } from "fs";
|
|
|
18497
18594
|
import { fileURLToPath } from "url";
|
|
18498
18595
|
import { Worker } from "worker_threads";
|
|
18499
18596
|
|
|
18597
|
+
// ../../packages/plugin-sdk/src/ignore-layers.ts
|
|
18598
|
+
var import_ignore = __toESM(require_ignore(), 1);
|
|
18599
|
+
import { readFileSync as readFileSync8 } from "fs";
|
|
18600
|
+
import { join as join11 } from "path";
|
|
18601
|
+
|
|
18500
18602
|
// ../../packages/plugin-sdk/src/inventory-resolver.ts
|
|
18501
18603
|
import { arch, hostname as hostname4, platform, release } from "os";
|
|
18502
18604
|
|
|
18503
18605
|
// ../../packages/plugin-sdk/src/nudge.ts
|
|
18504
|
-
import { mkdirSync as
|
|
18505
|
-
import { join as
|
|
18606
|
+
import { mkdirSync as mkdirSync2, readFileSync as readFileSync9, writeFileSync as writeFileSync5 } from "fs";
|
|
18607
|
+
import { join as join12 } from "path";
|
|
18506
18608
|
|
|
18507
18609
|
// ../../packages/plugin-sdk/src/paths.ts
|
|
18508
18610
|
import { readdirSync as readdirSync3, realpathSync as realpathSync2 } from "fs";
|
|
18509
18611
|
import { basename as basename4, dirname as dirname3, sep as sep3 } from "path";
|
|
18510
18612
|
|
|
18511
18613
|
// ../../packages/plugin-sdk/src/project-files.ts
|
|
18512
|
-
|
|
18513
|
-
import {
|
|
18514
|
-
import { basename as basename5, join as join12 } from "path";
|
|
18614
|
+
import { existsSync as existsSync8, readdirSync as readdirSync4 } from "fs";
|
|
18615
|
+
import { basename as basename5, join as join13 } from "path";
|
|
18515
18616
|
|
|
18516
18617
|
// ../../packages/plugin-sdk/src/provider-env-antigravity.ts
|
|
18517
18618
|
var optionalBaseUrl2 = external_exports.preprocess((v) => {
|
|
@@ -18546,17 +18647,22 @@ import { randomUUID as randomUUID14 } from "crypto";
|
|
|
18546
18647
|
var THIRTY_DAYS_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
18547
18648
|
|
|
18548
18649
|
// ../../packages/plugin-sdk/src/throttle.ts
|
|
18549
|
-
import { mkdirSync as
|
|
18550
|
-
import { join as
|
|
18650
|
+
import { mkdirSync as mkdirSync3, statSync as statSync6, writeFileSync as writeFileSync6 } from "fs";
|
|
18651
|
+
import { join as join14 } from "path";
|
|
18551
18652
|
|
|
18552
18653
|
// ../../packages/setup-wizard/src/remediation/rotation-checklist.ts
|
|
18553
18654
|
import { writeFileSync as writeFileSync7 } from "fs";
|
|
18554
|
-
import { join as
|
|
18655
|
+
import { join as join15 } from "path";
|
|
18656
|
+
|
|
18657
|
+
// ../../packages/setup-wizard/src/triage/merge.ts
|
|
18658
|
+
var RANK = Object.fromEntries(
|
|
18659
|
+
KNOWN_BUILTIN_IDS.map((id, i) => [id, i])
|
|
18660
|
+
);
|
|
18555
18661
|
|
|
18556
18662
|
// ../../packages/setup-wizard/src/triage/plan-file.ts
|
|
18557
|
-
import { mkdtempSync, readFileSync as
|
|
18663
|
+
import { mkdtempSync, readFileSync as readFileSync10, rmdirSync, rmSync as rmSync5, writeFileSync as writeFileSync8 } from "fs";
|
|
18558
18664
|
import { tmpdir } from "os";
|
|
18559
|
-
import { basename as basename6, dirname as dirname4, join as
|
|
18665
|
+
import { basename as basename6, dirname as dirname4, join as join16 } from "path";
|
|
18560
18666
|
var SuppressionEntrySchema = external_exports.object({
|
|
18561
18667
|
ruleId: external_exports.string(),
|
|
18562
18668
|
category: DetectionCategory,
|
|
@@ -18598,8 +18704,8 @@ var PersistedPlanSchema = external_exports.object({
|
|
|
18598
18704
|
});
|
|
18599
18705
|
|
|
18600
18706
|
// src/skills-registry.ts
|
|
18601
|
-
import { readdirSync as readdirSync5, readFileSync as
|
|
18602
|
-
import { join as
|
|
18707
|
+
import { readdirSync as readdirSync5, readFileSync as readFileSync11 } from "fs";
|
|
18708
|
+
import { join as join17 } from "path";
|
|
18603
18709
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
18604
18710
|
var SKILLS_DIR = fileURLToPath2(new URL("../skills", import.meta.url));
|
|
18605
18711
|
|
|
@@ -18639,7 +18745,7 @@ function authorName(author) {
|
|
|
18639
18745
|
var manifestPath = process.argv[2];
|
|
18640
18746
|
var manifest = {};
|
|
18641
18747
|
try {
|
|
18642
|
-
manifest = JSON.parse(
|
|
18748
|
+
manifest = JSON.parse(readFileSync12(manifestPath ?? "", "utf8"));
|
|
18643
18749
|
} catch {
|
|
18644
18750
|
}
|
|
18645
18751
|
process.stdout.write(
|