recommend-series 1.0.0-1204de9e521c
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/CHANGELOG.md +26 -0
- package/README.md +25 -0
- package/dist/recommend-series.d.ts +3 -0
- package/dist/recommend-series.js +100 -0
- package/dist/types.d.ts +19 -0
- package/dist/types.js +3 -0
- package/package.json +33 -0
- package/tsconfig copy.json +21 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
### AI ASSISTANT CHANGE LOG | 2026-01-14
|
|
8
|
+
|
|
9
|
+
- **Task:** Set up hot reload development environment for CLI app.
|
|
10
|
+
- **Action:** Added tsx as dev dependency, created dev script using tsx watch for TypeScript hot reload, added missing @paralleldrive/cuid2 dependency.
|
|
11
|
+
- **Logic Tier:** Infrastructure / Configuration.
|
|
12
|
+
- **Impact:** Enables faster development workflow with automatic reload on file changes, eliminating need for manual rebuilds during development.
|
|
13
|
+
- **Files:**
|
|
14
|
+
- `package.json`
|
|
15
|
+
|
|
16
|
+
### AI ASSISTANT CHANGE LOG | 2026-01-14
|
|
17
|
+
|
|
18
|
+
- **Task:** Add super short README documentation and fix start script path.
|
|
19
|
+
- **Action:** Created README.md with installation, usage, and development instructions. Fixed start script to use correct compiled file path.
|
|
20
|
+
- **Logic Tier:** Documentation / Configuration.
|
|
21
|
+
- **Impact:** Provides quick reference for users and developers, and ensures start script works correctly.
|
|
22
|
+
- **Files:**
|
|
23
|
+
- `README.md`
|
|
24
|
+
- `package.json`
|
|
25
|
+
|
|
26
|
+
---
|
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# recommend-series
|
|
2
|
+
|
|
3
|
+
A CLI tool for TV series recommendations.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g recommend-series
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
recommend-series
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Type your preferences and get recommendations. Type `exit` or `quit` to exit.
|
|
18
|
+
|
|
19
|
+
## Development
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install
|
|
23
|
+
npm run dev # Run with hot reload
|
|
24
|
+
npm run build # Build for production
|
|
25
|
+
```
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
const readline = __importStar(require("readline"));
|
|
38
|
+
const cuid2_1 = require("@paralleldrive/cuid2");
|
|
39
|
+
const chatHistory = [];
|
|
40
|
+
function displayChatHistory() {
|
|
41
|
+
if (chatHistory.length > 0) {
|
|
42
|
+
console.log();
|
|
43
|
+
chatHistory.forEach((msg) => {
|
|
44
|
+
if (msg.role === "user") {
|
|
45
|
+
console.log(`You: ${msg.message}`);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
console.log(`tv-recommender: ${msg.message}`);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
console.log();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async function generateRecommendation(query, sessionId) {
|
|
55
|
+
// Local recommendation logic
|
|
56
|
+
// This is a placeholder - replace with your actual recommendation algorithm
|
|
57
|
+
return `Based on your query "${query}", I recommend checking out some popular series. This is a placeholder recommendation - implement your recommendation logic here.`;
|
|
58
|
+
}
|
|
59
|
+
function createReadlineInterface() {
|
|
60
|
+
return readline.createInterface({
|
|
61
|
+
input: process.stdin,
|
|
62
|
+
output: process.stdout,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
async function run() {
|
|
66
|
+
const sessionId = (0, cuid2_1.createId)();
|
|
67
|
+
console.log("TV Recommender Chat");
|
|
68
|
+
console.log(`Session ID: ${sessionId}`);
|
|
69
|
+
console.log("Type 'exit' or 'quit' to exit\n");
|
|
70
|
+
const rl = createReadlineInterface();
|
|
71
|
+
const askQuestion = () => {
|
|
72
|
+
displayChatHistory();
|
|
73
|
+
rl.question("Me: ", async (input) => {
|
|
74
|
+
const trimmedInput = input.trim();
|
|
75
|
+
if (trimmedInput === "" ||
|
|
76
|
+
trimmedInput.toLowerCase() === "exit" ||
|
|
77
|
+
trimmedInput.toLowerCase() === "quit") {
|
|
78
|
+
console.log("\nGoodbye!");
|
|
79
|
+
rl.close();
|
|
80
|
+
process.exit(0);
|
|
81
|
+
}
|
|
82
|
+
chatHistory.push({ role: "user", message: trimmedInput });
|
|
83
|
+
chatHistory.push({
|
|
84
|
+
role: "tv-recommender",
|
|
85
|
+
message: "Generating your recommendation...",
|
|
86
|
+
});
|
|
87
|
+
displayChatHistory();
|
|
88
|
+
const recommendation = await generateRecommendation(trimmedInput, sessionId);
|
|
89
|
+
chatHistory[chatHistory.length - 1] = {
|
|
90
|
+
role: "tv-recommender",
|
|
91
|
+
message: recommendation,
|
|
92
|
+
};
|
|
93
|
+
displayChatHistory();
|
|
94
|
+
askQuestion();
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
askQuestion();
|
|
98
|
+
}
|
|
99
|
+
run();
|
|
100
|
+
//# sourceMappingURL=recommend-series.js.map
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface Series {
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
genre: string[];
|
|
5
|
+
rating: number;
|
|
6
|
+
year: number;
|
|
7
|
+
description?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface RecommendationOptions {
|
|
10
|
+
genres?: string[];
|
|
11
|
+
minRating?: number;
|
|
12
|
+
maxResults?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface RecommendationResult {
|
|
15
|
+
series: Series;
|
|
16
|
+
score: number;
|
|
17
|
+
reasons: string[];
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "recommend-series",
|
|
3
|
+
"version": "1.0.0-1204de9e521c",
|
|
4
|
+
"description": "A TV series recommendation tool",
|
|
5
|
+
"main": "dist/recommend-series.js",
|
|
6
|
+
"types": "dist/recommend-series.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"recommend-series": "./dist/recommend-series.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"dev": "tsx watch src/recommend-series.ts",
|
|
13
|
+
"dev:build": "tsc --watch",
|
|
14
|
+
"start": "node dist/recommend-series.js",
|
|
15
|
+
"prepublishOnly": "npm run build"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"recommendation",
|
|
19
|
+
"tv-series",
|
|
20
|
+
"cli"
|
|
21
|
+
],
|
|
22
|
+
"author": "",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/node": "^20.0.0",
|
|
26
|
+
"tsx": "^4.7.0",
|
|
27
|
+
"typescript": "^5.0.0"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@paralleldrive/cuid2": "^2.2.2",
|
|
31
|
+
"commander": "^11.0.0"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"removeComments": true,
|
|
6
|
+
"emitDecoratorMetadata": true,
|
|
7
|
+
"experimentalDecorators": true,
|
|
8
|
+
"allowSyntheticDefaultImports": true,
|
|
9
|
+
"target": "ES2021",
|
|
10
|
+
"sourceMap": true,
|
|
11
|
+
"outDir": "./dist",
|
|
12
|
+
"baseUrl": "./",
|
|
13
|
+
"incremental": true,
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"strictNullChecks": false,
|
|
16
|
+
"noImplicitAny": false,
|
|
17
|
+
"strictBindCallApply": false,
|
|
18
|
+
"forceConsistentCasingInFileNames": false,
|
|
19
|
+
"noFallthroughCasesInSwitch": false
|
|
20
|
+
}
|
|
21
|
+
}
|