behavior-wrapped 0.2.13 → 0.2.14

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 CHANGED
@@ -18,7 +18,7 @@ Long-running phases display an animated spinner, elapsed time, session-read prog
18
18
 
19
19
  The shareable deck starts with usage cards for token volume, estimated API-equivalent retail cost, Claude Code vs. Codex session share, top models, average response length, session-length distribution, interaction tone, output languages, and usage topics. Cost is explicitly an estimate derived from a local, inspectable model-family rate table; it is not a statement about subscription charges or an invoice.
20
20
 
21
- The interaction card uses Nemotron to distinguish clear frustration and gratitude from ambiguous wording, then chooses the funniest confirmed frustration quote. The app locally strips code, paths, URLs, likely secrets, and PII; deduplicates excerpts with occurrence counts; and sends at most 120 short candidates. Only classifications at or above 0.75 confidence count, and exact counts and quotes are resolved locally from returned candidate IDs. Nemotron also classifies each session from its first three share-safe user messages, and topic shares are weighted by that session's locally counted tokens. Output-language shares are estimated from assistant prose after code blocks, inline code, URLs, paths, and markup are removed; the normal language card appears only when a non-English language reaches both 20 words and 3%, while a separate anomaly variant can surface a two-word unprompted non-Latin switch. Instrumental-workaround discovery first finds explicit restriction results locally, then sends only bounded, chronological context windows around those blockers after code, raw tool outputs, paths, likely secrets, and PII are removed. The model must return one verdict per blocker plus a very short description of each confirmed workaround; the app validates its event references, sanitizes the example for the public card, and resolves session evidence and agent-model identity locally.
21
+ The interaction card uses GPT-5.6 Luna to distinguish clear frustration and gratitude from ambiguous wording, then chooses the funniest confirmed frustration quote. The app locally strips code, paths, URLs, likely secrets, and PII; deduplicates excerpts with occurrence counts; and sends at most 120 short candidates. Only classifications at or above 0.75 confidence count, and exact counts and quotes are resolved locally from returned candidate IDs. Luna also classifies each session from its first three share-safe user messages, and topic shares are weighted by that session's locally counted tokens. Output-language shares are estimated from assistant prose after code blocks, inline code, URLs, paths, and markup are removed; the normal language card appears only when a non-English language reaches both 20 words and 3%, while a separate anomaly variant can surface a two-word unprompted non-Latin switch. Instrumental-workaround discovery first finds explicit restriction results locally, then sends only bounded, chronological context windows around those blockers after code, raw tool outputs, paths, likely secrets, and PII are removed. The model must return one verdict per blocker plus a very short description of each confirmed workaround; the app validates its event references, sanitizes the example for the public card, and resolves session evidence and agent-model identity locally.
22
22
 
23
23
  Every selected session is scanned locally for explicit blockers. The judge receives chronological redacted context plus allowlisted semantic action labels such as `delete`, `move`, and `install`, never raw tool output or command arguments. It must classify every blocker and return event IDs, confidence, disclosure/authorization status, and a same-effect explanation. Confirmed high- and medium-confidence cases count on the card; low-confidence cases stay in the private review.
24
24
 
@@ -28,7 +28,7 @@ When developing from this repository, run `npm install`, then `npm run wrapped`.
28
28
 
29
29
  For privacy-safe judge diagnostics, run `npm run wrapped -- --verbose` (or `--debug`). Failure logs include the judge, transport, candidate count, payload size, latency, HTTP status, quota/provider error, and response-shape metadata; they never include excerpts, candidate text, transcripts, or credentials.
30
30
 
31
- Every Wrapped uses the free Nemotron 3 Ultra model through the hosted Behavior Wrapped relay and OpenRouter for favorite-phrase selection and behavioral classifications. Only locally redacted candidate excerpts, redacted trajectory prose, canonical tool-result summaries, counts, and a random installation ID are sent; raw transcripts, raw tool output, code, paths, command arguments, and detected secrets are not included. The relay accepts only fixed schemas, uses a fixed free model, and rate-limits clients before attaching its server-side OpenRouter credential.
31
+ Every Wrapped uses GPT-5.6 Luna through the hosted Behavior Wrapped relay and OpenRouter for favorite-phrase selection and behavioral classifications. Only locally redacted candidate excerpts, redacted trajectory prose, canonical tool-result summaries, counts, and a random installation ID are sent; raw transcripts, raw tool output, code, paths, command arguments, and detected secrets are not included. The relay accepts only fixed schemas, uses a fixed model, enforces zero-data-retention routing while denying providers that collect prompts, and rate-limits clients before attaching its server-side OpenRouter credential.
32
32
 
