behavior-wrapped 0.5.4 → 0.5.6
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/README.md +1 -1
- package/dist/assets/{index-CjVXZflP.css → index-CPQ2kLo6.css} +1 -1
- package/dist/assets/index-DSBlFEQG.js +11 -0
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/server/encrypted-donation-schema.mjs +2 -1
- package/server/research-donation-crypto.mjs +2 -2
- package/server/research-donation-schema.mjs +2 -2
- package/dist/assets/index-BGyq_Jyw.js +0 -11
package/dist/index.html
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
<meta name="theme-color" content="#0d0b1b" />
|
|
7
7
|
<meta name="description" content="Your private, local-first Claude Code behavior report." />
|
|
8
8
|
<title>Behavior Wrapped</title>
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
10
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-DSBlFEQG.js"></script>
|
|
10
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CPQ2kLo6.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
|
13
13
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -3,6 +3,7 @@ import { MAX_DONATION_BYTES } from "./research-donation-schema.mjs";
|
|
|
3
3
|
export const DONATION_ENVELOPE_FORMAT = "behavior-wrapped-encrypted-donation-v1";
|
|
4
4
|
export const DONATION_ENCRYPTION_ALGORITHM = "RSA-OAEP-256+A256GCM";
|
|
5
5
|
export const DONATION_KEY_ID = "research-donation-rsa-2026-08";
|
|
6
|
+
export const DONATION_CONSENT_VERSION = 2;
|
|
6
7
|
export const MAX_ENCRYPTED_DONATION_BYTES = 2_500_000;
|
|
7
8
|
|
|
8
9
|
const base64url = /^[A-Za-z0-9_-]+$/;
|
|
@@ -39,7 +40,7 @@ export function sanitizeEncryptedDonationEnvelope(value) {
|
|
|
39
40
|
if (!/^[A-Za-z0-9_-]{8,32}$/.test(metadata.reportId || "")) return null;
|
|
40
41
|
if (!new Set(["standard", "custom", "unredacted"]).has(metadata.redactionMode)) return null;
|
|
41
42
|
if (!timestamp.test(metadata.createdAt || "") || !timestamp.test(metadata.consentedAt || "")) return null;
|
|
42
|
-
if (metadata.consentVersion
|
|
43
|
+
if (!new Set([1, DONATION_CONSENT_VERSION]).has(metadata.consentVersion) || typeof metadata.unredactedData !== "boolean" || metadata.unredactedData !== (metadata.redactionMode === "unredacted")) return null;
|
|
43
44
|
if (!boundedInteger(metadata.automatedDetections, 1_000_000) || !boundedInteger(metadata.sessions, 250) || metadata.sessions < 1 || !boundedInteger(metadata.messages, 50_000) || metadata.messages < 1) return null;
|
|
44
45
|
return value;
|
|
45
46
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import crypto from "node:crypto";
|
|
2
|
-
import { DONATION_ENCRYPTION_ALGORITHM, DONATION_ENVELOPE_FORMAT, DONATION_KEY_ID, encryptedDonationAAD, sanitizeEncryptedDonationEnvelope } from "./encrypted-donation-schema.mjs";
|
|
2
|
+
import { DONATION_CONSENT_VERSION, DONATION_ENCRYPTION_ALGORITHM, DONATION_ENVELOPE_FORMAT, DONATION_KEY_ID, encryptedDonationAAD, sanitizeEncryptedDonationEnvelope } from "./encrypted-donation-schema.mjs";
|
|
3
3
|
import { sanitizeResearchDonation } from "./research-donation-schema.mjs";
|
|
4
4
|
|
|
5
5
|
export const RESEARCH_DONATION_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
|
|
@@ -32,7 +32,7 @@ export function encryptResearchDonation(value, publicKey = RESEARCH_DONATION_PUB
|
|
|
32
32
|
redactionMode: donation.redactionMode,
|
|
33
33
|
createdAt: donation.createdAt,
|
|
34
34
|
consentedAt: donation.consent.consentedAt,
|
|
35
|
-
consentVersion:
|
|
35
|
+
consentVersion: DONATION_CONSENT_VERSION,
|
|
36
36
|
unredactedData: donation.redactionMode === "unredacted",
|
|
37
37
|
automatedDetections: donation.redactionSummary.automatedDetections,
|
|
38
38
|
sessions: donation.redactionSummary.sessions,
|
|
@@ -44,8 +44,8 @@ export function sanitizeResearchDonation(value) {
|
|
|
44
44
|
researchDonation: true,
|
|
45
45
|
...(unredacted ? { unredactedData: true } : {}),
|
|
46
46
|
statement: unredacted
|
|
47
|
-
? "I understand this donation is not automatically redacted and may contain credentials, personal details, private code, URLs, and file paths. I consent to transmit it for research."
|
|
48
|
-
: "I consent for this reviewed data to be transmitted and used for research.",
|
|
47
|
+
? "I understand this donation is not automatically redacted and may contain credentials, personal details, private code, URLs, and file paths. I consent to transmit it to the Susan Calvin Project for research under the data policy."
|
|
48
|
+
: "I consent for this reviewed data to be transmitted to the Susan Calvin Project and used for research under the data policy.",
|
|
49
49
|
consentedAt: /^\d{4}-\d{2}-\d{2}T/.test(value.consent.consentedAt || "") ? value.consent.consentedAt : new Date().toISOString(),
|
|
50
50
|
},
|
|
51
51
|
};
|