mediaguru 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 (48) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/CODE_OF_CONDUCT.md +41 -0
  3. package/CONTRIBUTING.md +50 -0
  4. package/LICENSE +21 -0
  5. package/README.md +193 -0
  6. package/RELEASE.md +38 -0
  7. package/SECURITY.md +24 -0
  8. package/bin/mediaguru.js +2 -0
  9. package/dist/cli/interactive.d.ts +1 -0
  10. package/dist/cli/interactive.js +647 -0
  11. package/dist/core/batch/index.d.ts +16 -0
  12. package/dist/core/batch/index.js +66 -0
  13. package/dist/core/compress/index.d.ts +17 -0
  14. package/dist/core/compress/index.js +96 -0
  15. package/dist/core/config/index.d.ts +14 -0
  16. package/dist/core/config/index.js +56 -0
  17. package/dist/core/export/index.d.ts +12 -0
  18. package/dist/core/export/index.js +82 -0
  19. package/dist/core/image/index.d.ts +44 -0
  20. package/dist/core/image/index.js +206 -0
  21. package/dist/core/ocr/index.d.ts +14 -0
  22. package/dist/core/ocr/index.js +53 -0
  23. package/dist/core/pdf/index.d.ts +34 -0
  24. package/dist/core/pdf/index.js +121 -0
  25. package/dist/core/qr/index.d.ts +12 -0
  26. package/dist/core/qr/index.js +37 -0
  27. package/dist/core/screenshot/index.d.ts +12 -0
  28. package/dist/core/screenshot/index.js +46 -0
  29. package/dist/core/server/index.d.ts +5 -0
  30. package/dist/core/server/index.js +101 -0
  31. package/dist/core/text2img/index.d.ts +14 -0
  32. package/dist/core/text2img/index.js +64 -0
  33. package/dist/index.d.ts +1 -0
  34. package/dist/index.js +429 -0
  35. package/dist/plugins/index.d.ts +41 -0
  36. package/dist/plugins/index.js +61 -0
  37. package/dist/tests/test.d.ts +1 -0
  38. package/dist/tests/test.js +108 -0
  39. package/dist/tests/test_playwright.d.ts +1 -0
  40. package/dist/tests/test_playwright.js +60 -0
  41. package/dist/utils/branding.d.ts +6 -0
  42. package/dist/utils/branding.js +21 -0
  43. package/dist/utils/file.d.ts +7 -0
  44. package/dist/utils/file.js +29 -0
  45. package/dist/utils/templates.d.ts +9 -0
  46. package/dist/utils/templates.js +347 -0
  47. package/mediaguru-1.0.0.tgz +0 -0
  48. package/package.json +51 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,25 @@
