pet-terminal 1.0.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.
Files changed (147) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +268 -0
  3. package/dist/commands/care.d.ts +3 -0
  4. package/dist/commands/care.d.ts.map +1 -0
  5. package/dist/commands/care.js +103 -0
  6. package/dist/commands/care.js.map +1 -0
  7. package/dist/commands/clean.d.ts +3 -0
  8. package/dist/commands/clean.d.ts.map +1 -0
  9. package/dist/commands/clean.js +105 -0
  10. package/dist/commands/clean.js.map +1 -0
  11. package/dist/commands/feed.d.ts +3 -0
  12. package/dist/commands/feed.d.ts.map +1 -0
  13. package/dist/commands/feed.js +106 -0
  14. package/dist/commands/feed.js.map +1 -0
  15. package/dist/commands/git.d.ts +3 -0
  16. package/dist/commands/git.d.ts.map +1 -0
  17. package/dist/commands/git.js +138 -0
  18. package/dist/commands/git.js.map +1 -0
  19. package/dist/commands/heal.d.ts +3 -0
  20. package/dist/commands/heal.d.ts.map +1 -0
  21. package/dist/commands/heal.js +106 -0
  22. package/dist/commands/heal.js.map +1 -0
  23. package/dist/commands/init.d.ts +3 -0
  24. package/dist/commands/init.d.ts.map +1 -0
  25. package/dist/commands/init.js +89 -0
  26. package/dist/commands/init.js.map +1 -0
  27. package/dist/commands/inventory.d.ts +3 -0
  28. package/dist/commands/inventory.d.ts.map +1 -0
  29. package/dist/commands/inventory.js +113 -0
  30. package/dist/commands/inventory.js.map +1 -0
  31. package/dist/commands/play.d.ts +3 -0
  32. package/dist/commands/play.d.ts.map +1 -0
  33. package/dist/commands/play.js +110 -0
  34. package/dist/commands/play.js.map +1 -0
  35. package/dist/commands/shop.d.ts +3 -0
  36. package/dist/commands/shop.d.ts.map +1 -0
  37. package/dist/commands/shop.js +197 -0
  38. package/dist/commands/shop.js.map +1 -0
  39. package/dist/commands/sleep.d.ts +3 -0
  40. package/dist/commands/sleep.d.ts.map +1 -0
  41. package/dist/commands/sleep.js +48 -0
  42. package/dist/commands/sleep.js.map +1 -0
  43. package/dist/commands/status.d.ts +3 -0
  44. package/dist/commands/status.d.ts.map +1 -0
  45. package/dist/commands/status.js +98 -0
  46. package/dist/commands/status.js.map +1 -0
  47. package/dist/commands/sync.d.ts +3 -0
  48. package/dist/commands/sync.d.ts.map +1 -0
  49. package/dist/commands/sync.js +66 -0
  50. package/dist/commands/sync.js.map +1 -0
  51. package/dist/commands/tutorial.d.ts +3 -0
  52. package/dist/commands/tutorial.d.ts.map +1 -0
  53. package/dist/commands/tutorial.js +210 -0
  54. package/dist/commands/tutorial.js.map +1 -0
  55. package/dist/core/auto-care.d.ts +63 -0
  56. package/dist/core/auto-care.d.ts.map +1 -0
  57. package/dist/core/auto-care.js +295 -0
  58. package/dist/core/auto-care.js.map +1 -0
  59. package/dist/core/config.d.ts +89 -0
  60. package/dist/core/config.d.ts.map +1 -0
  61. package/dist/core/config.js +195 -0
  62. package/dist/core/config.js.map +1 -0
  63. package/dist/core/database.d.ts +29 -0
  64. package/dist/core/database.d.ts.map +1 -0
  65. package/dist/core/database.js +81 -0
  66. package/dist/core/database.js.map +1 -0
  67. package/dist/core/inventory.d.ts +63 -0
  68. package/dist/core/inventory.d.ts.map +1 -0
  69. package/dist/core/inventory.js +140 -0
  70. package/dist/core/inventory.js.map +1 -0
  71. package/dist/core/level-system.d.ts +32 -0
  72. package/dist/core/level-system.d.ts.map +1 -0
  73. package/dist/core/level-system.js +76 -0
  74. package/dist/core/level-system.js.map +1 -0
  75. package/dist/core/pet.d.ts +123 -0
  76. package/dist/core/pet.d.ts.map +1 -0
  77. package/dist/core/pet.js +781 -0
  78. package/dist/core/pet.js.map +1 -0
  79. package/dist/core/shop.d.ts +93 -0
  80. package/dist/core/shop.d.ts.map +1 -0
  81. package/dist/core/shop.js +205 -0
  82. package/dist/core/shop.js.map +1 -0
  83. package/dist/core/time-decay.d.ts +30 -0
  84. package/dist/core/time-decay.d.ts.map +1 -0
  85. package/dist/core/time-decay.js +149 -0
  86. package/dist/core/time-decay.js.map +1 -0
  87. package/dist/core/welcome.d.ts +31 -0
  88. package/dist/core/welcome.d.ts.map +1 -0
  89. package/dist/core/welcome.js +180 -0
  90. package/dist/core/welcome.js.map +1 -0
  91. package/dist/index.d.ts +3 -0
  92. package/dist/index.d.ts.map +1 -0
  93. package/dist/index.js +80 -0
  94. package/dist/index.js.map +1 -0
  95. package/dist/monitor/git-monitor.d.ts +90 -0
  96. package/dist/monitor/git-monitor.d.ts.map +1 -0
  97. package/dist/monitor/git-monitor.js +342 -0
  98. package/dist/monitor/git-monitor.js.map +1 -0
  99. package/dist/types/auto-care.d.ts +86 -0
  100. package/dist/types/auto-care.d.ts.map +1 -0
  101. package/dist/types/auto-care.js +15 -0
  102. package/dist/types/auto-care.js.map +1 -0
  103. package/dist/types/config.d.ts +42 -0
  104. package/dist/types/config.d.ts.map +1 -0
  105. package/dist/types/config.js +24 -0
  106. package/dist/types/config.js.map +1 -0
  107. package/dist/types/git.d.ts +68 -0
  108. package/dist/types/git.d.ts.map +1 -0
  109. package/dist/types/git.js +14 -0
  110. package/dist/types/git.js.map +1 -0
  111. package/dist/types/items.d.ts +41 -0
  112. package/dist/types/items.d.ts.map +1 -0
  113. package/dist/types/items.js +286 -0
  114. package/dist/types/items.js.map +1 -0
  115. package/dist/types/pet.d.ts +42 -0
  116. package/dist/types/pet.d.ts.map +1 -0
  117. package/dist/types/pet.js +16 -0
  118. package/dist/types/pet.js.map +1 -0
  119. package/dist/types/species.d.ts +30 -0
  120. package/dist/types/species.d.ts.map +1 -0
  121. package/dist/types/species.js +164 -0
  122. package/dist/types/species.js.map +1 -0
  123. package/dist/types/stats.d.ts +22 -0
  124. package/dist/types/stats.d.ts.map +1 -0
  125. package/dist/types/stats.js +18 -0
  126. package/dist/types/stats.js.map +1 -0
  127. package/dist/types/time.d.ts +30 -0
  128. package/dist/types/time.d.ts.map +1 -0
  129. package/dist/types/time.js +79 -0
  130. package/dist/types/time.js.map +1 -0
  131. package/dist/ui/ascii-art.d.ts +4 -0
  132. package/dist/ui/ascii-art.d.ts.map +1 -0
  133. package/dist/ui/ascii-art.js +170 -0
  134. package/dist/ui/ascii-art.js.map +1 -0
  135. package/dist/ui/display.d.ts +11 -0
  136. package/dist/ui/display.d.ts.map +1 -0
  137. package/dist/ui/display.js +93 -0
  138. package/dist/ui/display.js.map +1 -0
  139. package/dist/ui/help.d.ts +17 -0
  140. package/dist/ui/help.d.ts.map +1 -0
  141. package/dist/ui/help.js +280 -0
  142. package/dist/ui/help.js.map +1 -0
  143. package/dist/ui/progress-bar.d.ts +9 -0
  144. package/dist/ui/progress-bar.d.ts.map +1 -0
  145. package/dist/ui/progress-bar.js +57 -0
  146. package/dist/ui/progress-bar.js.map +1 -0
  147. package/package.json +61 -0
