@akasecurity/ai-tc-codex 0.9.20 → 0.9.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.codex-plugin/plugin.json +1 -1
- package/package.json +5 -5
- package/scripts/apply-suppressions.js +587 -56
- package/scripts/backfill.js +1038 -255
- package/scripts/content-retention.js +217 -63
- package/scripts/filescan.js +1065 -271
- package/scripts/firstrun.js +869 -194
- package/scripts/history-sync.js +741 -105
- package/scripts/intro.js +91 -11
- package/scripts/onboard.js +587 -56
- package/scripts/post-tool-use.js +1121 -301
- package/scripts/pre-tool-use.js +1104 -236
- package/scripts/query.js +868 -193
- package/scripts/reconcile.js +888 -201
- package/scripts/remediate.js +1007 -226
- package/scripts/scan-worker.js +103 -13
- package/scripts/session-start.js +1058 -292
- package/scripts/start-light.js +103 -13
- package/scripts/stop.js +896 -206
- package/scripts/sync.js +1317 -282
- package/scripts/user-prompt-submit.js +1034 -238
- package/skills/setup/SKILL.md +1 -0
|
@@ -8516,7 +8516,8 @@ var Span = object({
|
|
|
8516
8516
|
var MAX_VARIABLE_NAME_LENGTH = 128;
|
|
8517
8517
|
var VariableName = string2().max(MAX_VARIABLE_NAME_LENGTH);
|
|
8518
8518
|
var Finding = object({
|
|
8519
|
-
|
|
8519
|
+
// A random UUID or a content-addressed sha256 hex digest, depending on the writer.
|
|
8520
|
+
id: string2(),
|
|
8520
8521
|
eventId: guid2(),
|
|
8521
8522
|
ruleId: string2(),
|
|
8522
8523
|
category: DetectionCategory,
|
|
@@ -8947,11 +8948,20 @@ var EventKind = _enum(["prompt", "response", "code_change", "tool_use"]).meta({
|
|
|
8947
8948
|
var CAPTURE_EVENT_TYPES_SQL = EventKind.options.map((k) => `'${k}'`).join(",");
|
|
8948
8949
|
var SIGHTING_TOKEN_PATTERN = /\[\[aka:fp:v[1-9][0-9]{0,15}\.[A-Za-z0-9_-]{43}\]\]/;
|
|
8949
8950
|
var SIGHTING_TOKEN_ANCHORED = new RegExp(`^${SIGHTING_TOKEN_PATTERN.source}$`);
|
|
8951
|
+
var SIGHTING_ALIASES_MAX = 4;
|
|
8952
|
+
var SightingAliases = array(string2().regex(SIGHTING_TOKEN_ANCHORED)).min(1).max(SIGHTING_ALIASES_MAX);
|
|
8950
8953
|
var CaptureSighting = object({
|
|
8951
8954
|
token: string2().regex(SIGHTING_TOKEN_ANCHORED),
|
|
8955
|
+
aliases: SightingAliases.optional(),
|
|
8952
8956
|
ruleId: string2().min(1),
|
|
8953
8957
|
category: DetectionCategory
|
|
8954
8958
|
}).meta({ id: "CaptureSighting" });
|
|
8959
|
+
var REVIEW_VALUES_MAX = 16;
|
|
8960
|
+
var REVIEW_VALUE_MAX_CHARS = 1024;
|
|
8961
|
+
var ReviewValue = object({
|
|
8962
|
+
ruleId: string2().min(1).max(256),
|
|
8963
|
+
value: string2().min(1).max(REVIEW_VALUE_MAX_CHARS)
|
|
8964
|
+
}).meta({ id: "ReviewValue" });
|
|
8955
8965
|
var EventMetadata = object({
|
|
8956
8966
|
sessionId: string2().optional(),
|
|
8957
8967
|
repo: string2().optional(),
|
|
@@ -9059,7 +9069,14 @@ var EventMetadata = object({
|
|
|
9059
9069
|
scanIncomplete: _enum(["timeout", "unavailable"]).optional(),
|
|
9060
9070
|
// The sighting tokens in `content`, one entry per distinct token and rule.
|
|
9061
9071
|
// Set only on a forwarded capture; the locally stored copy holds the values.
|
|
9062
|
-
sightings: array(CaptureSighting).optional()
|
|
9072
|
+
sightings: array(CaptureSighting).optional(),
|
|
9073
|
+
// The length of the text this capture was cut from, when its content holds only the first
|
|
9074
|
+
// part of it. Absent when the content is the whole text.
|
|
9075
|
+
contentTruncatedFrom: number2().int().nonnegative().optional(),
|
|
9076
|
+
// The raw value of each finding in this capture, for review by the deployment. Set only on
|
|
9077
|
+
// a forwarded capture from a repository the organization's capture settings name; the
|
|
9078
|
+
// locally stored copy never carries it.
|
|
9079
|
+
reviewValues: array(ReviewValue).max(REVIEW_VALUES_MAX).optional()
|
|
9063
9080
|
}).meta({ id: "EventMetadata" });
|
|
9064
9081
|
var Event = object({
|
|
9065
9082
|
id: guid2(),
|
|
@@ -9913,6 +9930,8 @@ var AssetType = _enum(["project", "skill", "mcp", "hook", "config"]).meta({ id:
|
|
|
9913
9930
|
var AccessLevel = _enum(["open", "approved", "blocked"]).meta({ id: "AccessLevel" });
|
|
9914
9931
|
var Origin = _enum(["source", "public-dep", "vendored", "config", "data", "docs", "generated"]).meta({ id: "Origin" });
|
|
9915
9932
|
var TrustLevel = _enum(["known-good", "risky", "unapproved"]).meta({ id: "TrustLevel" });
|
|
9933
|
+
var ATTENTION_TRUST_LEVELS = ["unapproved", "risky"];
|
|
9934
|
+
var isAttentionTrust = (trust) => trust !== null && trust !== void 0 && ATTENTION_TRUST_LEVELS.includes(trust);
|
|
9916
9935
|
var Flag = _enum(["update", "stale", "conflict", "unknown", "change", "untracked", "risk", "findings"]).meta({ id: "Flag" });
|
|
9917
9936
|
var Visibility = _enum(["public", "private"]).meta({ id: "Visibility" });
|
|
9918
9937
|
var HarnessEventKind = _enum(["block", "redact", "warn"]).meta({ id: "HarnessEventKind" });
|
|
@@ -10090,7 +10109,7 @@ var McpTool = object({
|
|
|
10090
10109
|
signature: string2(),
|
|
10091
10110
|
description: string2(),
|
|
10092
10111
|
write: boolean2(),
|
|
10093
|
-
/**
|
|
10112
|
+
/** What makes the tool dangerous; null when nothing does. */
|
|
10094
10113
|
risk: string2().nullable()
|
|
10095
10114
|
}).meta({ id: "McpTool" });
|
|
10096
10115
|
var AssetFindingRef = object({
|
|
@@ -10137,8 +10156,9 @@ var ProjectSensitiveData = object({ items: array(SensitiveDataClass) }).meta({ i
|
|
|
10137
10156
|
var ListProjectsResponse = object({ items: array(ProjectSummary) }).meta({ id: "ListProjectsResponse" });
|
|
10138
10157
|
var InventoryStats = object({
|
|
10139
10158
|
/**
|
|
10140
|
-
* Assets with a flag
|
|
10141
|
-
*
|
|
10159
|
+
* Assets with a flag or with an `ATTENTION_TRUST_LEVELS` effective trust,
|
|
10160
|
+
* plus projects with a finding in the last `PROJECT_FINDINGS_WINDOW_DAYS`
|
|
10161
|
+
* days (drives the attention header chip). An asset counts once.
|
|
10142
10162
|
*/
|
|
10143
10163
|
attention: number2().int().nonnegative(),
|
|
10144
10164
|
byType: object({
|
|
@@ -10428,6 +10448,7 @@ var EgressCredentialRef = discriminatedUnion("kind", [
|
|
|
10428
10448
|
object({
|
|
10429
10449
|
kind: literal("literal"),
|
|
10430
10450
|
token: string2().regex(SIGHTING_TOKEN_ANCHORED),
|
|
10451
|
+
aliases: SightingAliases.optional(),
|
|
10431
10452
|
ruleId: string2().min(1).max(256)
|
|
10432
10453
|
}).strict(),
|
|
10433
10454
|
object({ kind: literal("variable"), variableName: VariableName.min(1) }).strict()
|
|
@@ -10680,6 +10701,10 @@ var EgressIngestHit = object({
|
|
|
10680
10701
|
*/
|
|
10681
10702
|
credentialRefs: EgressCredentialRefs.optional()
|
|
10682
10703
|
}).meta({ id: "EgressIngestHit" });
|
|
10704
|
+
var SUPERSEDED_PROJECT_KEYS_MAX = 4;
|
|
10705
|
+
var SupersededProjectKeys = array(
|
|
10706
|
+
string2().regex(/^[0-9a-f]{64}$/, "a superseded key must be a 64-character lowercase hex digest")
|
|
10707
|
+
).max(SUPERSEDED_PROJECT_KEYS_MAX);
|
|
10683
10708
|
var EgressIngestRequest = object({
|
|
10684
10709
|
/**
|
|
10685
10710
|
* Hash digest of the local `projectKey`, never the plaintext.
|
|
@@ -10692,6 +10717,7 @@ var EgressIngestRequest = object({
|
|
|
10692
10717
|
* that still has the plaintext to not send.
|
|
10693
10718
|
*/
|
|
10694
10719
|
projectKey: string2().regex(/^[0-9a-f]{64}$/, "projectKey must be a 64-character lowercase hex digest"),
|
|
10720
|
+
supersededProjectKeys: SupersededProjectKeys.optional(),
|
|
10695
10721
|
/** Display name only — never keys reconciliation. */
|
|
10696
10722
|
project: string2(),
|
|
10697
10723
|
reconcile: EgressReconcile,
|
|
@@ -10801,6 +10827,10 @@ var DeviceCommand = object({
|
|
|
10801
10827
|
expiresAt: printable(64).min(1)
|
|
10802
10828
|
}).strict();
|
|
10803
10829
|
var DeviceCommandPollResponse = object({ command: DeviceCommand.nullable() });
|
|
10830
|
+
var SessionHoldResponse = object({
|
|
10831
|
+
held: boolean2(),
|
|
10832
|
+
reason: printable(500).optional()
|
|
10833
|
+
});
|
|
10804
10834
|
var DeviceCommandFailureReason = _enum(["scan_failed", "no_projects", "expired"]);
|
|
10805
10835
|
var DeviceCommandAckBody = discriminatedUnion("outcome", [
|
|
10806
10836
|
object({
|
|
@@ -10818,7 +10848,8 @@ var sightingKeyMaterial = string2().regex(SIGHTING_KEY_MATERIAL, "must be the ba
|
|
|
10818
10848
|
var sightingKeyVersion = number2().int().min(1);
|
|
10819
10849
|
var SightingKeyVersion = object({
|
|
10820
10850
|
keyVersion: sightingKeyVersion,
|
|
10821
|
-
key: sightingKeyMaterial
|
|
10851
|
+
key: sightingKeyMaterial,
|
|
10852
|
+
acceptedUntil: iso_exports.datetime({ offset: true }).optional().catch(void 0)
|
|
10822
10853
|
});
|
|
10823
10854
|
var SightingKeyResponse = object({
|
|
10824
10855
|
keyVersion: sightingKeyVersion,
|
|
@@ -10835,7 +10866,8 @@ var SightingKeyResponse = object({
|
|
|
10835
10866
|
var StoredSightingKeys = SightingKeyResponse.and(
|
|
10836
10867
|
object({
|
|
10837
10868
|
fetchedAtMs: number2().int().nonnegative(),
|
|
10838
|
-
endpointFingerprint: string2().regex(/^[0-9a-f]{64}$/)
|
|
10869
|
+
endpointFingerprint: string2().regex(/^[0-9a-f]{64}$/),
|
|
10870
|
+
previousFirstSeenAtMs: record(string2().regex(/^[1-9][0-9]*$/), number2().int().nonnegative()).optional()
|
|
10839
10871
|
})
|
|
10840
10872
|
);
|
|
10841
10873
|
var CREDENTIAL_SIGHTINGS_BATCH_MAX = 500;
|
|
@@ -10850,6 +10882,7 @@ var SightingProject = object({
|
|
|
10850
10882
|
}).strict().meta({ id: "SightingProject" });
|
|
10851
10883
|
var CredentialSighting = object({
|
|
10852
10884
|
token: string2().regex(SIGHTING_TOKEN_ANCHORED),
|
|
10885
|
+
aliases: SightingAliases.optional(),
|
|
10853
10886
|
ruleId: printable(256).min(1),
|
|
10854
10887
|
category: literal("secret"),
|
|
10855
10888
|
variableName: VariableName.min(1).optional(),
|
|
@@ -10860,7 +10893,9 @@ var CredentialSighting = object({
|
|
|
10860
10893
|
}).strict().meta({ id: "CredentialSighting" });
|
|
10861
10894
|
var CredentialSightingsRequest = object({
|
|
10862
10895
|
sightings: array(CredentialSighting).min(1).max(CREDENTIAL_SIGHTINGS_BATCH_MAX),
|
|
10863
|
-
scanId: uuid2().optional()
|
|
10896
|
+
scanId: uuid2().optional(),
|
|
10897
|
+
/** The earlier digests of the one project every sighting in the request names. */
|
|
10898
|
+
supersededProjectKeys: SupersededProjectKeys.optional()
|
|
10864
10899
|
}).strict().meta({ id: "CredentialSightingsRequest" });
|
|
10865
10900
|
var CredentialSightingsAck = object({
|
|
10866
10901
|
accepted: number2().int().nonnegative()
|
|
@@ -10987,6 +11022,22 @@ var Policy = object({
|
|
|
10987
11022
|
var RedactFallback = BuiltinPolicyId.extract(["monitor", "warn", "block"]).meta({
|
|
10988
11023
|
id: "RedactFallback"
|
|
10989
11024
|
});
|
|
11025
|
+
var ModelPolicy = object({
|
|
11026
|
+
mode: literal("allowlist"),
|
|
11027
|
+
approved: array(string2().min(1).max(512)).max(1e3)
|
|
11028
|
+
}).meta({ id: "ModelPolicy" });
|
|
11029
|
+
var TOOL_OUTPUT_FORWARD_MIN_CHARS = 2;
|
|
11030
|
+
var TOOL_OUTPUT_FORWARD_MAX_CHARS = 65536;
|
|
11031
|
+
var CAPTURE_REPOS_MAX = 1e3;
|
|
11032
|
+
var CaptureRepos = array(string2().min(1).max(512)).max(CAPTURE_REPOS_MAX);
|
|
11033
|
+
var CaptureSettings = object({
|
|
11034
|
+
toolOutput: object({
|
|
11035
|
+
maxChars: number2().int().min(TOOL_OUTPUT_FORWARD_MIN_CHARS).max(TOOL_OUTPUT_FORWARD_MAX_CHARS),
|
|
11036
|
+
repos: CaptureRepos.optional()
|
|
11037
|
+
}).optional(),
|
|
11038
|
+
reviewValueRepos: CaptureRepos.optional(),
|
|
11039
|
+
sessionHold: boolean2().optional()
|
|
11040
|
+
}).meta({ id: "CaptureSettings" });
|
|
10990
11041
|
var PolicyBundle = object({
|
|
10991
11042
|
version: string2(),
|
|
10992
11043
|
policies: array(Policy),
|
|
@@ -11037,6 +11088,9 @@ var PolicyBundle = object({
|
|
|
11037
11088
|
// control plane), so no name resolution stands between the decision and the
|
|
11038
11089
|
// comparison.
|
|
11039
11090
|
prohibitedModels: array(string2()).optional(),
|
|
11091
|
+
// Optional so an older backend, and an older on-disk cache, still parses; absent leaves every
|
|
11092
|
+
// model approved.
|
|
11093
|
+
modelPolicy: ModelPolicy.optional(),
|
|
11040
11094
|
// What a resolved `redact` becomes on a field the host cannot rewrite, as
|
|
11041
11095
|
// the ORGANIZATION would have it. Merged raise-only against the device's own
|
|
11042
11096
|
// `WorkspaceSettings.redactFallback` (see strongerRedactFallback below), so
|
|
@@ -11047,6 +11101,9 @@ var PolicyBundle = object({
|
|
|
11047
11101
|
// absent leaves the device's own setting in force, which is the behaviour
|
|
11048
11102
|
// that predates the field and the safe direction to default.
|
|
11049
11103
|
redactFallback: RedactFallback.optional(),
|
|
11104
|
+
// Optional so an older backend, and an older on-disk cache, still parses; absent sends what
|
|
11105
|
+
// the machine sent before the field existed.
|
|
11106
|
+
capture: CaptureSettings.optional(),
|
|
11050
11107
|
customKeywords: array(string2()),
|
|
11051
11108
|
fetchedAt: iso_exports.datetime()
|
|
11052
11109
|
}).meta({ id: "PolicyBundle" });
|
|
@@ -11054,7 +11111,9 @@ var POLICY_BUNDLE_SHAPE_ID = [
|
|
|
11054
11111
|
...Object.keys(PolicyBundle.shape),
|
|
11055
11112
|
...Object.keys(Policy.shape).map((key) => `policies.${key}`),
|
|
11056
11113
|
...PolicyTarget.options.flatMap((member) => "shape" in member ? Object.keys(member.shape) : []).map((key) => `policies.target.${key}`),
|
|
11057
|
-
...Object.keys(ExceptionBundleEntry.shape).map((key) => `exceptions.${key}`)
|
|
11114
|
+
...Object.keys(ExceptionBundleEntry.shape).map((key) => `exceptions.${key}`),
|
|
11115
|
+
...Object.keys(ModelPolicy.shape).map((key) => `modelPolicy.${key}`),
|
|
11116
|
+
...Object.keys(CaptureSettings.shape).map((key) => `capture.${key}`)
|
|
11058
11117
|
].sort().join(",");
|
|
11059
11118
|
var OBSERVE_ONLY_CATEGORIES = ["config"];
|
|
11060
11119
|
var ENFORCEABLE_CATEGORIES = DetectionCategory.options.filter((c) => !OBSERVE_ONLY_CATEGORIES.includes(c));
|
|
@@ -11446,7 +11505,7 @@ var DetectedWebAccounts = object({
|
|
|
11446
11505
|
var DetectedWebAccountsEnvelope = DetectedWebAccounts.extend({ accounts: array(unknown()) });
|
|
11447
11506
|
|
|
11448
11507
|
// ../../packages/schema/src/zod/local.ts
|
|
11449
|
-
var WORKSPACE_SETTINGS_SPEC_VERSION =
|
|
11508
|
+
var WORKSPACE_SETTINGS_SPEC_VERSION = 11;
|
|
11450
11509
|
var MODEL_JUDGE_PAYLOAD_VERSION = 1;
|
|
11451
11510
|
var RunMode = _enum(["standalone", "attached"]);
|
|
11452
11511
|
var ControlPlaneConnection = object({
|
|
@@ -11606,6 +11665,15 @@ var BodyRetention = object({
|
|
|
11606
11665
|
// candidate set that is already bounded by "delivered, or never owed".
|
|
11607
11666
|
retainDays: number2().int().min(1).max(3650).default(BODY_RETENTION_DEFAULT_DAYS)
|
|
11608
11667
|
}).meta({ id: "BodyRetention" });
|
|
11668
|
+
var MAX_PROTECTED_PATH_ENTRIES = 256;
|
|
11669
|
+
var MAX_PROTECTED_PATH_ENTRY_CHARS = 1024;
|
|
11670
|
+
var ProtectedPathEntry = string2().trim().min(1).max(MAX_PROTECTED_PATH_ENTRY_CHARS);
|
|
11671
|
+
var ProtectedPaths = array(unknown()).transform(
|
|
11672
|
+
(entries) => entries.flatMap((entry) => {
|
|
11673
|
+
const parsed = ProtectedPathEntry.safeParse(entry);
|
|
11674
|
+
return parsed.success ? [parsed.data] : [];
|
|
11675
|
+
}).slice(0, MAX_PROTECTED_PATH_ENTRIES)
|
|
11676
|
+
);
|
|
11609
11677
|
var WorkspaceSettings = object({
|
|
11610
11678
|
specVersion: number2().int().positive().default(WORKSPACE_SETTINGS_SPEC_VERSION),
|
|
11611
11679
|
runMode: RunMode.default("standalone"),
|
|
@@ -11696,7 +11764,18 @@ var WorkspaceSettings = object({
|
|
|
11696
11764
|
bodyRetention: BodyRetention.default({
|
|
11697
11765
|
enabled: false,
|
|
11698
11766
|
retainDays: BODY_RETENTION_DEFAULT_DAYS
|
|
11699
|
-
})
|
|
11767
|
+
}),
|
|
11768
|
+
// Folders and file name globs whose files a tool call may not touch
|
|
11769
|
+
// unflagged: a Read, Grep, Glob or Bash naming one becomes a finding under
|
|
11770
|
+
// the command-risk pack's policy. Absent means none are protected, and
|
|
11771
|
+
// protectedPathsOf is the one reader.
|
|
11772
|
+
//
|
|
11773
|
+
// A bad entry is dropped on its own (see ProtectedPaths); `.catch(undefined)`
|
|
11774
|
+
// reads a value that is not a list at all as no list. A settings.json that
|
|
11775
|
+
// fails this schema reads as the unonboarded defaults, and the next save
|
|
11776
|
+
// writes those back over it, so a malformed value must not cost every other
|
|
11777
|
+
// setting. Not a ManagedSettingKey.
|
|
11778
|
+
protectedPaths: ProtectedPaths.optional().catch(void 0)
|
|
11700
11779
|
});
|
|
11701
11780
|
function defaultWorkspaceSettings() {
|
|
11702
11781
|
return WorkspaceSettings.parse({});
|
|
@@ -12043,6 +12122,9 @@ var ConfigInventoryAck = object({
|
|
|
12043
12122
|
accepted: number2().int().nonnegative()
|
|
12044
12123
|
});
|
|
12045
12124
|
|
|
12125
|
+
// ../../packages/schema/src/zod/credential-status.ts
|
|
12126
|
+
var CredentialStatus = _enum(["rotation_overdue", "exposed"]).meta({ id: "CredentialStatus" });
|
|
12127
|
+
|
|
12046
12128
|
// ../../packages/schema/src/zod/registry.ts
|
|
12047
12129
|
var Namespace = string2().regex(/^[a-z][a-z0-9-]*$/);
|
|
12048
12130
|
var PackId = string2().regex(/^[a-z][a-z0-9-]*$/);
|
|
@@ -13852,6 +13934,48 @@ function codingScopeExtras(dataDir2, settings, credential) {
|
|
|
13852
13934
|
}
|
|
13853
13935
|
}
|
|
13854
13936
|
|
|
13937
|
+
// ../../packages/persistence/src/repo-key.ts
|
|
13938
|
+
import { createHash as createHash2 } from "crypto";
|
|
13939
|
+
var SCP_FORM = /^(?:[^@/]+@)?([^/:]+):(.+)$/;
|
|
13940
|
+
var DOS_DRIVE = /^[A-Za-z]:[\\/]/;
|
|
13941
|
+
var FILE_URL = /^file:\/\//i;
|
|
13942
|
+
var SCHEME_FORM = /^[a-z][a-z0-9+.-]*:\/\/(?:[^@/]+@)?([^/:]+)(?::\d+)?(\/.*)?$/i;
|
|
13943
|
+
var SLASH = "/".charCodeAt(0);
|
|
13944
|
+
var GIT_SUFFIX = ".git";
|
|
13945
|
+
function trimSlashes(path) {
|
|
13946
|
+
let start = 0;
|
|
13947
|
+
let end = path.length;
|
|
13948
|
+
while (start < end && path.charCodeAt(start) === SLASH) start += 1;
|
|
13949
|
+
while (end > start && path.charCodeAt(end - 1) === SLASH) end -= 1;
|
|
13950
|
+
return path.slice(start, end);
|
|
13951
|
+
}
|
|
13952
|
+
function parseRemote(url2, foldsForgePathCase) {
|
|
13953
|
+
const trimmed = url2.trim();
|
|
13954
|
+
if (DOS_DRIVE.test(trimmed) || FILE_URL.test(trimmed)) return void 0;
|
|
13955
|
+
const scheme = SCHEME_FORM.exec(trimmed);
|
|
13956
|
+
const scp = scheme === null ? SCP_FORM.exec(trimmed) : null;
|
|
13957
|
+
const host = (scheme?.[1] ?? scp?.[1])?.toLowerCase();
|
|
13958
|
+
if (host === void 0) return void 0;
|
|
13959
|
+
const bare = trimSlashes((scheme === null ? scp?.[2] : scheme[2]) ?? "");
|
|
13960
|
+
const path = bare.endsWith(GIT_SUFFIX) ? bare.slice(0, -GIT_SUFFIX.length) : bare;
|
|
13961
|
+
const folds = foldsForgePathCase && CASE_INSENSITIVE_FORGES.has(host);
|
|
13962
|
+
return { host, path: folds ? path.toLowerCase() : path };
|
|
13963
|
+
}
|
|
13964
|
+
var CASE_INSENSITIVE_FORGES = /* @__PURE__ */ new Set([
|
|
13965
|
+
"github.com",
|
|
13966
|
+
"gitlab.com",
|
|
13967
|
+
"bitbucket.org"
|
|
13968
|
+
]);
|
|
13969
|
+
function canonicalGitUrl(url2) {
|
|
13970
|
+
return canonicalUnder(url2, true);
|
|
13971
|
+
}
|
|
13972
|
+
function canonicalUnder(url2, foldsForgePathCase) {
|
|
13973
|
+
const remote = parseRemote(url2, foldsForgePathCase);
|
|
13974
|
+
if (remote === void 0) return url2.trim();
|
|
13975
|
+
return remote.path === "" ? remote.host : `${remote.host}/${remote.path}`;
|
|
13976
|
+
}
|
|
13977
|
+
var SCOPE_KEY = printable(ATTACHMENT_SCOPE_IDENTITY_MAX_LENGTH);
|
|
13978
|
+
|
|
13855
13979
|
// ../../packages/persistence/src/capture-id-key.ts
|
|
13856
13980
|
import { randomBytes } from "crypto";
|
|
13857
13981
|
import { readFileSync as readFileSync4 } from "fs";
|
|
@@ -14046,9 +14170,6 @@ import { createHash as createHash4, randomUUID as randomUUID3 } from "crypto";
|
|
|
14046
14170
|
import { homedir as homedir2 } from "os";
|
|
14047
14171
|
import { isAbsolute as isAbsolute2, relative as relative2, sep as sep2 } from "path";
|
|
14048
14172
|
|
|
14049
|
-
// ../../packages/persistence/src/egress-wire.ts
|
|
14050
|
-
import { createHash as createHash2 } from "crypto";
|
|
14051
|
-
|
|
14052
14173
|
// ../../packages/persistence/src/repositories/shares.ts
|
|
14053
14174
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
14054
14175
|
|
|
@@ -14871,10 +14992,6 @@ var SqliteSharesRepository = class {
|
|
|
14871
14992
|
}
|
|
14872
14993
|
};
|
|
14873
14994
|
|
|
14874
|
-
// ../../packages/persistence/src/egress-wire.ts
|
|
14875
|
-
var SLASH = "/".charCodeAt(0);
|
|
14876
|
-
var SCOPE_KEY = printable(ATTACHMENT_SCOPE_IDENTITY_MAX_LENGTH);
|
|
14877
|
-
|
|
14878
14995
|
// ../../packages/persistence/src/git-index.ts
|
|
14879
14996
|
import { readFileSync as readFileSync5, statSync as statSync3 } from "fs";
|
|
14880
14997
|
import { dirname, isAbsolute, join as join6, relative, resolve, sep } from "path";
|
|
@@ -15001,21 +15118,30 @@ import { randomBytes as randomBytes2 } from "crypto";
|
|
|
15001
15118
|
import { chmodSync as chmodSync3, readFileSync as readFileSync8, renameSync as renameSync3, rmSync as rmSync7, statSync as statSync4, writeFileSync as writeFileSync3 } from "fs";
|
|
15002
15119
|
import { join as join9 } from "path";
|
|
15003
15120
|
|
|
15121
|
+
// ../../packages/persistence/src/vault/sighting-keys.ts
|
|
15122
|
+
var SIGHTING_KEY_OVERLAP_MAX_MS = 90 * 24 * 60 * 60 * 1e3;
|
|
15123
|
+
|
|
15004
15124
|
// ../../packages/persistence/src/database.ts
|
|
15005
15125
|
import { randomUUID as randomUUID12 } from "crypto";
|
|
15006
15126
|
import { dirname as dirname3, join as join14, sep as sep3 } from "path";
|
|
15007
15127
|
import { DatabaseSync } from "node:sqlite";
|
|
15008
15128
|
|
|
15129
|
+
// ../../packages/persistence/src/finding-key.ts
|
|
15130
|
+
import { createHash as createHash5 } from "crypto";
|
|
15131
|
+
function computeConfigPostureFindingKey(ruleId, command) {
|
|
15132
|
+
return createHash5("sha256").update(`config-posture\0${ruleId}\0${command}`).digest("hex");
|
|
15133
|
+
}
|
|
15134
|
+
|
|
15009
15135
|
// ../../packages/persistence/src/ids.ts
|
|
15010
|
-
import { createHash as
|
|
15136
|
+
import { createHash as createHash6, createHmac as createHmac2 } from "crypto";
|
|
15011
15137
|
function sha256Hex(input) {
|
|
15012
|
-
return
|
|
15138
|
+
return createHash6("sha256").update(input).digest("hex");
|
|
15013
15139
|
}
|
|
15014
15140
|
function inventoryId(objectType, identityKey) {
|
|
15015
15141
|
return sha256Hex(canonicalIdentity(["inventory", objectType, identityKey]));
|
|
15016
15142
|
}
|
|
15017
15143
|
function sourceProjectId(url2) {
|
|
15018
|
-
return sha256Hex(canonicalIdentity(["source_project", url2]));
|
|
15144
|
+
return sha256Hex(canonicalIdentity(["source_project", canonicalGitUrl(url2)]));
|
|
15019
15145
|
}
|
|
15020
15146
|
function classifiedDataId(cls) {
|
|
15021
15147
|
return sha256Hex(canonicalIdentity(["classified_data", cls]));
|
|
@@ -16681,7 +16807,7 @@ function ensureRuleProbeCacheTable(db) {
|
|
|
16681
16807
|
}
|
|
16682
16808
|
|
|
16683
16809
|
// ../../packages/persistence/src/mod-policy-snapshot.ts
|
|
16684
|
-
import { createHash as
|
|
16810
|
+
import { createHash as createHash7 } from "crypto";
|
|
16685
16811
|
import { readFileSync as readFileSync10 } from "fs";
|
|
16686
16812
|
import { join as join12 } from "path";
|
|
16687
16813
|
var MOD_POLICY_SNAPSHOT_FILENAME = "mod-policy.json";
|
|
@@ -16750,7 +16876,7 @@ function writeModPolicySnapshot(dataDir2, snapshot) {
|
|
|
16750
16876
|
return true;
|
|
16751
16877
|
}
|
|
16752
16878
|
function regexProbeKey(matcher) {
|
|
16753
|
-
return
|
|
16879
|
+
return createHash7("sha256").update(`${matcher.pattern} ${matcher.flags}`).digest("hex");
|
|
16754
16880
|
}
|
|
16755
16881
|
function vetRulesForMod(rules, sources, previouslyVetted = /* @__PURE__ */ new Set()) {
|
|
16756
16882
|
const bundled = new Set(sources.bundledRegexMatchers().map(regexProbeKey));
|
|
@@ -19626,7 +19752,7 @@ var SqliteInspectionFindingsRepository = class {
|
|
|
19626
19752
|
};
|
|
19627
19753
|
|
|
19628
19754
|
// ../../packages/persistence/src/repositories/installed-packs.ts
|
|
19629
|
-
import { createHash as
|
|
19755
|
+
import { createHash as createHash8, randomUUID as randomUUID6 } from "crypto";
|
|
19630
19756
|
|
|
19631
19757
|
// ../../packages/persistence/src/policy-floor.ts
|
|
19632
19758
|
import { readFileSync as readFileSync11 } from "fs";
|
|
@@ -19787,7 +19913,7 @@ function inventorySignature(packs) {
|
|
|
19787
19913
|
return packs.map((p) => `${p.namespace}/${p.packId}@${p.version}#${hashRules(p.rulesJson)}`).sort().join(",");
|
|
19788
19914
|
}
|
|
19789
19915
|
function hashRules(rulesJson) {
|
|
19790
|
-
return
|
|
19916
|
+
return createHash8("sha256").update(rulesJson).digest("hex");
|
|
19791
19917
|
}
|
|
19792
19918
|
function parseVersion(v) {
|
|
19793
19919
|
const m = /^(\d+)\.(\d+)\.(\d+)/.exec(v);
|
|
@@ -20361,7 +20487,7 @@ var SqliteInventoryRepository = class {
|
|
|
20361
20487
|
import { randomUUID as randomUUID7 } from "crypto";
|
|
20362
20488
|
var CATEGORY_ORDER = ["config", "skill", "mcp", "hook"];
|
|
20363
20489
|
var VALID_HARNESS_IDS = new Set(HarnessId.options);
|
|
20364
|
-
var
|
|
20490
|
+
var GHOST_PROJECT_FILTER = "(url IS NULL OR (url NOT LIKE '%/.claude/worktrees/%' AND url NOT LIKE '%\\.claude\\worktrees\\%' AND url NOT LIKE '%/.git/worktrees/%' AND url NOT LIKE '%\\.git\\worktrees\\%'))";
|
|
20365
20491
|
var HARNESS_LABELS = {
|
|
20366
20492
|
[HARNESS.ClaudeCode]: "Claude Code",
|
|
20367
20493
|
[HARNESS.Cursor]: "Cursor",
|
|
@@ -20370,6 +20496,7 @@ var HARNESS_LABELS = {
|
|
|
20370
20496
|
[HARNESS.Copilot]: "GitHub Copilot"
|
|
20371
20497
|
};
|
|
20372
20498
|
var HARNESS_LIVENESS_WINDOW_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
20499
|
+
var ATTENTION_TRUST_SQL = ATTENTION_TRUST_LEVELS.map((t) => `'${t}'`).join(", ");
|
|
20373
20500
|
var PROJECT_FINDINGS_WINDOW_MS = PROJECT_FINDINGS_WINDOW_DAYS * 24 * 60 * 60 * 1e3;
|
|
20374
20501
|
var MCP_TOOLS_USED_WINDOW_MS = MCP_TOOLS_USED_WINDOW_DAYS * 24 * 60 * 60 * 1e3;
|
|
20375
20502
|
var PROJECT_FINDINGS_FROM = `audit_events s
|
|
@@ -20443,11 +20570,7 @@ function buildAssetDetail(row) {
|
|
|
20443
20570
|
finding: null
|
|
20444
20571
|
};
|
|
20445
20572
|
if (row.assetType === "mcp" && row.toolsJson !== null) {
|
|
20446
|
-
|
|
20447
|
-
detail.tools = row.effectiveTrust === "unapproved" ? rawTools.map((t) => ({
|
|
20448
|
-
...t,
|
|
20449
|
-
risk: t.risk ?? "Tool access blocked: MCP server trust is unapproved."
|
|
20450
|
-
})) : rawTools;
|
|
20573
|
+
detail.tools = safeJson(row.toolsJson, []);
|
|
20451
20574
|
}
|
|
20452
20575
|
return detail;
|
|
20453
20576
|
}
|
|
@@ -20512,7 +20635,7 @@ var SqliteInventoryAssetsRepository = class {
|
|
|
20512
20635
|
};
|
|
20513
20636
|
byType.project = countScalar(
|
|
20514
20637
|
this.db,
|
|
20515
|
-
`SELECT count(*) AS n FROM source_project WHERE ${
|
|
20638
|
+
`SELECT count(*) AS n FROM source_project WHERE ${GHOST_PROJECT_FILTER}`
|
|
20516
20639
|
);
|
|
20517
20640
|
const mcpTrustCounts = countBy(
|
|
20518
20641
|
this.db,
|
|
@@ -20536,12 +20659,17 @@ var SqliteInventoryAssetsRepository = class {
|
|
|
20536
20659
|
);
|
|
20537
20660
|
const flaggedAssets = countScalar(
|
|
20538
20661
|
this.db,
|
|
20539
|
-
|
|
20662
|
+
`SELECT count(*) AS n
|
|
20663
|
+
FROM inventory_asset a
|
|
20664
|
+
LEFT JOIN mcp_trust_override o ON o.asset_id = a.id
|
|
20665
|
+
WHERE a.flags_json <> '[]'
|
|
20666
|
+
OR (a.asset_type = 'mcp'
|
|
20667
|
+
AND coalesce(o.trust, a.trust) IN (${ATTENTION_TRUST_SQL}))`
|
|
20540
20668
|
);
|
|
20541
20669
|
const flaggedProjects = countScalar(
|
|
20542
20670
|
this.db,
|
|
20543
20671
|
`SELECT count(*) AS n FROM source_project p
|
|
20544
|
-
WHERE ${
|
|
20672
|
+
WHERE ${GHOST_PROJECT_FILTER}
|
|
20545
20673
|
AND EXISTS (SELECT 1 FROM ${PROJECT_FINDINGS_FROM}
|
|
20546
20674
|
WHERE s.source_project_id = p.id AND ${PROJECT_FINDINGS_JOIN})`,
|
|
20547
20675
|
[this.findingsSince()]
|
|
@@ -20551,7 +20679,9 @@ var SqliteInventoryAssetsRepository = class {
|
|
|
20551
20679
|
byType[r.assetType] += 1;
|
|
20552
20680
|
if (r.assetType === "mcp" && r.effectiveTrust) mcpTrust[r.effectiveTrust] += 1;
|
|
20553
20681
|
}
|
|
20554
|
-
const flaggedConfig = configRows.filter(
|
|
20682
|
+
const flaggedConfig = configRows.filter(
|
|
20683
|
+
(r) => r.flagsJson !== "[]" || r.assetType === "mcp" && isAttentionTrust(r.effectiveTrust)
|
|
20684
|
+
).length;
|
|
20555
20685
|
return Promise.resolve({
|
|
20556
20686
|
attention: flaggedAssets + flaggedProjects + flaggedConfig,
|
|
20557
20687
|
byType,
|
|
@@ -21006,7 +21136,7 @@ var SqliteInventoryAssetsRepository = class {
|
|
|
21006
21136
|
}
|
|
21007
21137
|
fetchProjects(q) {
|
|
21008
21138
|
let sql = `SELECT id, url, name, attributes, last_seen AS lastSeen FROM source_project
|
|
21009
|
-
WHERE ${
|
|
21139
|
+
WHERE ${GHOST_PROJECT_FILTER}`;
|
|
21010
21140
|
const params = [];
|
|
21011
21141
|
if (q) {
|
|
21012
21142
|
const pat = containsPattern(q);
|
|
@@ -23281,7 +23411,8 @@ function openLocalDatabase(dir, options = {}) {
|
|
|
23281
23411
|
span: finding.span,
|
|
23282
23412
|
maskedMatch: finding.maskedMatch,
|
|
23283
23413
|
actionTaken: finding.actionTaken,
|
|
23284
|
-
confidence: finding.confidence
|
|
23414
|
+
confidence: finding.confidence,
|
|
23415
|
+
findingKey: computeConfigPostureFindingKey(finding.ruleId, finding.maskedMatch)
|
|
23285
23416
|
});
|
|
23286
23417
|
}
|
|
23287
23418
|
});
|
|
@@ -23306,17 +23437,30 @@ function openLocalDatabase(dir, options = {}) {
|
|
|
23306
23437
|
throw err;
|
|
23307
23438
|
}
|
|
23308
23439
|
}
|
|
23309
|
-
function reconcileWorktreeProjects(canonicalId, headRoot, worktreeRoot) {
|
|
23440
|
+
function reconcileWorktreeProjects(canonicalId, headRoot, worktreeRoot, supersededUrls = []) {
|
|
23310
23441
|
try {
|
|
23311
23442
|
const headPosix = headRoot.split(sep3).join("/");
|
|
23312
23443
|
const worktreePosix = worktreeRoot.split(sep3).join("/");
|
|
23313
23444
|
const exactArm = worktreeRoot === headRoot ? "" : "url IN (:worktreePosix, :worktreeWin) OR ";
|
|
23445
|
+
const superseded = [
|
|
23446
|
+
...new Set(
|
|
23447
|
+
supersededUrls.flatMap((url2) => {
|
|
23448
|
+
const posix2 = url2.split(sep3).join("/");
|
|
23449
|
+
return [posix2, posix2.split("/").join("\\")];
|
|
23450
|
+
})
|
|
23451
|
+
)
|
|
23452
|
+
];
|
|
23453
|
+
const supersededParams = Object.fromEntries(
|
|
23454
|
+
superseded.map((url2, i) => [`superseded${String(i)}`, url2])
|
|
23455
|
+
);
|
|
23456
|
+
const supersededArm = superseded.length === 0 ? "" : `url IN (${superseded.map((_, i) => `:superseded${String(i)}`).join(", ")}) OR `;
|
|
23314
23457
|
const stale = db.prepare(
|
|
23315
23458
|
`SELECT id FROM source_project
|
|
23316
23459
|
WHERE id <> :canonicalId
|
|
23317
|
-
AND (${exactArm}url LIKE :pattern ESCAPE '\\' OR url LIKE :patternWin ESCAPE '\\')`
|
|
23460
|
+
AND (${supersededArm}${exactArm}url LIKE :pattern ESCAPE '\\' OR url LIKE :patternWin ESCAPE '\\')`
|
|
23318
23461
|
).all({
|
|
23319
23462
|
canonicalId,
|
|
23463
|
+
...supersededParams,
|
|
23320
23464
|
...worktreeRoot === headRoot ? {} : { worktreePosix, worktreeWin: worktreePosix.split("/").join("\\") },
|
|
23321
23465
|
pattern: `${escapeLikePattern(headPosix)}/.claude/worktrees/%`,
|
|
23322
23466
|
patternWin: `${escapeLikePattern(headPosix.split("/").join("\\"))}\\\\.claude\\\\worktrees\\\\%`
|
|
@@ -23399,9 +23543,6 @@ import { readFileSync as readFileSync12, rmSync as rmSync10 } from "fs";
|
|
|
23399
23543
|
import { join as join15 } from "path";
|
|
23400
23544
|
var DETECTED_WEB_ACCOUNT_RESIGHT_MS = 60 * 60 * 1e3;
|
|
23401
23545
|
|
|
23402
|
-
// ../../packages/persistence/src/finding-key.ts
|
|
23403
|
-
import { createHash as createHash8 } from "crypto";
|
|
23404
|
-
|
|
23405
23546
|
// ../../packages/persistence/src/fingerprint.ts
|
|
23406
23547
|
import { createHmac as createHmac3, randomBytes as randomBytes3 } from "crypto";
|
|
23407
23548
|
import { existsSync as existsSync3, readFileSync as readFileSync13 } from "fs";
|
|
@@ -23469,8 +23610,8 @@ import { dirname as dirname5 } from "path";
|
|
|
23469
23610
|
|
|
23470
23611
|
// ../../packages/plugin-runtime/src/attached/config-inventory-sync.ts
|
|
23471
23612
|
import { createHash as createHash10 } from "crypto";
|
|
23472
|
-
import { readFileSync as
|
|
23473
|
-
import { join as
|
|
23613
|
+
import { readFileSync as readFileSync17 } from "fs";
|
|
23614
|
+
import { join as join26 } from "path";
|
|
23474
23615
|
|
|
23475
23616
|
// ../../packages/plugin-runtime/src/attached/history-sync.ts
|
|
23476
23617
|
import { createHash as createHash9 } from "crypto";
|
|
@@ -23484,9 +23625,9 @@ var REDACT_DEGRADED_TO = EventMetadata.shape.redactDegradedTo.unwrap();
|
|
|
23484
23625
|
var SCAN_INCOMPLETE = EventMetadata.shape.scanIncomplete.unwrap();
|
|
23485
23626
|
|
|
23486
23627
|
// ../../packages/plugin-runtime/src/attached/policy-store.ts
|
|
23487
|
-
import { randomUUID as
|
|
23488
|
-
import { readFile as readFile2, rm, writeFile as
|
|
23489
|
-
import { join as
|
|
23628
|
+
import { randomUUID as randomUUID16 } from "crypto";
|
|
23629
|
+
import { readFile as readFile2, rm as rm2, writeFile as writeFile3 } from "fs/promises";
|
|
23630
|
+
import { join as join25 } from "path";
|
|
23490
23631
|
|
|
23491
23632
|
// ../../packages/plugin-runtime/src/attached/atomic-publish.ts
|
|
23492
23633
|
import { rename as rename2 } from "fs/promises";
|
|
@@ -23494,6 +23635,16 @@ var IMMEDIATE_RETRIES = 8;
|
|
|
23494
23635
|
var TIMED_RETRIES = 4;
|
|
23495
23636
|
var ATTEMPTS = 1 + IMMEDIATE_RETRIES + TIMED_RETRIES;
|
|
23496
23637
|
|
|
23638
|
+
// ../../packages/plugin-runtime/src/attached/capture-settings.ts
|
|
23639
|
+
import { randomUUID as randomUUID15 } from "crypto";
|
|
23640
|
+
import { readFileSync as readFileSync16 } from "fs";
|
|
23641
|
+
import { rm, writeFile as writeFile2 } from "fs/promises";
|
|
23642
|
+
import { join as join24 } from "path";
|
|
23643
|
+
var HookCaptureSettingsSchema = CaptureSettings.pick({
|
|
23644
|
+
toolOutput: true,
|
|
23645
|
+
sessionHold: true
|
|
23646
|
+
});
|
|
23647
|
+
|
|
23497
23648
|
// ../../packages/plugin-runtime/src/attached/history-sync.ts
|
|
23498
23649
|
var CAPTURE_BATCH_BYTES = 1024 * 1024;
|
|
23499
23650
|
|
|
@@ -23503,22 +23654,22 @@ var CONFIG_INVENTORY_STAGED_MAX_AGE_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
|
23503
23654
|
var CONFIG_INVENTORY_STAGED_MAX_BYTES = 8 * 1024 * 1024;
|
|
23504
23655
|
|
|
23505
23656
|
// ../../packages/plugin-runtime/src/attached/forward-drops.ts
|
|
23506
|
-
import { readFileSync as
|
|
23507
|
-
import { join as
|
|
23657
|
+
import { readFileSync as readFileSync18 } from "fs";
|
|
23658
|
+
import { join as join27 } from "path";
|
|
23508
23659
|
|
|
23509
23660
|
// ../../packages/plugin-runtime/src/attached/plugin-block.ts
|
|
23510
|
-
import { readFileSync as
|
|
23661
|
+
import { readFileSync as readFileSync19 } from "fs";
|
|
23511
23662
|
|
|
23512
23663
|
// ../../packages/plugin-runtime/src/attached/install-record.ts
|
|
23513
23664
|
import { readFile as readFile3, stat } from "fs/promises";
|
|
23514
|
-
import { basename as basename2, dirname as dirname6, join as
|
|
23665
|
+
import { basename as basename2, dirname as dirname6, join as join28, resolve as resolve3 } from "path";
|
|
23515
23666
|
|
|
23516
23667
|
// ../../packages/plugin-runtime/src/attached/plugin-block.ts
|
|
23517
23668
|
var INSTALL_RECORD_READ_TIMEOUT_MS = REQUEST_TIMEOUT_MS / 2;
|
|
23518
23669
|
|
|
23519
23670
|
// ../../packages/plugin-runtime/src/attached/posture-report-state.ts
|
|
23520
|
-
import { readFileSync as
|
|
23521
|
-
import { join as
|
|
23671
|
+
import { readFileSync as readFileSync20 } from "fs";
|
|
23672
|
+
import { join as join29 } from "path";
|
|
23522
23673
|
var OUTCOME_KEYS = {
|
|
23523
23674
|
ok: true,
|
|
23524
23675
|
unauthorized: true,
|
|
@@ -23539,18 +23690,18 @@ import { statSync as statSync7 } from "fs";
|
|
|
23539
23690
|
import { DatabaseSync as DatabaseSync3 } from "node:sqlite";
|
|
23540
23691
|
|
|
23541
23692
|
// ../../packages/plugin-runtime/src/attached/posture-store.ts
|
|
23542
|
-
import { randomUUID as
|
|
23543
|
-
import { readFile as readFile4, rm as
|
|
23544
|
-
import { join as join29 } from "path";
|
|
23545
|
-
|
|
23546
|
-
// ../../packages/plugin-runtime/src/attached/label-drops.ts
|
|
23547
|
-
import { readFileSync as readFileSync20 } from "fs";
|
|
23693
|
+
import { randomUUID as randomUUID17 } from "crypto";
|
|
23694
|
+
import { readFile as readFile4, rm as rm3, writeFile as writeFile4 } from "fs/promises";
|
|
23548
23695
|
import { join as join30 } from "path";
|
|
23549
23696
|
|
|
23550
|
-
// ../../packages/plugin-runtime/src/attached/
|
|
23697
|
+
// ../../packages/plugin-runtime/src/attached/label-drops.ts
|
|
23551
23698
|
import { readFileSync as readFileSync21 } from "fs";
|
|
23552
23699
|
import { join as join31 } from "path";
|
|
23553
23700
|
|
|
23701
|
+
// ../../packages/plugin-runtime/src/attached/sync-state.ts
|
|
23702
|
+
import { readFileSync as readFileSync22 } from "fs";
|
|
23703
|
+
import { join as join32 } from "path";
|
|
23704
|
+
|
|
23554
23705
|
// ../../packages/plugin-runtime/src/attached/status.ts
|
|
23555
23706
|
var REFUSAL_LINES = {
|
|
23556
23707
|
unauthorized: "KEY REJECTED \u2014 re-attach with a valid plugin key",
|
|
@@ -23580,10 +23731,13 @@ var WORK_LINES = {
|
|
|
23580
23731
|
// ../../packages/plugin-runtime/src/attached/history-sync-trigger.ts
|
|
23581
23732
|
import { spawn } from "child_process";
|
|
23582
23733
|
import { existsSync as existsSync8, statSync as statSync8 } from "fs";
|
|
23583
|
-
import { join as
|
|
23734
|
+
import { join as join33 } from "path";
|
|
23584
23735
|
import { fileURLToPath } from "url";
|
|
23585
23736
|
var HISTORY_SYNC_THROTTLE_MS = 5 * 60 * 1e3;
|
|
23586
23737
|
|
|
23738
|
+
// ../../packages/plugin-runtime/src/attached/session-hold.ts
|
|
23739
|
+
import { dirname as dirname7 } from "path";
|
|
23740
|
+
|
|
23587
23741
|
// ../../packages/plugin-runtime/src/attached/sighting-key-sync.ts
|
|
23588
23742
|
var SIGHTING_KEY_MAX_AGE_MS = 24 * 60 * 60 * 1e3;
|
|
23589
23743
|
|
|
@@ -23642,10 +23796,10 @@ import { fileURLToPath as fileURLToPath3 } from "url";
|
|
|
23642
23796
|
var CONTENT_RETENTION_THROTTLE_MS = 60 * 60 * 1e3;
|
|
23643
23797
|
|
|
23644
23798
|
// ../../packages/plugin-runtime/src/handle-session-start.ts
|
|
23645
|
-
import { randomUUID as
|
|
23799
|
+
import { randomUUID as randomUUID18 } from "crypto";
|
|
23646
23800
|
|
|
23647
23801
|
// ../../packages/plugin-runtime/src/attached/forwarding-line.ts
|
|
23648
|
-
import { dirname as
|
|
23802
|
+
import { dirname as dirname8 } from "path";
|
|
23649
23803
|
|
|
23650
23804
|
// ../../packages/plugin-runtime/src/handle-session-start.ts
|
|
23651
23805
|
var EXCEPTION_RETENTION_MS = 90 * 24 * 60 * 60 * 1e3;
|