1
+ # Changelog
2
+
3
+ All notable changes to the **MediaGuru** project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ---
9
+
10
+ ## [1.1.0] - 2026-06-02
11
+
12
+ ### Added
13
+ * **Local HTTP REST API Server (`mediaguru server`)**: A standalone, zero-dependency REST service exposing QR generators, webpage screenshots, and config profiles over port `3000`.
14
+ * **Playwright Screenshots & Renders**: Built-in screenshot and document rendering tools.
15
+ * **Branding & Legal Docs**: Completed open-source repository templates including MIT `LICENSE`, `CODE_OF_CONDUCT.md`, `CONTRIBUTING.md`, and `SECURITY.md`.
16
+
17
+ ---
18
+
19
+ ## [1.0.0] - 2026-06-02
20
+
21
+ ### Added
22
+ * **Core Processing Engines**: PDF (merge, split, extract, compress), Image (resize, convert, watermark, local chroma background remover), QR Code, Tesseract OCR, and Text-to-Image templates.
23
+ * **CLI Subcommands**: Commander commands mapping for `pdf`, `image`, `qr`, `ocr`, `screenshot`, `text2img`, `compress`, `batch`, `export`, and `config`.
24
+ * **Interactive Mode**: Guided console wizard driven by `inquirer` for fluid terminal setups.
25
+ * **Dynamic Plugin Registry**: Lifecycle hooks supporting runtime commander subcommand injections.
@@ -0,0 +1,41 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully receiving constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best for the overall community, not just the individual
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and unwelcome sexual attention or advances
22
+ * Trolling, insulting or derogatory comments, and personal or political attacks
23
+ * Public or private harassment
24
+ * Publishing others' private information, such as a physical or email address, without their explicit permission
25
+ * Other conduct which could reasonably be considered inappropriate in a professional setting
26
+
27
+ ## Enforcement Responsibilities
28
+
29
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate, fair, and corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
30
+
31
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
32
+
33
+ ## Scope
34
+
35
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
36
+
37
+ ## Enforcement
38
+
39
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders at **safety@kontyra.com**. All complaints will be reviewed and investigated promptly and fairly.
40
+
41
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
@@ -0,0 +1,50 @@
1
+ # Internal Contribution Guidelines
2
+
3
+ This repository contains the confidential, proprietary source code of **MediaGuru** (a Kontyra product). Access and contributions are strictly limited to authorized engineering staff.
4
+
5
+ ## 🔒 Security & Access Rules
6
+
7
+ * **Confidentiality**: Never share the source code, configs, or test sandboxes with external parties.
8
+ * **Accidental Exposure Guard**: Ensure that you never push this repository to public git hosts or publish it to the public npm registry. `package.json` is gated with `"private": true` to block accidental uploads.
9
+
10
+ ---
11
+
12
+ ## 🛠️ Local Development Setup
13
+
14
+ 1. **Clone the Repository**:
15
+ ```bash
16
+ git clone <private-repo-url>/mediaguru.git
17
+ cd mediaguru
18
+ ```
19
+
20
+ 2. **Install Dependencies & Browsers**:
21
+ ```bash
22
+ npm install
23
+ npx playwright install chromium
24
+ ```
25
+
26
+ 3. **Development Commands**:
27
+ * Build TypeScript: `npm run build`
28
+ * Typecheck: `npm run typecheck`
29
+ * Run tests: `npm test`
30
+ * Run browser tests: `npm run test:browser`
31
+
32
+ ---
33
+
34
+ ## 📐 Coding Conventions
35
+
36
+ * **Pure TypeScript**: Avoid using `any`. Write strict, explicit TypeScript interfaces and type parameters.
37
+ * **ES Modules**: Always include `.js` file extensions in your relative imports (e.g. `import { QrEngine } from './qr/index.js';`).
38
+ * **Decoupled Architecture**: All core features must reside in a dedicated engine under `src/core/` and conform to pluggable interfaces to avoid code bloating.
39
+ * **Spinner Feedback**: Always provide immediate, friendly terminal feedback utilizing `ora` loading animations and `chalk` colors for successful/failed outcomes.
40
+ * **Branding Integrity**: Include the signature terminal footer `Powered by Kontyra` at the completion of command tasks.
41
+
42
+ ---
43
+
44
+ ## 📬 Internal PR Checklist
45
+
46
+ Before merging into `main`, ensure that:
47
+ 1. `npm run build` compiles cleanly with **zero** typecheck errors.
48
+ 2. `npm test` and `npm run test:browser` pass all validation suites successfully.
49
+ 3. The codebase formats nicely conforming to our configuration guidelines.
50
+ 4. You have updated the `CHANGELOG.md` with your feature highlights.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kontyra
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,193 @@
1
+ # MediaGuru Unified Toolkit
2
+
3
+ **Powered by Kontyra**
4
+
5
+ [![npm version](https://img.shields.io/npm/v/mediaguru.svg)](https://www.npmjs.com/package/mediaguru)
6
+ [![GitHub release](https://img.shields.io/github/v/release/RayBen445/mediaguru)](https://github.com/RayBen445/mediaguru/releases)
7
+ [![CI](https://github.com/RayBen445/mediaguru/actions/workflows/test.yml/badge.svg)](https://github.com/RayBen445/mediaguru/actions/workflows/test.yml)
8
+ [![lint](https://github.com/RayBen445/mediaguru/actions/workflows/lint.yml/badge.svg)](https://github.com/RayBen445/mediaguru/actions/workflows/lint.yml)
9
+
10
+
11
+ **MediaGuru** is a premium, developer-focused npm CLI and terminal toolkit designed to generate, convert, process, optimize, and extract data from documents and media. Built using pure TypeScript, ES Modules, Sharp, PDF-Lib, Tesseract, and Playwright, it delivers state-of-the-art results for everyday developer tasks.
12
+
13
+ ---
14
+
15
+ ## 🚀 Key Features
16
+
17
+ * **Interactive Mode**: Simply run `mediaguru` to launch a step-by-step terminal wizard.
18
+ * **PDF Engine**: Convert Markdown/HTML to PDF via headless browser, and merge, split, extract, or compress PDFs.
19
+ * **Image Processor**: Fast resizing, watermarking, format conversion, and extensible solid boundary background removal.
20
+ * **OCR Text Extractor**: Convert images to text with direct TXT, Markdown, or JSON exporting.
21
+ * **Playwright Screenshotter**: Capture responsive website layouts (with mobile emulation & full-page scroll height options).
22
+ * **Text-to-Image Creator**: Generate stunning, visually polished social card assets, posters, quotes, and header banners.
23
+ * **Folder Compressor**: Compress images or entire assets directories, showing file space statistics.
24
+ * **Batch Operations**: Glob-expanded batch runs for file conversions and PDF compilation.
25
+ * **Extensible Architecture**: Highly decoupled design allowing plugins to dynamically add custom commander actions.
26
+
27
+ ---
28
+
29
+ ## 📦 Installation & Setup
30
+
31
+ Clone the repository and install dependencies:
32
+
33
+ ```bash
34
+ cd mediaguru
35
+ npm install
36
+ npx playwright install chromium
37
+ ```
38
+
39
+ To build and compile:
40
+
41
+ ```bash
42
+ npm run build
43
+ ```
44
+
45
+ Link command globally (optional):
46
+
47
+ ```bash
48
+ npm link
49
+ ```
50
+
51
+ ---
52
+
53
+ ## 🛠️ CLI Command Reference
54
+
55
+ MediaGuru registers `mediaguru` and `mguru` binary aliases.
56
+
57
+ ### 1. Interactive Mode
58
+ ```bash
59
+ mediaguru
60
+ ```
61
+ *(Launches Inquirer wizard menu)*
62
+
63
+ ### 2. PDF Tools
64
+ ```bash
65
+ # Markdown / HTML compilation
66
+ mediaguru pdf notes.md
67
+ mediaguru pdf invoice.html
68
+
69
+ # PDF Operations
70
+ mediaguru pdf merge a.pdf b.pdf c.pdf
71
+ mediaguru pdf split report.pdf
72
+ mediaguru pdf extract report.pdf
73
+ mediaguru pdf compress report.pdf
74
+ ```
75
+
76
+ ### 3. Image Tools
77
+ ```bash
78
+ mediaguru image resize photo.jpg 800x600
79
+ mediaguru image convert photo.png webp
80
+ mediaguru image watermark image.jpg logo.png
81
+ mediaguru image remove-bg photo.jpg
82
+ ```
83
+
84
+ ### 4. QR Generator
85
+ ```bash
86
+ mediaguru qr https://kontyra.com
87
+ mediaguru qr https://kontyra.com --svg
88
+ mediaguru qr https://kontyra.com --size 500
89
+ ```
90
+
91
+ ### 5. OCR Engine
92
+ ```bash
93
+ mediaguru ocr receipt.jpg
94
+ mediaguru ocr receipt.jpg --export markdown
95
+ ```
96
+
97
+ ### 6. Screenshot Engine
98
+ ```bash
99
+ mediaguru screenshot https://example.com
100
+ mediaguru screenshot https://example.com --full-page
101
+ mediaguru screenshot https://example.com --mobile
102
+ ```
103
+
104
+ ### 7. Text-to-Image Creator
105
+ ```bash
106
+ mediaguru text2img "Welcome to Kontyra"
107
+ mediaguru text2img "Code is poetry" --theme glass --type quote --author "Developer"
108
+ ```
109
+
110
+ ### 8. Compression
111
+ ```bash
112
+ mediaguru compress photo.jpg
113
+ mediaguru compress ./assets
114
+ ```
115
+
116
+ ### 9. Batch Processing
117
+ ```bash
118
+ mediaguru batch "images/*.png" --convert webp
119
+ mediaguru batch "docs/*.md" --pdf
120
+ ```
121
+
122
+ ### 10. Data Exporter & Configs
123
+ ```bash
124
+ # Export system settings
125
+ mediaguru export json
126
+ mediaguru export markdown
127
+ mediaguru export csv
128
+
129
+ # Config panel
130
+ mediaguru config
131
+ ```
132
+
133
+ ---
134
+
135
+ ## ⚙️ Configuration Profile
136
+
137
+ Configuration is stored in `~/.mediagururc.json`.
138
+
139
+ * **Default Image Format**: Format used for resizes and text-to-image (`webp`, `png`, `jpg`, `jpeg`).
140
+ * **PDF Rendering Engine**: Output compiler (`playwright`, `local`).
141
+ * **Compression Quality**: Percent quality for sharp operations (`1-100`).
142
+ * **Screenshot Resolution**: Standard resolution width/height (`e.g., 1280x720`).
143
+ * **Output Folder**: Destination for processed files.
144
+
145
+ ---
146
+
147
+ ## 🔌 Extensible Plugin Architecture
148
+
149
+ MediaGuru defines an extensible plugin framework. You can register custom modules with lifecycle hooks:
150
+
151
+ ```typescript
152
+ import { IMediaGuruPlugin } from './plugins/index.js';
153
+
154
+ const MyAiPlugin: IMediaGuruPlugin = {
155
+ name: 'mediaguru-ai-generator',
156
+ version: '1.0.0',
157
+ description: 'AI Image & Transcription Module',
158
+
159
+ async beforeCommand(commandName, args) {
160
+ console.log(`Command ${commandName} is starting...`);
161
+ },
162
+
163
+ registerCustomCommands(program) {
164
+ program
165
+ .command('ai-generate')
166
+ .description('Generate images using AI model endpoints')
167
+ .argument('<prompt>', 'Prompt for image generation')
168
+ .action(async (prompt) => {
169
+ console.log(`Generating AI graphics for prompt: "${prompt}"...`);
170
+ });
171
+ }
172
+ };
173
+ ```
174
+
175
+ ---
176
+
177
+ ## 📝 Verification Tests
178
+ Run the automated test suite to verify the core engines:
179
+
180
+ ```bash
181
+ npm run build
182
+ npm test
183
+ ```
184
+
185
+ Outputs will be saved in the `./test_sandbox` folder.
186
+
187
+ ---
188
+
189
+ ### Terminal Footer Branding
190
+
191
+ ```text
192
+ Powered by Kontyra
193
+ ```
package/RELEASE.md ADDED
@@ -0,0 +1,38 @@
1
+ # Release Management Guide
2
+
3
+ MediaGuru is a **Kontyra** private enterprise product and follows semantic versioning for stable, internal deployment.
4
+
5
+ ## Semantic Versioning Rules
6
+
7
+ - **PATCH** (`x.y.Z`): bug fixes and non-breaking maintenance.
8
+ - **MINOR** (`x.Y.z`): new backward-compatible features.
9
+ - **MAJOR** (`X.y.z`): breaking API or behavior changes.
10
+
11
+ ## Release Workflow
12
+
13
+ 1. Ensure `main` is stable and CI compiles cleanly (`npm run build`).
14
+ 2. Run standard version updates or tag updates.
15
+ 3. Push commit + tag (`git push --follow-tags`) to the private Git host.
16
+ 4. Tag push triggers private enterprise automated workflow verifications:
17
+ - validates version/tag consistency
18
+ - runs tests and offline package validation
19
+ - updates changelog ledger
20
+ - generates private Release notes
21
+ 5. Publish from internal Release events.
22
+
23
+ ## Secure Private Publishing
24
+
25
+ * **Private Registry**: Deployment is strictly published to Kontyra's private, authenticated enterprise registry.
26
+ * **Accidental Publish Guard**: The configuration contains a `"private": true` block in `package.json`. If you attempt to run `npm publish` to the public npm registry, npm will immediately block the upload.
27
+ * **Pre-publish Checks**:
28
+ - TypeScript compilation and typechecks (`npm run build` & `npm run typecheck`)
29
+ - Standalone REST API router testing
30
+ - Offline engine validation suite execution
31
+ - Playwright browser automation dry-run
32
+ * Never publish manually from unverified branches.
33
+
34
+ ## Branch Strategy
35
+
36
+ - `main`: production-ready.
37
+ - `dev`: integration branch for upcoming releases.
38
+ - `feature/*`: isolated feature work.
package/SECURITY.md ADDED
@@ -0,0 +1,24 @@
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ We actively provide security updates and patches for the following versions of **MediaGuru**:
6
+
7
+ | Version | Supported |
8
+ | --- | --- |
9
+ | `1.x.x` | Yes (Active) |
10
+ | `< 1.0.0` | No |
11
+
12
+ ## Reporting a Vulnerability
13
+
14
+ We take the security of our command-line tools and web-automation scripts extremely seriously. If you identify a vulnerability or security flaw, please do **NOT** open a public issue on GitHub.
15
+
16
+ Instead, please report security vulnerabilities directly to our team:
17
+ * **Email**: **security@kontyra.com**
18
+
19
+ Please include as much of the following details as possible to help us investigate:
20
+ 1. Clear description of the vulnerability and its potential impact.
21
+ 2. Step-by-step instructions or test scripts to reproduce the issue locally.
22
+ 3. System environment parameters (e.g. Node version, OS version).
23
+
24
+ We will acknowledge receipt of your report within **24 hours** and aim to provide a resolved security patch within **7 business days**.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import '../dist/index.js';
@@ -0,0 +1 @@
1
+ export declare function launchInteractive(): Promise<void>;