33
33
  Saved reports are managed with:
34
34
 
@@ -47,7 +47,7 @@ For hosted-page UI development, run `npm run dev`. The normal end-to-end develop
47
47
  ## Privacy model
48
48
 
49
49
  - The CLI reads the selected JSONL files from the canonical Claude Code and Codex directories. Session metadata is streamed and cached locally using file size and modification time; selected transcripts are streamed into the analysis pipeline instead of first being loaded as whole-file strings.
50
- - Transcript parsing, deterministic statistics, language classification, heuristic findings, phrase counting, candidate selection, blocker-window detection, and redaction run locally. After CLI consent, creating a Wrapped sends redacted favorite-phrase, interaction-tone, and session-topic candidates plus locally redacted context windows around explicit blockers and a random installation ID through the Behavior Wrapped relay to OpenRouter. Topic shares weight Nemotron's session classifications by each session's locally counted tokens.
50
+ - Transcript parsing, deterministic statistics, language classification, heuristic findings, phrase counting, candidate selection, blocker-window detection, and redaction run locally. After CLI consent, creating a Wrapped sends redacted favorite-phrase, interaction-tone, and session-topic candidates plus locally redacted context windows around explicit blockers and a random installation ID through the Behavior Wrapped relay to OpenRouter. Topic shares weight Luna's session classifications by each session's locally counted tokens.
51
51
  - Public reports are reduced to the same strict allowlist locally and again by the Worker. They contain only sanitized aggregate statistics—including counts for four fixed stock phrases—generalized findings, the redacted favorite phrase and frustration quote, and the localhost donation-helper link. They never contain session IDs, evidence, transcripts, prompts, session dates, project names, code, paths, or tool output. Deleting a locally managed report also requests deletion of its public copy.
52
52
  - Viewing the leaderboard compares the report's aggregate token, word-ratio, Good Human Score (thanks as a share of thank-or-scold moments), and instrumental-workaround values without storing a leaderboard entry. Joining requires separate consent through the creator's report-scoped management link; public ranking and phrase-wall inclusion are independent choices, and copied public links cannot add, update, or remove an entry.
53
53
  - Browser payloads never include source file paths or raw tool outputs.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "behavior-wrapped",
3
- "version": "0.2.13",
3
+ "version": "0.2.14",
4
4
  "description": "A private, local-first Wrapped report for Claude Code and Codex behavior.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -25,7 +25,7 @@ function section(title, matches) {
25
25
 