@@ -0,0 +1,342 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.createGitMonitor = exports.GitMonitor = void 0;
7
+ const child_process_1 = require("child_process");
8
+ const util_1 = require("util");
9
+ const path_1 = __importDefault(require("path"));
10
+ const fs_1 = __importDefault(require("fs"));
11
+ const execAsync = (0, util_1.promisify)(child_process_1.exec);
12
+ const git_1 = require("../types/git");
13
+ /**
14
+ * Git Monitor class for detecting and analyzing Git commits
15
+ */
16
+ class GitMonitor {
17
+ constructor(startPath = process.cwd()) {
18
+ this.repoPath = null;
19
+ this.repoPath = this.findGitRepo(startPath);
20
+ }
21
+ /**
22
+ * Search for .git folder in current or parent directories
23
+ */
24
+ findGitRepo(startPath) {
25
+ let currentPath = path_1.default.resolve(startPath);
26
+ while (currentPath !== path_1.default.dirname(currentPath)) {
27
+ const gitPath = path_1.default.join(currentPath, '.git');
28
+ if (fs_1.default.existsSync(gitPath)) {
29
+ return currentPath;
30
+ }
31
+ currentPath = path_1.default.dirname(currentPath);
32
+ }
33
+ return null;
34
+ }
35
+ /**
36
+ * Check if we're inside a Git repository
37
+ */
38
+ isInGitRepo() {
39
+ return this.repoPath !== null;
40
+ }
41
+ /**
42
+ * Get the repository path
43
+ */
44
+ getRepoPath() {
45
+ return this.repoPath;
46
+ }
47
+ /**
48
+ * Check if Git is installed
49
+ */
50
+ static async isGitAvailable() {
51
+ try {
52
+ await execAsync('git --version');
53
+ return true;
54
+ }
55
+ catch {
56
+ return false;
57
+ }
58
+ }
59
+ /**
60
+ * Get recent commits from the repository
61
+ */
62
+ async getLatestCommits(limit = 20) {
63
+ if (!this.repoPath) {
64
+ return [];
65
+ }
66
+ try {
67
+ // Get commit log with formatted output
68
+ const { stdout } = await execAsync(`git log -n ${limit} --pretty=format:"%H|%s|%an|%ad" --date=iso`, { cwd: this.repoPath });
69
+ return this.parseGitLog(stdout);
70
+ }
71
+ catch (error) {
72
+ console.error('Error getting git log:', error);
73
+ return [];
74
+ }
75
+ }
76
+ /**
77
+ * Parse git log output into GitCommitInfo array
78
+ */
79
+ parseGitLog(output) {
80
+ if (!output.trim()) {
81
+ return [];
82
+ }
83
+ const lines = output.trim().split('\n');
84
+ const commits = [];
85
+ for (const line of lines) {
86
+ const parts = line.split('|');
87
+ if (parts.length >= 4) {
88
+ const [fullHash, message, author, dateStr] = parts;
89
+ const shortHash = fullHash.substring(0, 7);
90
+ commits.push({
91
+ hash: fullHash,
92
+ shortHash,
93
+ message,
94
+ author,
95
+ date: new Date(dateStr),
96
+ });
97
+ }
98
+ }
99
+ return commits;
100
+ }
101
+ /**
102
+ * Get file changes for a specific commit
103
+ */
104
+ async getCommitChanges(commitHash) {
105
+ if (!this.repoPath) {
106
+ return null;
107
+ }
108
+ try {
109
+ const { stdout } = await execAsync(`git show ${commitHash} --shortstat --format=""`, { cwd: this.repoPath });
110
+ return this.parseShortStat(stdout);
111
+ }
112
+ catch {
113
+ return null;
114
+ }
115
+ }
116
+ /**
117
+ * Parse git shortstat output
118
+ * Example: " 3 files changed, 45 insertions(+), 12 deletions(-)"
119
+ */
120
+ parseShortStat(output) {
121
+ const result = {
122
+ filesChanged: 0,
123
+ linesAdded: 0,
124
+ linesDeleted: 0,
125
+ };
126
+ if (!output.trim()) {
127
+ return result;
128
+ }
129
+ // Extract files changed
130
+ const filesMatch = output.match(/(\d+)\s+files?\s+changed/);
131
+ if (filesMatch) {
132
+ result.filesChanged = parseInt(filesMatch[1], 10);
133
+ }
134
+ // Extract insertions
135
+ const insertionsMatch = output.match(/(\d+)\s+insertions?\([+]\)/);
136
+ if (insertionsMatch) {
137
+ result.linesAdded = parseInt(insertionsMatch[1], 10);
138
+ }
139
+ // Extract deletions
140
+ const deletionsMatch = output.match(/(\d+)\s+deletions?\([-]\)/);
141
+ if (deletionsMatch) {
142
+ result.linesDeleted = parseInt(deletionsMatch[1], 10);
143
+ }
144
+ return result;
145
+ }
146
+ /**
147
+ * Analyze commit message to determine type
148
+ */
149
+ analyzeCommitType(message) {
150
+ const lowerMessage = message.toLowerCase();
151
+ // Bug fix patterns
152
+ if (lowerMessage.includes('fix') ||
153
+ lowerMessage.includes('bug') ||
154
+ lowerMessage.includes('修复') ||
155
+ lowerMessage.includes('bugfix')) {
156
+ return git_1.GitCommitType.BUG_FIX;
157
+ }
158
+ // Feature patterns
159
+ if (lowerMessage.includes('feat') ||
160
+ lowerMessage.includes('add') ||
161
+ lowerMessage.includes('新') ||
162
+ lowerMessage.includes('新增') ||
163
+ lowerMessage.includes('feature')) {
164
+ return git_1.GitCommitType.FEATURE;
165
+ }
166
+ // Refactor patterns
167
+ if (lowerMessage.includes('refactor') ||
168
+ lowerMessage.includes('重构') ||
169
+ lowerMessage.includes('clean') ||
170
+ lowerMessage.includes('优化')) {
171
+ return git_1.GitCommitType.REFACTOR;
172
+ }
173
+ return git_1.GitCommitType.NORMAL;
174
+ }
175
+ /**
176
+ * Check if commit was made during "night owl" hours (22:00-06:00)
177
+ */
178
+ isNightCommit(date) {
179
+ const hour = date.getHours();
180
+ return hour >= 22 || hour < 6;
181
+ }
182
+ /**
183
+ * Check if commit is "large" (100+ total lines changed)
184
+ */
185
+ isLargeCommit(linesAdded, linesDeleted) {
186
+ return linesAdded + linesDeleted >= 100;
187
+ }
188
+ /**
189
+ * Calculate reward for a commit
190
+ */
191
+ calculateReward(commit) {
192
+ const type = this.analyzeCommitType(commit.message);
193
+ // Base rewards
194
+ let baseCoins = 5;
195
+ let baseXP = 10;
196
+ switch (type) {
197
+ case git_1.GitCommitType.BUG_FIX:
198
+ baseCoins = 10;
199
+ baseXP = 20;
200
+ break;
201
+ case git_1.GitCommitType.FEATURE:
202
+ baseCoins = 8;
203
+ baseXP = 15;
204
+ break;
205
+ case git_1.GitCommitType.REFACTOR:
206
+ baseCoins = 6;
207
+ baseXP = 12;
208
+ break;
209
+ case git_1.GitCommitType.NORMAL:
210
+ default:
211
+ baseCoins = 5;
212
+ baseXP = 10;
213
+ break;
214
+ }
215
+ const bonusReasons = [];
216
+ let totalCoins = baseCoins;
217
+ let totalXP = baseXP;
218
+ // Night owl bonus (2x coins)
219
+ const nightBonus = this.isNightCommit(commit.date);
220
+ if (nightBonus) {
221
+ totalCoins *= 2;
222
+ bonusReasons.push('🦉 Night Owl Bonus! 2x coins!');
223
+ }
224
+ // Large commit bonus
225
+ const linesChanged = (commit.linesAdded || 0) + (commit.linesDeleted || 0);
226
+ const largeBonus = this.isLargeCommit(commit.linesAdded || 0, commit.linesDeleted || 0);
227
+ if (largeBonus) {
228
+ totalCoins += 5;
229
+ totalXP += 10;
230
+ bonusReasons.push(`📦 Large Commit Bonus! (${linesChanged} lines)`);
231
+ }
232
+ return {
233
+ commitType: type,
234
+ baseCoins,
235
+ baseXP,
236
+ nightBonus,
237
+ largeBonus,
238
+ totalCoins,
239
+ totalXP,
240
+ bonusReasons,
241
+ };
242
+ }
243
+ /**
244
+ * Get commits since a specific commit (exclusive)
245
+ */
246
+ async getCommitsSince(lastCommitHash) {
247
+ if (!this.repoPath) {
248
+ return [];
249
+ }
250
+ try {
251
+ const { stdout } = await execAsync(`git log ${lastCommitHash}..HEAD --pretty=format:"%H|%s|%an|%ad" --date=iso`, { cwd: this.repoPath });
252
+ const commits = this.parseGitLog(stdout);
253
+ // Fetch stats for each commit
254
+ for (const commit of commits) {
255
+ const changes = await this.getCommitChanges(commit.hash);
256
+ if (changes) {
257
+ commit.filesChanged = changes.filesChanged;
258
+ commit.linesAdded = changes.linesAdded;
259
+ commit.linesDeleted = changes.linesDeleted;
260
+ }
261
+ }
262
+ return commits;
263
+ }
264
+ catch {
265
+ return [];
266
+ }
267
+ }
268
+ /**
269
+ * Get all commits (for initial setup when lastCommitHash is undefined)
270
+ */
271
+ async getAllCommits(limit = 50) {
272
+ const commits = await this.getLatestCommits(limit);
273
+ // Fetch stats for each commit
274
+ for (const commit of commits) {
275
+ const changes = await this.getCommitChanges(commit.hash);
276
+ if (changes) {
277
+ commit.filesChanged = changes.filesChanged;
278
+ commit.linesAdded = changes.linesAdded;
279
+ commit.linesDeleted = changes.linesDeleted;
280
+ }
281
+ }
282
+ return commits;
283
+ }
284
+ /**
285
+ * Get commit type display name
286
+ */
287
+ static getCommitTypeName(type) {
288
+ switch (type) {
289
+ case git_1.GitCommitType.BUG_FIX:
290
+ return 'Bug Fix';
291
+ case git_1.GitCommitType.FEATURE:
292
+ return 'Feature';
293
+ case git_1.GitCommitType.REFACTOR:
294
+ return 'Refactor';
295
+ case git_1.GitCommitType.NORMAL:
296
+ default:
297
+ return 'Normal';
298
+ }
299
+ }
300
+ /**
301
+ * Get commit type color for terminal display
302
+ */
303
+ static getCommitTypeColor(type) {
304
+ switch (type) {
305
+ case git_1.GitCommitType.BUG_FIX:
306
+ return 'red';
307
+ case git_1.GitCommitType.FEATURE:
308
+ return 'green';
309
+ case git_1.GitCommitType.REFACTOR:
310
+ return 'blue';
311
+ case git_1.GitCommitType.NORMAL:
312
+ default:
313
+ return 'gray';
314
+ }
315
+ }
316
+ /**
317
+ * Calculate day difference between two dates (for streak calculation)
318
+ */
319
+ static getDayDiff(date1, date2) {
320
+ const d1 = new Date(date1);
321
+ const d2 = new Date(date2);
322
+ d1.setHours(0, 0, 0, 0);
323
+ d2.setHours(0, 0, 0, 0);
324
+ return Math.round((d2.getTime() - d1.getTime()) / (1000 * 60 * 60 * 24));
325
+ }
326
+ /**
327
+ * Format date as YYYY-MM-DD
328
+ */
329
+ static formatDate(date) {
330
+ const d = new Date(date);
331
+ return d.toISOString().split('T')[0];
332
+ }
333
+ }
334
+ exports.GitMonitor = GitMonitor;
335
+ /**
336
+ * Create a GitMonitor instance
337
+ */
338
+ const createGitMonitor = (startPath) => {
339
+ return new GitMonitor(startPath);
340
+ };
341
+ exports.createGitMonitor = createGitMonitor;
342
+ //# sourceMappingURL=git-monitor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-monitor.js","sourceRoot":"","sources":["../../src/monitor/git-monitor.ts"],"names":[],"mappings":";;;;;;AAAA,iDAAqC;AACrC,+BAAiC;AACjC,gDAAwB;AACxB,4CAAoB;AAEpB,MAAM,SAAS,GAAG,IAAA,gBAAS,EAAC,oBAAI,CAAC,CAAC;AAElC,sCAIsB;AAEtB;;GAEG;AACH,MAAa,UAAU;IAGrB,YAAY,YAAoB,OAAO,CAAC,GAAG,EAAE;QAFrC,aAAQ,GAAkB,IAAI,CAAC;QAGrC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IAC9C,CAAC;IAED;;OAEG;IACK,WAAW,CAAC,SAAiB;QACnC,IAAI,WAAW,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAE1C,OAAO,WAAW,KAAK,cAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;YACjD,MAAM,OAAO,GAAG,cAAI,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;YAC/C,IAAI,YAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC3B,OAAO,WAAW,CAAC;YACrB,CAAC;YACD,WAA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,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACvC,CAAC;CACF;AAlYD,gCAkYC;AAED;;GAEG;AACI,MAAM,gBAAgB,GAAG,CAAC,SAAkB,EAAc,EAAE;IACjE,OAAO,IAAI,UAAU,CAAC,SAAS,CAAC,CAAC;AACnC,CAAC,CAAC;AAFW,QAAA,gBAAgB,oBAE3B"}
@@ -0,0 +1,86 @@
1
+ import { PetStats } from './stats';
2
+ /**
3
+ * Care action types
4
+ */
5
+ export declare enum CareAction {
6
+ FEED = "feed",
7
+ PLAY = "play",
8
+ CLEAN = "clean",
9
+ HEAL = "heal",
10
+ NONE = "none"
11
+ }
12
+ /**
13
+ * Single care need assessment
14
+ */
15
+ export interface CareNeed {
16
+ stat: keyof PetStats;
17
+ threshold: number;
18
+ action: CareAction;
19
+ itemId: string;
20
+ itemName: string;
21
+ priority: number;
22
+ }
23
+ /**
24
+ * Result of a single care action
25
+ */
26
+ export interface CareActionResult {
27
+ action: CareAction;
28
+ itemId: string;
29
+ itemName: string;
30
+ success: boolean;
31
+ statChanges: {
32
+ stat: string;
33
+ from: number;
34
+ to: number;
35
+ }[];
36
+ reason?: string;
37
+ }
38
+ /**
39
+ * Result of one-click care operation
40
+ */
41
+ export interface CareResult {
42
+ success: boolean;
43
+ actionsTaken: CareActionResult[];
44
+ statsBefore: PetStats;
45
+ statsAfter: PetStats;
46
+ coinsSpent: number;
47
+ itemsUsed: number;
48
+ }
49
+ /**
50
+ * Auto-purchase rule
51
+ */
52
+ export interface AutoPurchaseRule {
53
+ itemId: string;
54
+ itemName: string;
55
+ minQuantity: number;
56
+ maxCost: number;
57
+ itemPrice: number;
58
+ }
59
+ /**
60
+ * Auto-purchase result
61
+ */
62
+ export interface AutoPurchaseResult {
63
+ purchased: boolean;
64
+ items: {
65
+ itemId: string;
66
+ itemName: string;
67
+ quantity: number;
68
+ cost: number;
69
+ }[];
70
+ totalCost: number;
71
+ }
72
+ /**
73
+ * Auto-care configuration
74
+ */
75
+ export interface AutoCareConfig {
76
+ enabled: boolean;
77
+ autoFeed: boolean;
78
+ thresholds: {
79
+ hunger: number;
80
+ happiness: number;
81
+ cleanliness: number;
82
+ energy: number;
83
+ health: number;
84
+ };
85
+ }
86
+ //# sourceMappingURL=auto-care.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auto-care.d.ts","sourceRoot":"","sources":["../../src/types/auto-care.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC;;GAEG;AACH,oBAAY,UAAU;IACpB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,KAAK,UAAU;IACf,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,QAAQ,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,WAAW,EAAE,QAAQ,CAAC;IACtB,UAAU,EAAE,QAAQ,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC9E,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE;QACV,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CareAction = void 0;
4
+ /**
5
+ * Care action types
6
+ */
7
+ var CareAction;
8
+ (function (CareAction) {
9
+ CareAction["FEED"] = "feed";
10
+ CareAction["PLAY"] = "play";
11
+ CareAction["CLEAN"] = "clean";
12
+ CareAction["HEAL"] = "heal";
13
+ CareAction["NONE"] = "none";
14
+ })(CareAction || (exports.CareAction = CareAction = {}));
15
+ //# sourceMappingURL=auto-care.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auto-care.js","sourceRoot":"","sources":["../../src/types/auto-care.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,IAAY,UAMX;AAND,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,2BAAa,CAAA;IACb,6BAAe,CAAA;IACf,2BAAa,CAAA;IACb,2BAAa,CAAA;AACf,CAAC,EANW,UAAU,0BAAV,UAAU,QAMrB"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * User configuration file
3
+ * Located at ~/.pet-terminal/config.json
4
+ */
5
+ /**
6
+ * Auto-care thresholds configuration
7
+ */
8
+ export interface AutoCareThresholds {
9
+ hunger: number;
10
+ happiness: number;
11
+ cleanliness: number;
12
+ energy: number;
13
+ health: number;
14
+ }
15
+ /**
16
+ * Auto-care configuration
17
+ */
18
+ export interface AutoCareConfig {
19
+ enabled: boolean;
20
+ thresholds: AutoCareThresholds;
21
+ }
22
+ /**
23
+ * User configuration
24
+ */
25
+ export interface UserConfig {
26
+ /** Global decay rate multiplier (0.5 = half speed, 2.0 = double speed) */
27
+ decayRate: number;
28
+ /** Auto-purchase and auto-care settings */
29
+ autoCare: AutoCareConfig;
30
+ }
31
+ /**
32
+ * Default user configuration
33
+ */
34
+ export declare const DEFAULT_USER_CONFIG: UserConfig;
35
+ /**
36
+ * Configuration file validation result
37
+ */
38
+ export interface ConfigValidationResult {
39
+ valid: boolean;
40
+ errors: string[];
41
+ }
42
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,kBAAkB,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,QAAQ,EAAE,cAAc,CAAC;CAC1B;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,UAYjC,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ /**
3
+ * User configuration file
4
+ * Located at ~/.pet-terminal/config.json
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.DEFAULT_USER_CONFIG = void 0;
8
+ /**
9
+ * Default user configuration
10
+ */
11
+ exports.DEFAULT_USER_CONFIG = {
12
+ decayRate: 1.0,
13
+ autoCare: {
14
+ enabled: false,
15
+ thresholds: {
16
+ hunger: 70,
17
+ happiness: 60,
18
+ cleanliness: 60,
19
+ energy: 50,
20
+ health: 70,
21
+ },
22
+ },
23
+ };
24
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA+BH;;GAEG;AACU,QAAA,mBAAmB,GAAe;IAC7C,SAAS,EAAE,GAAG;IACd,QAAQ,EAAE;QACR,OAAO,EAAE,KAAK;QACd,UAAU,EAAE;YACV,MAAM,EAAE,EAAE;YACV,SAAS,EAAE,EAAE;YACb,WAAW,EAAE,EAAE;YACf,MAAM,EAAE,EAAE;YACV,MAAM,EAAE,EAAE;SACX;KACF;CACF,CAAC"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Git commit types based on message analysis
3
+ */
4
+ export declare enum GitCommitType {
5
+ BUG_FIX = "bug_fix",
6
+ FEATURE = "feature",
7
+ REFACTOR = "refactor",
8
+ NORMAL = "normal"
9
+ }
10
+ /**
11
+ * Git commit information extracted from git log
12
+ */
13
+ export interface GitCommitInfo {
14
+ hash: string;
15
+ shortHash: string;
16
+ message: string;
17
+ author: string;
18
+ date: Date;
19
+ filesChanged?: number;
20
+ linesAdded?: number;
21
+ linesDeleted?: number;
22
+ }
23
+ /**
24
+ * Reward calculation result for a single commit
25
+ */
26
+ export interface GitRewardResult {
27
+ commitType: GitCommitType;
28
+ baseCoins: number;
29
+ baseXP: number;
30
+ nightBonus: boolean;
31
+ largeBonus: boolean;
32
+ totalCoins: number;
33
+ totalXP: number;
34
+ bonusReasons: string[];
35
+ }
36
+ /**
37
+ * Result of processing git commits
38
+ */
39
+ export interface GitProcessResult {
40
+ success: boolean;
41
+ newCommits: number;
42
+ totalCoins: number;
43
+ totalXP: number;
44
+ streak: number;
45
+ rewards: GitCommitReward[];
46
+ error?: string;
47
+ }
48
+ /**
49
+ * Single commit reward details
50
+ */
51
+ export interface GitCommitReward {
52
+ shortHash: string;
53
+ message: string;
54
+ type: GitCommitType;
55
+ coins: number;
56
+ xp: number;
57
+ bonuses: string[];
58
+ }
59
+ /**
60
+ * Git statistics for display
61
+ */
62
+ export interface GitStats {
63
+ totalCommits: number;
64
+ currentStreak: number;
65
+ lastCommitHash?: string;
66
+ lastCommitDate?: string;
67
+ }
68
+ //# sourceMappingURL=git.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/types/git.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,aAAa;IACvB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,MAAM,WAAW;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,IAAI,CAAC;IACX,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,aAAa,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GitCommitType = void 0;
4
+ /**
5
+ * Git commit types based on message analysis
6
+ */
7
+ var GitCommitType;
8
+ (function (GitCommitType) {
9
+ GitCommitType["BUG_FIX"] = "bug_fix";
10
+ GitCommitType["FEATURE"] = "feature";
11
+ GitCommitType["REFACTOR"] = "refactor";
12
+ GitCommitType["NORMAL"] = "normal";
13
+ })(GitCommitType || (exports.GitCommitType = GitCommitType = {}));
14
+ //# sourceMappingURL=git.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/types/git.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;IACnB,sCAAqB,CAAA;IACrB,kCAAiB,CAAA;AACnB,CAAC,EALW,aAAa,6BAAb,aAAa,QAKxB"}
@@ -0,0 +1,41 @@
1
+ export declare enum ItemType {
2
+ FOOD = "food",
3
+ TOY = "toy",
4
+ CLEANING = "cleaning",
5
+ MEDICINE = "medicine"
6
+ }
7
+ export declare enum ItemRarity {
8
+ COMMON = "common",
9
+ RARE = "rare",
10
+ EPIC = "epic",
11
+ LEGENDARY = "legendary"
12
+ }
13
+ export interface ItemEffect {
14
+ hunger?: number;
15
+ happiness?: number;
16
+ health?: number;
17
+ cleanliness?: number;
18
+ energy?: number;
19
+ }
20
+ export interface ItemDefinition {
21
+ id: string;
22
+ name: string;
23
+ type: ItemType;
24
+ rarity: ItemRarity;
25
+ description: string;
26
+ emoji: string;
27
+ effect: ItemEffect;
28
+ xpReward: number;
29
+ price?: number;
30
+ }
31
+ export interface InventoryItem {
32
+ itemId: string;
33
+ quantity: number;
34
+ }
35
+ export declare const ITEMS: Record<string, ItemDefinition>;
36
+ export declare const getItem: (itemId: string) => ItemDefinition | undefined;
37
+ export declare const getItemsByType: (type: ItemType) => ItemDefinition[];
38
+ export declare const getStartingInventory: () => InventoryItem[];
39
+ export declare const getRarityColor: (rarity: ItemRarity) => string;
40
+ export declare const getRarityIcon: (rarity: ItemRarity) => string;
41
+ //# sourceMappingURL=items.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"items.d.ts","sourceRoot":"","sources":["../../src/types/items.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IACl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