@gonzih/debate-coach 0.1.0

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claude.js","sourceRoot":"","sources":["../src/claude.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAQ1D,MAAM,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;AAC/B,MAAM,KAAK,GAAG,iBAAiB,CAAC;AAEhC,8EAA8E;AAE9E,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,QAAgB;IAItD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;QAC5C,KAAK,EAAE,KAAK;QACZ,UAAU,EAAE,IAAI;QAChB,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;;wBAEO,QAAQ;;;;;;;;;;;;EAY9B;aACK;SACF;KACF,CAAC,CAAC;IAEH,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,EAAE,IAAI,IAAI,IAAI,CAAC;IACzE,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAC5C,IAAI,CAAC,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAE3E,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAiD,CAAC;AAClF,CAAC;AAED,8EAA8E;AAE9E,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAKnC;IACC,MAAM,eAAe,GACnB,MAAM,CAAC,iBAAiB,CAAC,MAAM,GAAG,CAAC;QACjC,CAAC,CAAC,+BAA+B,MAAM,CAA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CAAC,mBAAmB,GAAG,CAAC,KAAK,CAAC,WAAW,UAAU,GAAG,CAAC,KAAK,CAAC,WAAW,KAAK,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,WAAW,KAAK,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,sBAAsB,EAAE;QACvN,EAAE;QACF,iBAAiB,GAAG,CAAC,QAAQ,EAAE;QAC/B,EAAE;QACF,4BAA4B,GAAG,CAAC,uBAAuB,EAAE;KAC1D,CAAC;IAEF,IAAI,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,oCAAoC,GAAG,CAAC,SAAS,CAAC,MAAM,MAAM,CAAC,CAAC;QAC3E,KAAK,MAAM,OAAO,IAAI,GAAG,CAAC,SAAS,EAAE,CAAC;YACpC,KAAK,CAAC,IAAI,CAAC,OAAO,OAAO,CAAC,IAAI,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;YAC5D,IAAI,OAAO,CAAC,KAAK;gBAAE,KAAK,CAAC,IAAI,CAAC,OAAO,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;SAAM,CAAC;QACN,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC;IACpD,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { DbDebate, ProgressReport, ScoredArgument } from "./types.js";
2
+ export declare function saveDebate(debate: {
3
+ id: string;
4
+ profileId: string;
5
+ topic: string;
6
+ proposition: string;
7
+ startedAt: string;
8
+ completed: boolean;
9
+ didFlip: boolean;
10
+ proScore: number;
11
+ conScore: number;
12
+ fallaciesCaught: number;
13
+ fallaciesTotal: number;
14
+ arguments: ScoredArgument[];
15
+ synthesis?: string;
16
+ }): void;
17
+ export declare function getDebatesByProfile(profileId: string): DbDebate[];
18
+ export declare function getProgressReport(profileId: string): ProgressReport;
19
+ //# sourceMappingURL=database.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../src/database.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AA8C3E,wBAAgB,UAAU,CAAC,MAAM,EAAE;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,IAAI,CA0BP;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,EAAE,CAKjE;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,CA0FnE"}
@@ -0,0 +1,157 @@
1
+ import Database from "better-sqlite3";
2
+ import path from "path";
3
+ import os from "os";
4
+ import fs from "fs";
5
+ const DB_DIR = path.join(os.homedir(), ".debate-coach");
6
+ const DB_PATH = path.join(DB_DIR, "debates.db");
7
+ function ensureDbDir() {
8
+ if (!fs.existsSync(DB_DIR)) {
9
+ fs.mkdirSync(DB_DIR, { recursive: true });
10
+ }
11
+ }
12
+ let _db = null;
13
+ function getDb() {
14
+ if (!_db) {
15
+ ensureDbDir();
16
+ _db = new Database(DB_PATH);
17
+ _db.pragma("journal_mode = WAL");
18
+ initSchema(_db);
19
+ }
20
+ return _db;
21
+ }
22
+ function initSchema(db) {
23
+ db.exec(`
24
+ CREATE TABLE IF NOT EXISTS debates (
25
+ id TEXT PRIMARY KEY,
26
+ profile_id TEXT NOT NULL,
27
+ topic TEXT NOT NULL,
28
+ proposition TEXT NOT NULL,
29
+ started_at TEXT NOT NULL,
30
+ completed INTEGER NOT NULL DEFAULT 0,
31
+ did_flip INTEGER NOT NULL DEFAULT 0,
32
+ pro_score REAL NOT NULL DEFAULT 0,
33
+ con_score REAL NOT NULL DEFAULT 0,
34
+ fallacies_caught INTEGER NOT NULL DEFAULT 0,
35
+ fallacies_total INTEGER NOT NULL DEFAULT 0,
36
+ arguments_json TEXT NOT NULL DEFAULT '[]',
37
+ synthesis TEXT
38
+ );
39
+
40
+ CREATE INDEX IF NOT EXISTS idx_debates_profile ON debates(profile_id);
41
+ CREATE INDEX IF NOT EXISTS idx_debates_started ON debates(started_at);
42
+ `);
43
+ }
44
+ export function saveDebate(debate) {
45
+ const db = getDb();
46
+ const stmt = db.prepare(`
47
+ INSERT OR REPLACE INTO debates
48
+ (id, profile_id, topic, proposition, started_at, completed, did_flip,
49
+ pro_score, con_score, fallacies_caught, fallacies_total, arguments_json, synthesis)
50
+ VALUES
51
+ (@id, @profileId, @topic, @proposition, @startedAt, @completed, @didFlip,
52
+ @proScore, @conScore, @fallaciesCaught, @fallaciesTotal, @argumentsJson, @synthesis)
53
+ `);
54
+ stmt.run({
55
+ id: debate.id,
56
+ profileId: debate.profileId,
57
+ topic: debate.topic,
58
+ proposition: debate.proposition,
59
+ startedAt: debate.startedAt,
60
+ completed: debate.completed ? 1 : 0,
61
+ didFlip: debate.didFlip ? 1 : 0,
62
+ proScore: debate.proScore,
63
+ conScore: debate.conScore,
64
+ fallaciesCaught: debate.fallaciesCaught,
65
+ fallaciesTotal: debate.fallaciesTotal,
66
+ argumentsJson: JSON.stringify(debate.arguments),
67
+ synthesis: debate.synthesis ?? null,
68
+ });
69
+ }
70
+ export function getDebatesByProfile(profileId) {
71
+ const db = getDb();
72
+ return db
73
+ .prepare("SELECT * FROM debates WHERE profile_id = ? ORDER BY started_at DESC")
74
+ .all(profileId);
75
+ }
76
+ export function getProgressReport(profileId) {
77
+ const debates = getDebatesByProfile(profileId);
78
+ const completed = debates.filter(d => d.completed === 1);
79
+ if (completed.length === 0) {
80
+ return {
81
+ profileId,
82
+ debatesCompleted: 0,
83
+ avgProScore: 0,
84
+ avgConScore: 0,
85
+ avgScore: 0,
86
+ fallacyTrend: {},
87
+ topFallacies: [],
88
+ improvementAreas: ["Start your first debate to see progress!"],
89
+ flipSuccessRate: 0,
90
+ topicsDebated: [],
91
+ scoreOverTime: [],
92
+ };
93
+ }
94
+ const avgProScore = completed.reduce((sum, d) => sum + d.pro_score, 0) / completed.length;
95
+ const avgConScore = completed.reduce((sum, d) => sum + d.con_score, 0) / completed.length;
96
+ const avgScore = (avgProScore + avgConScore) / 2;
97
+ const flipped = completed.filter(d => d.did_flip === 1).length;
98
+ const flipSuccessRate = completed.length > 0 ? flipped / completed.length : 0;
99
+ // Collect all fallacies from all debates
100
+ const fallacyCounts = {};
101
+ const fallacyByDate = {};
102
+ for (const debate of completed) {
103
+ const args = JSON.parse(debate.arguments_json);
104
+ const date = debate.started_at.split("T")[0];
105
+ for (const arg of args) {
106
+ for (const fallacy of arg.fallacies) {
107
+ fallacyCounts[fallacy.type] = (fallacyCounts[fallacy.type] || 0) + 1;
108
+ if (!fallacyByDate[date])
109
+ fallacyByDate[date] = {};
110
+ fallacyByDate[date][fallacy.type] =
111
+ (fallacyByDate[date][fallacy.type] || 0) + 1;
112
+ }
113
+ }
114
+ }
115
+ // Build fallacy trend (last 10 dates)
116
+ const sortedDates = Object.keys(fallacyByDate).sort().slice(-10);
117
+ const fallacyTrend = {};
118
+ for (const [type] of Object.entries(fallacyCounts)) {
119
+ fallacyTrend[type] = sortedDates.map(d => fallacyByDate[d]?.[type] || 0);
120
+ }
121
+ const topFallacies = Object.entries(fallacyCounts)
122
+ .sort(([, a], [, b]) => b - a)
123
+ .slice(0, 5)
124
+ .map(([type, count]) => ({ type, count }));
125
+ // Score over time
126
+ const scoreOverTime = completed.map(d => ({
127
+ date: d.started_at.split("T")[0],
128
+ score: (d.pro_score + d.con_score) / 2,
129
+ }));
130
+ // Improvement areas
131
+ const improvementAreas = [];
132
+ if (avgProScore < 5)
133
+ improvementAreas.push("Your PRO arguments need stronger evidence — cite specific studies or data");
134
+ if (avgConScore < 5)
135
+ improvementAreas.push("Your CON (flip-side) arguments need more development — practice arguing positions you disagree with");
136
+ if (topFallacies.length > 0) {
137
+ improvementAreas.push(`Watch out for ${topFallacies[0].type.replace(/_/g, " ")} — your most common fallacy`);
138
+ }
139
+ if (flipSuccessRate < 0.5)
140
+ improvementAreas.push("Practice arguing the opposite side — flip your perspective more often");
141
+ if (avgScore >= 7)
142
+ improvementAreas.push("Strong overall scores! Try harder topics to challenge yourself further");
143
+ return {
144
+ profileId,
145
+ debatesCompleted: completed.length,
146
+ avgProScore: Math.round(avgProScore * 10) / 10,
147
+ avgConScore: Math.round(avgConScore * 10) / 10,
148
+ avgScore: Math.round(avgScore * 10) / 10,
149
+ fallacyTrend,
150
+ topFallacies,
151
+ improvementAreas,
152
+ flipSuccessRate: Math.round(flipSuccessRate * 100) / 100,
153
+ topicsDebated: [...new Set(completed.map(d => d.topic))],
154
+ scoreOverTime,
155
+ };
156
+ }
157
+ //# sourceMappingURL=database.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"database.js","sourceRoot":"","sources":["../src/database.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,MAAM,IAAI,CAAC;AAGpB,MA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type: string;
3
+ name: string;
4
+ description: string;
5
+ examples: string[];
6
+ howToAvoid: string;
7
+ }
8
+ export declare const FALLACIES: Record<string, FallacyDefinition>;
9
+ export declare const FALLACY_LIST: FallacyDefinition[];
10
+ export declare const FALLACY_NAMES_FOR_PROMPT: string;
11
+ //# sourceMappingURL=fallacies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fallacies.d.ts","sourceRoot":"","sources":["../src/fallacies.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAyMvD,CAAC;AAEF,eAAO,MAAM,YAAY,qBAA2B,CAAC;AAErD,eAAO,MAAM,wBAAwB,QAExB,CAAC"}
@@ -0,0 +1,207 @@
1
+ export const FALLACIES = {
2
+ ad_hominem: {
3
+ type: "ad_hominem",
4
+ name: "Ad Hominem",
5
+ description: "Attacking the person making the argument instead of the argument itself",
6
+ examples: [
7
+ "You can't trust their climate research — they drive a gas car.",
8
+ "His opinion on taxes doesn't matter, he's never run a business.",
9
+ ],
10
+ howToAvoid: "Critique the argument's evidence and reasoning, not the person.",
11
+ },
12
+ straw_man: {
13
+ type: "straw_man",
14
+ name: "Straw Man",
15
+ description: "Misrepresenting an opponent's position to make it easier to attack",
16
+ examples: [
17
+ "They want gun control, so they want to leave everyone defenseless.",
18
+ "She said we should eat less meat, so she wants to ban all animal products.",
19
+ ],
20
+ howToAvoid: "Engage with the actual argument as stated, not an exaggerated version.",
21
+ },
22
+ false_dichotomy: {
23
+ type: "false_dichotomy",
24
+ name: "False Dichotomy",
25
+ description: "Presenting only two options when more exist (also: false dilemma)",
26
+ examples: [
27
+ "You're either with us or against us.",
28
+ "Either we ban social media or teen depression will keep rising.",
29
+ ],
30
+ howToAvoid: "Acknowledge the full spectrum of options and nuance.",
31
+ },
32
+ slippery_slope: {
33
+ type: "slippery_slope",
34
+ name: "Slippery Slope",
35
+ description: "Assuming one event inevitably leads to extreme outcomes without sufficient evidence",
36
+ examples: [
37
+ "If we allow same-sex marriage, next people will want to marry animals.",
38
+ "If students get phones in class, no one will learn anything ever again.",
39
+ ],
40
+ howToAvoid: "Show causal links between steps; don't assume runaway effects.",
41
+ },
42
+ hasty_generalization: {
43
+ type: "hasty_generalization",
44
+ name: "Hasty Generalization",
45
+ description: "Drawing broad conclusions from insufficient or unrepresentative evidence",
46
+ examples: [
47
+ "My cousin tried the keto diet and gained weight, so keto doesn't work.",
48
+ "Three teens I know are addicted to TikTok, so all teens are addicted to social media.",
49
+ ],
50
+ howToAvoid: "Use representative samples and acknowledge exceptions.",
51
+ },
52
+ appeal_to_authority: {
53
+ type: "appeal_to_authority",
54
+ name: "Appeal to Authority",
55
+ description: "Using authority as the sole evidence without supporting reasoning",
56
+ examples: [
57
+ "Dr. X said it's true, so it must be.",
58
+ "Einstein believed in God, therefore God exists.",
59
+ ],
60
+ howToAvoid: "Cite authorities as supporting evidence, but provide the actual reasoning too.",
61
+ },
62
+ appeal_to_emotion: {
63
+ type: "appeal_to_emotion",
64
+ name: "Appeal to Emotion",
65
+ description: "Using emotional manipulation instead of logical reasoning",
66
+ examples: [
67
+ "Think of the children! We must ban this immediately.",
68
+ "How can you support this policy when people are suffering?",
69
+ ],
70
+ howToAvoid: "Ground your argument in evidence; emotions can support but not replace logic.",
71
+ },
72
+ circular_reasoning: {
73
+ type: "circular_reasoning",
74
+ name: "Circular Reasoning",
75
+ description: "Using the conclusion as a premise (begging the question)",
76
+ examples: [
77
+ "The Bible is true because it says so in the Bible.",
78
+ "Social media is harmful because it causes harm.",
79
+ ],
80
+ howToAvoid: "Ensure your premises are independent from your conclusion.",
81
+ },
82
+ red_herring: {
83
+ type: "red_herring",
84
+ name: "Red Herring",
85
+ description: "Introducing irrelevant information to distract from the actual issue",
86
+ examples: [
87
+ "We shouldn't worry about climate change when people are dying of poverty.",
88
+ "Why focus on school uniforms when teachers are underpaid?",
89
+ ],
90
+ howToAvoid: "Stay on topic; address the specific claim at hand.",
91
+ },
92
+ bandwagon: {
93
+ type: "bandwagon",
94
+ name: "Bandwagon (Appeal to Popularity)",
95
+ description: "Claiming something is true or right because many people believe it",
96
+ examples: [
97
+ "Everyone is buying organic food, so it must be healthier.",
98
+ "Millions of people believe vaccines are harmful, so there must be something to it.",
99
+ ],
100
+ howToAvoid: "Popularity doesn't equal truth; provide evidence independent of consensus.",
101
+ },
102
+ false_equivalence: {
103
+ type: "false_equivalence",
104
+ name: "False Equivalence",
105
+ description: "Treating two significantly different things as if they were equal",
106
+ examples: [
107
+ "Hitler was a vegetarian and so is she — they're basically the same.",
108
+ "Jaywalking and murder are both crimes, so they deserve similar punishments.",
109
+ ],
110
+ howToAvoid: "Acknowledge the meaningful differences between the things you're comparing.",
111
+ },
112
+ appeal_to_nature: {
113
+ type: "appeal_to_nature",
114
+ name: "Appeal to Nature",
115
+ description: "Claiming something is good or right because it is natural",
116
+ examples: [
117
+ "Herbal medicine is better than pharmaceuticals because it's natural.",
118
+ "Homosexuality is wrong because it doesn't occur in nature.",
119
+ ],
120
+ howToAvoid: "Natural ≠ good; unnatural ≠ bad. Evaluate on actual merits.",
121
+ },
122
+ anecdotal_evidence: {
123
+ type: "anecdotal_evidence",
124
+ name: "Anecdotal Evidence",
125
+ description: "Using personal experience or isolated stories instead of systematic evidence",
126
+ examples: [
127
+ "My grandfather smoked his whole life and lived to 95, so smoking isn't that bad.",
128
+ "I know someone who was cured by homeopathy, so it works.",
129
+ ],
130
+ howToAvoid: "Individual stories can illustrate points but need systematic data to prove them.",
131
+ },
132
+ post_hoc: {
133
+ type: "post_hoc",
134
+ name: "Post Hoc (Correlation ≠ Causation)",
135
+ description: "Assuming causation from correlation or sequence",
136
+ examples: [
137
+ "After we introduced the new policy, crime went up — so the policy caused crime.",
138
+ "Teen depression rose after smartphones became common, so smartphones cause depression.",
139
+ ],
140
+ howToAvoid: "Show a plausible causal mechanism; account for confounding variables.",
141
+ },
142
+ tu_quoque: {
143
+ type: "tu_quoque",
144
+ name: "Tu Quoque (Appeal to Hypocrisy)",
145
+ description: "Deflecting a criticism by pointing to the opponent's flaws or inconsistencies",
146
+ examples: [
147
+ "You tell me to exercise more, but you're out of shape yourself.",
148
+ "Politicians shouldn't lecture us on taxes — they all dodge them anyway.",
149
+ ],
150
+ howToAvoid: "The critic's behavior doesn't affect the validity of their argument.",
151
+ },
152
+ loaded_question: {
153
+ type: "loaded_question",
154
+ name: "Loaded Question",
155
+ description: "Asking a question with a false or controversial assumption built in",
156
+ examples: [
157
+ "Have you stopped cheating on your exams yet?",
158
+ "Why do young people today have no work ethic?",
159
+ ],
160
+ howToAvoid: "Challenge the hidden assumption before answering.",
161
+ },
162
+ appeal_to_tradition: {
163
+ type: "appeal_to_tradition",
164
+ name: "Appeal to Tradition",
165
+ description: "Arguing that something is right or good because it has always been done that way",
166
+ examples: [
167
+ "We've always had standardized tests — why change now?",
168
+ "Marriage has always been between a man and a woman.",
169
+ ],
170
+ howToAvoid: "Ask whether the tradition still serves its original purpose in today's context.",
171
+ },
172
+ no_true_scotsman: {
173
+ type: "no_true_scotsman",
174
+ name: "No True Scotsman",
175
+ description: "Dismissing counterexamples by arbitrarily redefining terms",
176
+ examples: [
177
+ "No real socialist would support that policy.",
178
+ "No true feminist would say that.",
179
+ ],
180
+ howToAvoid: "Define your terms clearly upfront and don't shift them to exclude counterexamples.",
181
+ },
182
+ moving_goalposts: {
183
+ type: "moving_goalposts",
184
+ name: "Moving the Goalposts",
185
+ description: "Changing the requirements for evidence or proof after they have been met",
186
+ examples: [
187
+ "Show me one study. [Study provided.] Well, show me 10 studies. [Done.] Well, they're all biased.",
188
+ "If you can get 1000 signatures, we'll consider it. [Done.] Well, 1000 isn't really enough.",
189
+ ],
190
+ howToAvoid: "Agree on standards of evidence before the debate begins.",
191
+ },
192
+ cherry_picking: {
193
+ type: "cherry_picking",
194
+ name: "Cherry Picking",
195
+ description: "Selecting only supporting evidence while ignoring contrary evidence",
196
+ examples: [
197
+ "Three studies show my supplement works! (ignoring 20 that show it doesn't)",
198
+ "Unemployment fell this quarter! (while ignoring wage stagnation and underemployment)",
199
+ ],
200
+ howToAvoid: "Engage with the totality of evidence, including evidence against your position.",
201
+ },
202
+ };
203
+ export const FALLACY_LIST = Object.values(FALLACIES);
204
+ export const FALLACY_NAMES_FOR_PROMPT = FALLACY_LIST
205
+ .map(f => `- ${f.type}: "${f.description}"`)
206
+ .join("\n");
207
+ //# sourceMappingURL=fallacies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fallacies.js","sourceRoot":"","sources":["../src/fallacies.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,SAAS,GAAsC;IAC1D,UAAU,EAAE;QACV,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,yEAAyE;QACtF,QAAQ,EAAE;YACR,gEAAgE;YAChE,iEAAiE;SAClE;QACD,UAAU,EAAE,iEAAiE;KAC9E;IACD,SAAS,EAAE;QACT,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,oEAAoE;QACjF,QAAQ,EAAE;YACR,oEAAoE;YACpE,4EAA4E;SAC7E;QACD,UAAU,EAAE,wEAAwE;KACrF;IACD,eAAe,EAAE;QACf,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,mEAAmE;QAChF,QAAQ,EAAE;YACR,sCAAsC;YACtC,iEAAiE;SAClE;QACD,UAAU,EAAE,sDAAsD;KACnE;IACD,cAAc,EAAE;QACd,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,qFAAqF;QAClG,QAAQ,EAAE;YACR,wEAAw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B,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE,4DAA4D;QACzE,QAAQ,EAAE;YACR,8CAA8C;YAC9C,kCAAkC;SACnC;QACD,UAAU,EAAE,oFAAoF;KACjG;IACD,gBAAgB,EAAE;QAChB,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EAAE,0EAA0E;QACvF,QAAQ,EAAE;YACR,kGAAkG;YAClG,4FAA4F;SAC7F;QACD,UAAU,EAAE,0DAA0D;KACvE;IACD,cAAc,EAAE;QACd,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,qEAAqE;QAClF,QAAQ,EAAE;YACR,4EAA4E;YAC5E,sFAAsF;SACvF;QACD,UAAU,EAAE,iFAAiF;KAC9F;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AAErD,MAAM,CAAC,MAAM,wBAAwB,GAAG,YAAY;KACjD,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,WAAW,GAAG,CAAC;KAC3C,IAAI,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}