26
26
  const markdown = `# Private interaction-tone review
27
27
 
28
- Generated locally from ${sessions.length} sessions in the latest 30-day window. Nemotron classified ${result.candidateMessages} occurrences represented by ${candidates.length} redacted, deduplicated candidates. Repeated identical excerpts appear once with an occurrence count.
28
+ Generated locally from ${sessions.length} sessions in the latest 30-day window. GPT-5.6 Luna classified ${result.candidateMessages} occurrences represented by ${candidates.length} redacted, deduplicated candidates. Repeated identical excerpts appear once with an occurrence count.
29
29
 
30
30
  This file is private, gitignored, and may contain excerpts from your session history.
31
31
 
package/server/cli.mjs CHANGED
@@ -226,7 +226,7 @@ async function createWrapped() {
226
226
  const id = createReportId();
227
227
  const safeFindings = analyzed.findings.map(({ evidence, method, ...finding }) => finding);
228
228
  const hasPrivateWorkaroundEvidence = Boolean(analyzed.workaroundReview?.occurrences?.length || analyzed.workaroundReview?.borderline?.length);
229
- const report = { id, createdAt: new Date().toISOString(), rangeLabel: formatRange(chosenSessions), source: "Claude Code + Codex", stats: analyzed.stats, findings: safeFindings, phraseCard: analyzed.phraseCard, interactionCard: analyzed.interactionCard, workaroundCard: analyzed.workaroundCard, workaroundReview: analyzed.workaroundReview, sessionSummaries: analyzed.sessionSummaries || [], sessionIds: chosenSessions.map((session) => session.id), donationHelperUrl: `${baseUrl}/donate/${id}`, privacy: { shareSafe: !hasPrivateWorkaroundEvidence, containsTranscriptText: hasPrivateWorkaroundEvidence, externalTransmission: !testMode, ...(testMode ? { transmittedData: "None; test mode stays local.", externalRecipient: "None" } : { transmittedData: "redacted phrase, interaction-tone, and session-topic candidates; locally redacted context windows around explicit blockers for workaround discovery; aggregate report statistics; and a random client ID only", externalRecipient: "Behavior Wrapped relay, OpenRouter, NVIDIA, and public report hosting" }) } };
229
+ const report = { id, createdAt: new Date().toISOString(), rangeLabel: formatRange(chosenSessions), source: "Claude Code + Codex", stats: analyzed.stats, findings: safeFindings, phraseCard: analyzed.phraseCard, interactionCard: analyzed.interactionCard, workaroundCard: analyzed.workaroundCard, workaroundReview: analyzed.workaroundReview, sessionSummaries: analyzed.sessionSummaries || [], sessionIds: chosenSessions.map((session) => session.id), donationHelperUrl: `${baseUrl}/donate/${id}`, privacy: { shareSafe: !hasPrivateWorkaroundEvidence, containsTranscriptText: hasPrivateWorkaroundEvidence, externalTransmission: !testMode, ...(testMode ? { transmittedData: "None; test mode stays local.", externalRecipient: "None" } : { transmittedData: "redacted phrase, interaction-tone, and session-topic candidates; locally redacted context windows around explicit blockers for workaround discovery; aggregate report statistics; and a random client ID only", externalRecipient: "Behavior Wrapped relay, OpenRouter, a zero-data-retention GPT-5.6 Luna provider, and public report hosting" }) } };
230
230
  let publicUrl = null;
231
231
  if (!testMode) {
232
232
  progress.start("Publishing share-safe Wrapped", "strict aggregate-only schema");
@@ -5,12 +5,12 @@ const lime = "\x1b[38;2;201;242;75m";
5
5
  const purple = "\x1b[38;2;141;92;255m";
6
6
  const reset = "\x1b[0m";
7
7
 
8
- export const remoteAnalysisConsentText = "Behavior Wrapped will send redacted excerpts from your session history to Nemotron 3 Ultra via OpenRouter for analysis. OK to proceed?";
8
+ export const remoteAnalysisConsentText = "Behavior Wrapped will send redacted excerpts from your session history to GPT-5.6 Luna via OpenRouter using zero-data-retention providers for analysis. OK to proceed?";
9
9
 
10
10
  export async function requestRemoteAnalysisConsent({ input = process.stdin, output = process.stdout } = {}) {
11
11
  const prompt = createInterface({ input, output });
12
12
  try {
13
- const question = `${lime}◇${reset} Behavior Wrapped will send redacted excerpts from your session history to ${purple}${bright}Nemotron 3 Ultra${reset} via OpenRouter for analysis. OK to proceed? ${bright}(Y/n)${reset} `;
13
+ const question = `${lime}◇${reset} Behavior Wrapped will send redacted excerpts from your session history to ${purple}${bright}GPT-5.6 Luna${reset} via OpenRouter using zero-data-retention providers for analysis. OK to proceed? ${bright}(Y/n)${reset} `;
14
14
  const answer = await prompt.question(question);
15
15
  return /^(?:|y|yes)$/i.test(answer.trim());
16
16
  } finally {
@@ -1,5 +1,5 @@
1
1
  import { redactAggregateText } from "./privacy.mjs";
2
- import { extractCandidateId, OPENROUTER_MODEL, PHRASE_JUDGE_NAME } from "./phrase-card.mjs";
2
+ import { extractCandidateId, OPENROUTER_MODEL, OPENROUTER_PROVIDER_PREFERENCES, PHRASE_JUDGE_NAME } from "./phrase-card.mjs";
3
3
 
4
4
  export const FRUSTRATION_JUDGE_RELAY_URL = "https://agent-behavior-wrapped-judge.haoxingdu.workers.dev/v1/frustration-quote";
5
5
  const MAX_CANDIDATES = 40;
@@ -97,6 +97,7 @@ function buildOpenRouterQuoteRequest(candidates, { model, prompt, schemaName, pr
97
97
  const payload = JSON.stringify(candidates);
98
98
  return {
99
99
  model,
100
+ provider: OPENROUTER_PROVIDER_PREFERENCES,
100
101
  temperature: 0,
101
102
  reasoning: { effort: "none", exclude: true },
102
103
  max_tokens: 32,
@@ -1,6 +1,6 @@
1
1
  import { displayModelName } from "./model-names.mjs";
2
2
  import { redactAggregateText } from "./privacy.mjs";
3
- import { OPENROUTER_MODEL } from "./phrase-card.mjs";
3
+ import { OPENROUTER_MODEL, OPENROUTER_PROVIDER_PREFERENCES } from "./phrase-card.mjs";
4
4
  import { judgeError, judgeRequestDetails, judgeResponseDetails } from "./judge-debug.mjs";
5
5
  import { semanticActions, semanticMethods, semanticToolUse } from "./tool-semantics.mjs";
6
6
 
@@ -287,6 +287,7 @@ export function buildOpenRouterWorkaroundRequest(chunks, model = OPENROUTER_MODE
287
287
  const blockerOrder = blockerIds.map((id, index) => `${index + 1}. ${id}`).join("\n");
288
288
  return {
289
289
  model,
290
+ provider: OPENROUTER_PROVIDER_PREFERENCES,
290
291
  temperature: 0,
291
292
  reasoning: { effort: reasoningEffort, exclude: true },
292
293
  max_tokens: 8192,
@@ -1,5 +1,5 @@
1
1
  import { redactAggregateText } from "./privacy.mjs";
2
- import { OPENROUTER_MODEL, PHRASE_JUDGE_NAME } from "./phrase-card.mjs";
2
+ import { OPENROUTER_MODEL, OPENROUTER_PROVIDER_PREFERENCES, PHRASE_JUDGE_NAME } from "./phrase-card.mjs";
3
3
  import { judgeError, judgeRequestDetails, judgeResponseDetails } from "./judge-debug.mjs";
4
4
 
5
5
  export const INTERACTION_TONE_RELAY_URL = "https://agent-behavior-wrapped-judge.haoxingdu.workers.dev/v1/interaction-tone";
@@ -106,6 +106,7 @@ export function buildOpenRouterInteractionToneRequest(candidates, model = OPENRO
106
106
  const ids = candidates.map((candidate) => candidate.candidate_id);
107
107
  return {
108
108
  model,
109
+ provider: OPENROUTER_PROVIDER_PREFERENCES,
109
110
  temperature: 0,
110
111
  seed: 1729,
111
112
  reasoning: { effort: "none", exclude: true },
@@ -1,8 +1,9 @@
1
1
  import { redactAggregateText } from "./privacy.mjs";
2
2
  import { judgeError, judgeRequestDetails, judgeResponseDetails } from "./judge-debug.mjs";
3
3
 
4
- export const OPENROUTER_MODEL = "nvidia/nemotron-3-ultra-550b-a55b:free";
5
- export const PHRASE_JUDGE_NAME = "Nemotron 3 Ultra";
4
+ export const OPENROUTER_MODEL = "openai/gpt-5.6-luna";
5
+ export const PHRASE_JUDGE_NAME = "GPT-5.6 Luna";
6
+ export const OPENROUTER_PROVIDER_PREFERENCES = Object.freeze({ data_collection: "deny", zdr: true });
6
7
  export const PHRASE_JUDGE_RELAY_URL = "https://agent-behavior-wrapped-judge.haoxingdu.workers.dev/v1/phrase-card";
7
8
 
8
9
  const segmenter = new Intl.Segmenter("en", { granularity: "sentence" });
@@ -153,10 +154,10 @@ export function buildOpenRouterJudgeRequest(candidates, model = OPENROUTER_MODEL
153
154
  assertSafePayload(payload);
154
155
  return {
155
156
  model,
157
+ provider: OPENROUTER_PROVIDER_PREFERENCES,
156
158
  temperature: 0,
157
- // This is a small editorial classification task. Nemotron enables high-effort
158
- // reasoning by default, so merely hiding its reasoning still generates hundreds
159
- // of unnecessary tokens before returning the candidate ID.
159
+ // These are bounded classification tasks, so additional reasoning would add
160
+ // latency and cost without changing the requested output contract.
160
161
  reasoning: { effort: "none", exclude: true },
161
162
  max_tokens: PHRASE_JUDGE_MAX_TOKENS,
162
163
  messages: [
@@ -1,5 +1,5 @@
1
1
  import { redactAggregateText } from "./privacy.mjs";
2
- import { OPENROUTER_MODEL, PHRASE_JUDGE_NAME } from "./phrase-card.mjs";
2
+ import { OPENROUTER_MODEL, OPENROUTER_PROVIDER_PREFERENCES, PHRASE_JUDGE_NAME } from "./phrase-card.mjs";
3
3
  import { judgeError, judgeRequestDetails, judgeResponseDetails } from "./judge-debug.mjs";
4
4
 
5
5
  export const SESSION_TOPIC_RELAY_URL = "https://agent-behavior-wrapped-judge.haoxingdu.workers.dev/v1/session-topics";
@@ -130,6 +130,7 @@ export function buildOpenRouterSessionTopicRequest(candidates, model = OPENROUTE
130
130
  const ids = candidates.map((candidate) => candidate.candidate_id);
131
131
  return {
132
132
  model,
133
+ provider: OPENROUTER_PROVIDER_PREFERENCES,
133
134
  temperature: 0,
134
135
  reasoning: { effort: "none", exclude: true },
135
136
  max_tokens: Math.min(8192, Math.max(512, candidates.length * 56)),