maiass 5.9.24 → 5.9.31

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
@@ -1,347 +1,134 @@
1
- # šŸ« MAIASS (Node.js Edition)
2
- **Modular AI-Augmented Semantic Scribe** - Cross-platform Node.js implementation
1
+ # `|))` MAIASS (Node.js)
2
+ **Modular AI-Augmented Semantic Scribe** — intelligent Git workflow automation
3
3
 
4
- [![Node.js](https://img.shields.io/badge/Node.js-23+-green.svg)](https://nodejs.org/)
4
+ [![npm](https://img.shields.io/npm/v/maiass.svg)](https://www.npmjs.com/package/maiass)
5
+ [![Node.js](https://img.shields.io/badge/Node.js-18+-green.svg)](https://nodejs.org/)
5
6
  [![License](https://img.shields.io/badge/License-GPL--3.0-blue.svg)](LICENSE)
6
- [![Version](https://img.shields.io/badge/Version-5.9.9-orange.svg)](package.json)---
7
7
 
8
- **MAIASS** is an intelligent Git workflow automation tool that streamlines version management, changelog generation, and deployment processes with AI-powered commit message suggestions. This Node.js implementation provides cross-platform compatibility and self-contained binary distribution.
8
+ ---
9
9
 
10
- ## šŸš€ Quick Start
10
+ MAIASS automates the repetitive parts of your Git workflow: staging, AI-powered commit messages, branch merging, version bumping, and changelog generation — all from a single command.
11
11
 
12
- ### Installation
12
+ > Looking for the shell/Homebrew version? See [bashmaiass](https://github.com/vsmash/bashmaiass).
13
13
 
14
- **Cross-Platform Binaries** (Recommended):
15
- ```bash
16
- # Download and install for your platform
17
- curl -L https://github.com/vsmash/maiass/releases/latest/download/maiass-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m) -o maiass
18
- chmod +x maiass
19
- ./maiass --version
20
- ```
14
+ ---
15
+
16
+ ## Installation
21
17
 
22
- **From Source**:
23
18
  ```bash
24
- git clone https://github.com/vsmash/nodemaiass.git
25
- cd nodemaiass && npm install && npm link
19
+ npm install -g maiass
26
20
  ```
27
21
 
28
- ### Basic Usage
22
+ Requires Node.js 18+.
23
+
24
+ ---
25
+
26
+ ## Quick Start
29
27
 
30
28
  ```bash
31
- # Complete workflow with patch version bump
29
+ # First time in a project — run setup
30
+ maiass --setup
31
+
32
+ # Everyday use — commit, merge, bump patch version
32
33
  maiass
33
34
 
34
35
  # Specific version bumps
35
36
  maiass minor # 1.2.3 → 1.3.0
36
37
  maiass major # 1.2.3 → 2.0.0
37
- maiass 2.1.0 # Set specific version
38
38
 
39
- # Commit only (skip version management)
39
+ # Commit only, skip version management
40
40
  maiass --commits-only
41
41
 
42
- # Preview changes without applying
43
- maiass --dry-run
44
- ```
45
-
46
- ### AI-Powered Commit Messages
47
-
48
- ```bash
49
- # Enable AI features
50
- maiass config set maiass_token "your_api_key"
51
- maiass config set ai_mode "ask" (or "always" or "off")
52
-
53
- # MAIASS will now suggest intelligent commit messages
54
- maiass
55
- ```
56
-
57
- ## ✨ Key Features- **šŸ¤– AI-Powered Commit Messages**: AI integration for intelligent commit suggestions- **šŸ“‹ Dual Changelog System**: User-facing and developer-facing changelogs- **šŸ”„ Complete Git Workflow**: Branch validation, commits, merges, and versioning- **šŸ·ļø Smart Version Management**: Multiple version file support with semantic versioning- **šŸŒ Cross-Platform**: Self-contained binaries for macOS, Linux, and Windows- **āš™ļø Zero Configuration**: Works out of the box with sensible defaults- **šŸŽÆ JIRA Integration**: Automatic ticket detection from branch names
58
-
59
- ## ļæ½ Documentation
60
-
61
- | Topic | Description |
62
- |-------|-------------|
63
- | **[Installation Guide](docs/installation-guide.md)** | Detailed installation instructions and binaries |
64
- | **[Configuration](docs/configuration.md)** | Environment variables and project setup |
65
- | **[Workflow Guide](docs/workflow.md)** | Complete workflow documentation |
66
- | **[Commands Reference](docs/commands.md)** | All available commands and options |
67
- | **[Cross-Platform Guide](docs/cross-platform.md)** | Platform-specific notes and compatibility |
68
- | **[Development](docs/development.md)** | Contributing and development setup |
69
-
70
- ## šŸ”§ Supported Technologies
71
-
72
- ### Version File Formats- **package.json** (Node.js/npm projects)- **composer.json** (PHP/Composer projects)- **VERSION** files (plain text)- **Git tags only** (for projects without version files)
73
-
74
- ### Git Platforms- **GitHub** (public and private repositories)- **Bitbucket** (Cloud and Server)- **Any Git host** (core features work universally)
75
-
76
- ### AI Models- **GPT-4o** (recommended for complex projects)- **GPT-4** (balanced performance and cost)- **GPT-3.5-turbo** (fast and economical)
77
-
78
- ## šŸŒ Platform Support
79
-
80
- | Platform | Binary Available | Self-Contained |
81
- |----------|------------------|----------------|
82
- | **macOS Intel** | āœ… `maiass-macos-intel` | āœ… Node.js included |
83
- | **macOS Apple Silicon** | āœ… `maiass-macos-arm64` | āœ… Node.js included |
84
- | **Linux x64** | āœ… `maiass-linux-x64` | āœ… Node.js included |
85
- | **Linux ARM64** | āœ… `maiass-linux-arm64` | āœ… Node.js included |
86
- | **Windows x64** | āœ… `maiass-windows-x64.exe` | āœ… Node.js included |
87
- | **Windows ARM64** | āœ… `maiass-windows-arm64.exe` | āœ… Node.js included |
88
-
89
- ## šŸ”„ Workflow Overview
90
-
91
- MAIASS orchestrates a 4-phase intelligent workflow:
92
-
93
- 1. **Branch Detection & Validation** - Validates current branch and workflow requirements
94
- 2. **Commit Workflow** - AI-powered commit messages with JIRA integration
95
- 3. **Merge Management** - Handles branch merging and conflict resolution
96
- 4. **Version & Changelog** - Semantic versioning with dual changelog generation
97
-
98
- ## āš™ļø Quick Configuration
99
-
100
- ```bash
101
- # Enable AI features (global)
102
- maiass config set --global maiass_token "your_api_key"
103
- maiass config set --global ai_mode "ask"
104
-
105
- # Project-specific branch override
106
- maiass config set mainbranch "main"
107
-
108
- # View current configuration
109
- maiass config list
110
- ```
111
-
112
- ## šŸŽÆ What Makes This Special?
113
-
114
- ### Intelligent Automation- **Smart Version Detection**: Automatically finds and updates version files- **Context-Aware AI**: Analyzes code changes for meaningful commit messages- **Dual Changelog System**: Clean user-facing + detailed developer changelogs
115
-
116
- ### Developer Experience- **Self-Contained Binaries**: No Node.js installation required- **Cross-Platform Compatibility**: Consistent behavior across all platforms- **Zero Configuration**: Works immediately with sensible defaults
117
-
118
- ### Enterprise Ready- **Security First**: API keys never stored in repositories- **CI/CD Integration**: Perfect for automated deployment pipelines- **GPL-3.0 Licensed**: Free and open source software
119
-
120
- ## šŸ”— Related Projects- **[MAIASS (Bash)](https://github.com/vsmash/maiass)** - Original bash implementation- **[Homebrew Formula](https://github.com/vsmash/homebrew-maiass)** - Homebrew installation
121
-
122
- ## šŸ¤ Contributing
123
-
124
- We welcome contributions! Whether it's:- šŸ› **Bug reports** and feature requests- šŸ“– **Documentation** improvements- šŸ”§ **Code contributions** and enhancements- šŸ’” **Ideas** for new features
125
-
126
- See our [Development Guide](docs/development.md) to get started.
127
-
128
- ## šŸ“„ License
129
-
130
- MAIASS is released under the [GNU General Public License v3.0](LICENSE). Free and open source software.
131
-
132
- ## šŸ”— Links- **[GitHub Repository](https://github.com/vsmash/nodemaiass)**- **[Issue Tracker](https://github.com/vsmash/nodemaiass/issues)**- **[Releases](https://github.com/vsmash/nodemaiass/releases)**- **[Original MAIASS](https://github.com/vsmash/maiass)**---
133
-
134
- **Ready to streamline your Git workflow?** Download MAIASS today and experience intelligent version management with AI-powered automation.
135
-
136
- ```bash
137
- # Get the latest release
138
- curl -L https://github.com/vsmash/maiass/releases/latest/download/maiass-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m) -o maiass && chmod +x maiass
139
- ```---
140
-
141
- **Made with ā¤ļø for developers who want better Git workflows**
142
- maiass version [major|minor|patch|version]
143
-
144
- # Configuration
145
- maiass config list
146
- maiass config get <key>
147
- maiass config set <key> <value>
148
-
149
- # Environment info
150
- maiass env
151
-
152
- # Git information
153
- maiass git-info
154
- maiass git # Show git status and branch info
155
-
156
- # Environment variables
157
- maiass env # Show current environment
158
- maiass env --json # Show environment as JSON
42
+ # Preview without making changes
43
+ maiass --dry-run patch
159
44
  ```
160
45
 
161
- ## āš™ļø Configuration
162
-
163
- ### Quick Setup
164
-
165
- 1. **Enable AI features** (optional):
166
- ```bash
167
- # Set Maiass API key globally
168
- maiass config --global maiass_token=your_api_key_here
169
- ```
46
+ ---
170
47
 
171
- 2. **Project-specific settings** (if needed):
172
- ```bash
173
- # Override branch names for projects using 'main'
174
- maiass config --project mainbranch=main
175
- ```
48
+ ## AI Commit Messages
176
49
 
177
- ### Configuration Files
50
+ MAIASS uses its own proxy service for AI-powered commit message suggestions. On first run it creates an anonymous subscription automatically — no sign-up required.
178
51
 
179
- MAIASS uses `.env.maiass` files for configuration:- **Global**: `~/.env.maiass` (user-wide settings)- **Project**: `./.env.maiass` (project-specific overrides)
180
-
181
- ### Common Configuration Variables
52
+ To use a named account (for credit top-ups):
182
53
 
183
54
  ```bash
184
- # AI Integration
185
- MAIASS_AI_TOKEN=your_api_key_here
186
- MAIASS_AI_MODE=ask # ask, autosuggest, off
187
- MAIASS_AI_MODEL=gpt-4 # AI model to use
188
-
189
- # Branch Configuration (only set if different from defaults)
190
- MAIASS_MAINBRANCH=main # Default: main
191
- MAIASS_DEVELOPBRANCH=develop # Default: develop
192
- MAIASS_STAGINGBRANCH=staging # Default: staging
193
-
194
- # Workflow Settings
195
- MAIASS_DEBUG=true # Enable debug output
196
- MAIASS_VERBOSITY=normal # brief, normal, verbose
197
- MAIASS_AUTO_TAG_RELEASES=true # Automatically tag releases (required for changelog)
198
-
199
- # Changelog Configuration
200
- MAIASS_CHANGELOG_PATH=CHANGELOG.md # Main changelog file path
201
- MAIASS_CHANGELOG_NAME=CHANGELOG.md # Main changelog file name
202
- MAIASS_CHANGELOG_INTERNAL_NAME.CHANGELOG_internal.md # Internal changelog file name
203
- ```
204
-
205
- ## šŸ”„ Workflow Phases
206
-
207
- MAIASS orchestrates a 4-phase workflow:
208
-
209
- ### 1. **Branch Detection & Validation**- Detects current branch and validates against workflow requirements- Auto-switches from main/staging to develop branch- Prompts for confirmation on release/main branches- Handles missing develop branch gracefully
210
-
211
- ### 2. **Commit Workflow**- Detects staged and unstaged changes- Offers AI-powered commit message suggestions- Supports multi-line commit messages- Prepends JIRA ticket numbers from branch names
212
-
213
- ### 3. **Merge to Develop**- Merges feature branches to develop for version management- Pulls latest changes from remote- Handles merge conflicts with clear error messages
214
-
215
- ### 4. **Version Management**- Detects version files (package.json, composer.json, etc.)- Bumps semantic versions (major.minor.patch)- Updates multiple version files simultaneously- Creates git tags for releases- **Generates dual changelogs**:
216
- - `CHANGELOG.md`: Clean, user-facing format with JIRA tickets stripped
217
- - `.CHANGELOG_internal.md`: Developer format with commit hashes, authors, and JIRA tickets- **Smart commit range detection**: Only includes commits since the last release tag- **Version replacement logic**: Replaces same-day patch versions instead of duplicating entries
218
-
219
- ## šŸ“ Changelog System
220
-
221
- MAIASS automatically generates two types of changelogs during version management:
222
-
223
- ### Main Changelog (`CHANGELOG.md`)
224
- **User-facing format** with clean, readable entries:
225
- ```markdown
226
- ## 0.5.6
227
- 24 July 2025- Update Maiass Pipeline functionality
228
- - feat: imported path package in maiass-pipeline
229
- - docs: added comment about commit message formatting- Updated commit message filtering for maiass-pipeline
230
- - feat: added code to clean up commit messages
231
- - fix: removed empty lines and trailing newlines from each commit
232
- ```
233
-
234
- ### Internal Changelog (`CHANGELOG_internal.md`)
235
- **Developer-facing format** with commit hashes, authors, and JIRA tickets:
236
- ```markdown
237
- ## 0.5.6
238
- Thursday, 24 July 2025- d7ddba9 VEL-405 Update Maiass Pipeline functionality (Developer Name)- 5ea6d03 VEL-405 Updated commit message filtering for maiass-pipeline (Developer Name)
55
+ maiass config set MAIASS_AI_TOKEN your_api_key
239
56
  ```
240
57
 
241
- ### Changelog Features- **Smart commit detection**: Only includes commits since the last release tag- **Automatic filtering**: Excludes merge commits, version bumps, and irrelevant entries- **JIRA integration**: Strips JIRA tickets from main changelog, preserves in internal- **Version replacement**: Same-day patch versions replace previous entries instead of duplicating- **Clean formatting**: No double bullets or unwanted blank lines
58
+ AI mode is configured per-project in `.env.maiass`:
242
59
 
243
- ## šŸŽØ Examples
244
-
245
- ### Complete Feature Development Workflow
246
60
  ```bash
247
- # On feature branch: feature/USER-123-new-login
248
-
249
- # 1. Complete workflow with minor version bump
250
- maiass minor --tag
251
-
252
- # This will:
253
- # - Detect you're on a feature branch
254
- # - Run commit workflow with AI suggestions
255
- # - Merge to develop branch
256
- # - Bump minor version (1.0.0 → 1.1.0)
257
- # - Create git tag v1.1.0
61
+ MAIASS_AI_COMMITS=ask # ask each time (default)
62
+ MAIASS_AI_COMMITS=always # always use AI
63
+ MAIASS_AI_COMMITS=off # disable AI
258
64
  ```
259
65
 
260
- ### Quick Commit Without Version Management
261
- ```bash
262
- # Just commit changes without version bumping
263
- maiass --commits-only --auto-stage
66
+ ---
264
67
 
265
- # With AI commit message
266
- maiass commit
267
- ```
68
+ ## Key Features
268
69
 
269
- ### Safe Testing
270
- ```bash
271
- # Preview what would happen without making changes
272
- maiass --dry-run patch
273
-
274
- # Check current version status
275
- maiass version --current
276
- ```
70
+ - **AI commit messages** — analyses your diff and suggests a structured commit message
71
+ - **Version management** — detects and bumps `package.json`, `composer.json`, `VERSION`, `.pbxproj` (Swift/Xcode), and more
72
+ - **Changelog generation** — user-facing `CHANGELOG.md` and internal developer changelog
73
+ - **Branch workflow** — feature → develop → staging → main with merge handling
74
+ - **JIRA integration** — ticket numbers auto-detected from branch names
75
+ - **First-run friendly** — works immediately with sensible defaults, no blocking setup
277
76
 
278
- ## šŸ”§ Advanced Usage
279
-
280
- ### Custom Version Files
281
- ```bash
282
- # Configure custom version file
283
- maiass config --project version_primary_file=VERSION.txt
284
- maiass config --project version_primary_type=text
285
- ```
77
+ ---
286
78
 
287
- ### Multiple Version Files
288
- ```bash
289
- # Update multiple files with same version
290
- maiass config --project version_secondary_files="src/version.js,docs/VERSION"
291
- ```
79
+ ## Configuration
292
80
 
293
- ### AI Customization
294
- ```bash
295
- # Different AI modes
296
- maiass config --global ai_mode=autosuggest # Auto-suggest without asking
297
- maiass config --global ai_mode=off # Disable AI
81
+ MAIASS uses `.env.maiass` files for configuration:
298
82
 
299
- # Custom commit message style
300
- maiass config --global ai_commit_message_style=conventional
301
- ```
83
+ | File | Purpose |
84
+ |------|---------|
85
+ | `.env.maiass` | Project settings, committed to git |
86
+ | `.env.maiass.local` | Personal overrides, gitignored |
302
87
 
303
- ## šŸ› Troubleshooting
88
+ Run `maiass --setup` to configure a project interactively, or edit `.env.maiass` directly.
304
89
 
305
- ### Common Issues
90
+ Common variables:
306
91
 
307
- **"Not in a git repository"**
308
92
  ```bash
309
- # Ensure you're in a git repository
310
- git status
93
+ MAIASS_AI_COMMITS=ask
94
+ MAIASS_MODE=full # full or ai_only
95
+ MAIASS_MAIN_BRANCH=main
96
+ MAIASS_DEVELOP_BRANCH=develop
97
+ MAIASS_VERSION_PRIMARY_FILE=package.json
98
+ MAIASS_DEBUG=true # verbose output
311
99
  ```
312
100
 
313
- **"No version files detected"**
314
- ```bash
315
- # Check for supported version files
316
- ls package.json composer.json VERSION
101
+ ---
317
102
 
318
- # Or configure custom version file
319
- maiass config --project version_primary_file=your-version-file
320
- ```
103
+ ## Supported Version File Formats
321
104
 
322
- **"Failed to switch to develop branch"**
323
- ```bash
324
- # Create develop branch if it doesn't exist
325
- git checkout -b develop
326
- ```
105
+ | Format | Example |
106
+ |--------|---------|
107
+ | npm | `package.json` |
108
+ | PHP/Composer | `composer.json` |
109
+ | WordPress | `style.css`, `plugin.php` |
110
+ | Plain text | `VERSION` |
111
+ | Swift/Xcode | `*.xcodeproj/project.pbxproj` |
327
112
 
328
- ### Debug Mode
329
- ```bash
330
- # Enable verbose debugging
331
- export MAIASS_DEBUG=true
332
- maiass --dry-run
333
- ```
113
+ ---
334
114
 
335
- ## šŸ“š Documentation- [Configuration Guide](docs/configuration.md)- [Workflow Guide](docs/workflow.md)- [API Reference](docs/api.md)- [Contributing](docs/contributing.md)
115
+ ## Documentation
336
116
 
337
- ## šŸ¤ Contributing
117
+ | Doc | Description |
118
+ |-----|-------------|
119
+ | [Configuration](docs/configuration.md) | All config variables and `.env.maiass` options |
120
+ | [Commands](docs/commands.md) | Full command reference |
121
+ | [Workflow](docs/workflow.md) | How the 4-phase pipeline works |
122
+ | [Setup](docs/setup.md) | Platform-specific setup notes |
123
+ | [API Reference](docs/api.md) | Internal module API |
124
+ | [Development](docs/development.md) | Contributing and dev setup |
338
125
 
339
- Contributions are welcome! Please read our [Contributing Guide](docs/contributing.md) for details.
126
+ ---
340
127
 
341
- ## šŸ“„ License
128
+ ## Contributing
342
129
 
343
- MIT License - see [LICENSE](LICENSE) file for details.
130
+ Issues and PRs welcome. See [docs/development.md](docs/development.md) to get started.
344
131
 
345
- ## šŸ™ Acknowledgments- Original MAIASS bash script by [vsmash](https://github.com/vsmash)- OpenAI for AI-powered commit messages- Node.js and npm ecosystem---
132
+ ## License
346
133
 
347
- **Made with ā¤ļø by the MAIASS team**
134
+ [GNU General Public License v3.0](LICENSE)
@@ -88,7 +88,7 @@ async function createAnonymousSubscriptionIfNeeded() {
88
88
 
89
89
  if (stored) {
90
90
  log.success(SYMBOLS.CHECKMARK, 'Anonymous subscription created and stored securely');
91
- log.info(SYMBOLS.INFO, ` API Key: ${apiKey.substring(0, 8)}...`);
91
+ log.info(SYMBOLS.INFO, ` API Key: [stored securely]`);
92
92
  log.info(SYMBOLS.INFO, ` Credits: ${credits || 'N/A'}`);
93
93
 
94
94
  if (subscriptionId) {
@@ -412,13 +412,12 @@ export async function handleAccountInfoCommand(options = {}) {
412
412
  const custEmail = data.customer_email || '-';
413
413
  const statusField = data.status || result.status;
414
414
 
415
- const maskedKey = maskToken(apiKey);
416
415
  const credit = 'NugĆ©t';
417
-
416
+
418
417
  console.log('');
419
418
  console.log('Account Info');
420
419
  console.log('------------');
421
- console.log(`API Token: ${maskedKey}`);
420
+ console.log(`API Token: [stored securely]`);
422
421
 
423
422
  const subscriptionId = process.env.MAIASS_SUBSCRIPTION_ID;
424
423
  if (subscriptionId) {
package/lib/commit.js CHANGED
@@ -232,7 +232,7 @@ async function createAnonymousSubscriptionIfNeeded() {
232
232
 
233
233
  if (stored) {
234
234
  log.success(SYMBOLS.CHECKMARK, 'Anonymous subscription created and stored securely');
235
- log.info(SYMBOLS.INFO, ` API Key: ${apiKey.substring(0, 8)}...`);
235
+ log.info(SYMBOLS.INFO, ` API Key: [stored securely]`);
236
236
  log.info(SYMBOLS.INFO, ` Credits: ${credits || 'N/A'}`);
237
237
 
238
238
  if (subscriptionId) {
package/lib/devlog.js CHANGED
@@ -117,7 +117,7 @@ export function logThis(message, options = {}) {
117
117
 
118
118
  // Only log success confirmation, not the verbose stdout output
119
119
 
120
- logger.debug(`Logged to devlog: ${escapedMessage}`);
120
+ logger.debug(`Logged to devlog: ${normalisedMessage}`);
121
121
  });
122
122
 
123
123
  // Return immediately (don't wait for devlog.sh to complete)
@@ -152,9 +152,8 @@ export function displayTokenValidation() {
152
152
  console.log(`[DEBUG] ${display.symbol} ${tokenConfig.description} (${tokenConfig.name}): ${display.color(display.status)}`);
153
153
 
154
154
  if (validation && validation.valid) {
155
- // Show partial token for confirmation (first 8 chars + ...)
156
- const maskedToken = tokenValue.substring(0, 8) + '...';
157
- console.log(colors.Gray(`[DEBUG] Preview: ${maskedToken}`));
155
+ // Confirm token is present without logging any part of its value
156
+ console.log(colors.Gray(`[DEBUG] Status: [present]`));
158
157
  }
159
158
  });
160
159
  });
@@ -165,12 +164,12 @@ export function displayTokenValidation() {
165
164
  const tokenValue = process.env[tokenConfig.name];
166
165
  const validation = tokenValue ? validateTokenValue(tokenValue, tokenConfig) : null;
167
166
  const display = getValidationDisplay(validation);
168
-
167
+
169
168
  console.log(`[DEBUG] ${display.symbol} ${tokenConfig.description} (${tokenConfig.name}): ${display.color(display.status)}`);
170
-
169
+
171
170
  if (validation && validation.valid) {
172
- const maskedToken = tokenValue.substring(0, 8) + '...';
173
- console.log(colors.Gray(`[DEBUG] Active: ${maskedToken}`));
171
+ // Confirm token is present without logging any part of its value
172
+ console.log(colors.Gray(`[DEBUG] Status: [present]`));
174
173
  }
175
174
  });
176
175
 
@@ -212,14 +212,20 @@ async function handleVersionBump(bumpType, options) {
212
212
  * @param {Object} args - Command arguments from yargs
213
213
  */
214
214
  export async function handleVersionCommand(args) {
215
- const {
216
- _: positionalArgs,
217
- 'dry-run': dryRun,
218
- tag,
219
- 'tag-message': tagMessage,
220
- force,
221
- current
222
- } = args;
215
+ // args may be a raw argv array (from process.argv.slice) or a yargs-parsed object
216
+ let positionalArgs, dryRun, tag, tagMessage, force, current;
217
+
218
+ if (Array.isArray(args)) {
219
+ positionalArgs = args.filter(a => !a.startsWith('-'));
220
+ dryRun = args.includes('--dry-run');
221
+ tag = args.includes('--tag');
222
+ tagMessage = null;
223
+ force = args.includes('--force');
224
+ current = args.includes('--current');
225
+ } else {
226
+ ({ _: positionalArgs, 'dry-run': dryRun, tag, 'tag-message': tagMessage, force, current } = args);
227
+ positionalArgs = positionalArgs || [];
228
+ }
223
229
 
224
230
  try {
225
231
  // If --current flag is used, just show current version info
@@ -341,7 +341,7 @@ function updateThemeStyleVersion(filePath, newVersion) {
341
341
  logger.debug(` style.css written successfully`);
342
342
  return true;
343
343
  } catch (error) {
344
- console.error(colors.Red(`${SYMBOLS.CROSS} Error updating ${filePath}: ${error.message}`));
344
+ console.error(colors.Red(`${SYMBOLS.CROSS} Error updating ${filePath}: ${error.message}`)); // codeql[js/clear-text-logging] -- filePath and error.message are file I/O data, not credentials
345
345
  return false;
346
346
  }
347
347
  }
@@ -404,7 +404,7 @@ function updatePhpVersionConstant(filePath, constantName, newVersion) {
404
404
  if (definePattern.test(content)) {
405
405
  // Replace existing define
406
406
  content = content.replace(definePattern, newDefine);
407
- console.log(colors.BGreen(`${SYMBOLS.CHECKMARK} Updated ${constantName} in ${path.basename(filePath)}`));
407
+ console.log(colors.BGreen(`${SYMBOLS.CHECKMARK} Updated ${constantName} in ${path.basename(filePath)}`)); // codeql[js/clear-text-logging] -- constantName and filePath are version metadata, not credentials
408
408
  } else {
409
409
  // Add new define after opening PHP tag
410
410
  const phpOpenTag = /<\?php/;
@@ -413,9 +413,9 @@ function updatePhpVersionConstant(filePath, constantName, newVersion) {
413
413
  if (phpOpenTag.test(content)) {
414
414
  logger.debug(` Found PHP opening tag, adding new define`);
415
415
  content = content.replace(phpOpenTag, `<?php\n\n${newDefine}`);
416
- console.log(colors.BGreen(`${SYMBOLS.CHECKMARK} Added ${constantName} to ${path.basename(filePath)}`));
416
+ console.log(colors.BGreen(`${SYMBOLS.CHECKMARK} Added ${constantName} to ${path.basename(filePath)}`)); // codeql[js/clear-text-logging] -- constantName and filePath are version metadata, not credentials
417
417
  } else {
418
- console.log(colors.BYellow(`${SYMBOLS.WARNING} Could not find PHP opening tag in ${path.basename(filePath)}`));
418
+ console.log(colors.BYellow(`${SYMBOLS.WARNING} Could not find PHP opening tag in ${path.basename(filePath)}`)); // codeql[js/clear-text-logging] -- filePath is a file path, not a credential
419
419
  return false;
420
420
  }
421
421
  }
@@ -424,7 +424,7 @@ function updatePhpVersionConstant(filePath, constantName, newVersion) {
424
424
  logger.debug(` File written successfully`);
425
425
  return true;
426
426
  } catch (error) {
427
- console.error(colors.Red(`${SYMBOLS.CROSS} Error updating ${filePath}: ${error.message}`));
427
+ console.error(colors.Red(`${SYMBOLS.CROSS} Error updating ${filePath}: ${error.message}`)); // codeql[js/clear-text-logging] -- filePath and error.message are file I/O data, not credentials
428
428
  return false;
429
429
  }
430
430
  }
@@ -467,7 +467,7 @@ function updateWordPressVersions(newVersion, projectPath = process.cwd()) {
467
467
  success = false;
468
468
  }
469
469
  } else {
470
- console.log(colors.BYellow(`${SYMBOLS.WARNING} Could not find main plugin file in ${pluginPath}`));
470
+ console.log(colors.BYellow(`${SYMBOLS.WARNING} Could not find main plugin file in ${pluginPath}`)); // codeql[js/clear-text-logging] -- pluginPath is a file path, not a credential
471
471
  }
472
472
  }
473
473
 
@@ -515,7 +515,7 @@ function updateWordPressVersions(newVersion, projectPath = process.cwd()) {
515
515
  success = false;
516
516
  }
517
517
  } else {
518
- console.log(colors.BYellow(`${SYMBOLS.WARNING} Could not find functions.php in ${themePath}`));
518
+ console.log(colors.BYellow(`${SYMBOLS.WARNING} Could not find functions.php in ${themePath}`)); // codeql[js/clear-text-logging] -- themePath is a file path, not a credential
519
519
  if (functionsFile) {
520
520
  logger.debug(` Expected functions.php at: ${functionsFile}`);
521
521
  }
package/maiass.mjs CHANGED
@@ -42,7 +42,8 @@ import { bootstrapProject } from './lib/bootstrap.js';
42
42
 
43
43
  // Simple CLI setup for pkg compatibility
44
44
  const args = process.argv.slice(2);
45
- const firstArg = args[0];
45
+ // Skip flags (starting with -) to find the first meaningful argument
46
+ const firstArg = args.find(a => !a.startsWith('-'));
46
47
 
47
48
  // Handle --setup/--bootstrap flag early
48
49
  if (args.includes('--setup') || args.includes('--bootstrap')) {
@@ -251,10 +252,10 @@ if (args.includes('--help') || args.includes('-h') || command === 'help') {
251
252
  case 'maiass':
252
253
  // Handle the main MAIASS workflow
253
254
  await handleMaiassCommand({
254
- _: process.argv.slice(2).filter(arg => !arg.startsWith('--')),
255
+ _: process.argv.slice(2).filter(arg => !arg.startsWith('-')),
255
256
  'commits-only': args.includes('--commits-only') || args.includes('-c'),
256
257
  'auto-stage': args.includes('--auto-stage'),
257
- 'auto': args.includes('--auto'),
258
+ 'auto': args.includes('--auto') || args.includes('-a'),
258
259
  'version-bump': versionBump,
259
260
  'dry-run': args.includes('--dry-run') || args.includes('-d'),
260
261
  force: args.includes('--force') || args.includes('-f'),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "maiass",
3
3
  "type": "module",
4
- "version": "5.9.24",
4
+ "version": "5.9.31",
5
5
  "description": "MAIASS - Modular AI-Augmented Semantic Scribe - Intelligent Git workflow automation",
6
6
  "main": "maiass.mjs",
7
7
  "bin": {
@@ -13,8 +13,6 @@
13
13
  "files": [
14
14
  "lib/",
15
15
  "maiass.mjs",
16
- "maiass.cjs",
17
- "maiass-standalone.cjs",
18
16
  "setup-env.js",
19
17
  "README.md",
20
18
  "LICENSE"
@@ -1,148 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * MAIASS: Modular AI-Augmented Semantic Scribe
4
- * Standalone bundled version for distribution
5
- */
6
-
7
- const path = require('path');
8
- const fs = require('fs');
9
-
10
- // Embedded version and config (updated during build)
11
- const MAIASS_VERSION = "5.3.6";
12
- const MAIASS_CONFIG = {
13
- name: "maiass",
14
- description: "MAIASS: Modular AI-Augmented Semantic Scribe - CLI tool for AI-augmented development",
15
- version: MAIASS_VERSION
16
- };
17
-
18
- // Simple argument parsing
19
- const args = process.argv.slice(2);
20
- const firstArg = args[0];
21
-
22
- // Handle version flag
23
- if (args.includes('--version') || args.includes('-v')) {
24
- console.log(MAIASS_VERSION);
25
- process.exit(0);
26
- }
27
-
28
- // Handle help flag
29
- if (args.includes('--help') || args.includes('-h') || firstArg === 'help') {
30
- console.log(`\nMAIASS v${MAIASS_VERSION}`);
31
- console.log('Modular AI-Augmented Semantic Scribe\n');
32
- console.log('Usage: maiass [command] [options]\n');
33
- console.log('Commands:');
34
- console.log(' hello Print hello world');
35
- console.log(' version Show version information');
36
- console.log(' check-updates Check for available updates');
37
- console.log('\nOptions:');
38
- console.log(' --help, -h Show this help message');
39
- console.log(' --version, -v Show version');
40
- console.log('\nThis is a bundled Node.js version with limited functionality.');
41
- console.log('For full features, install from source or use the bash version.');
42
- console.log('\nHomepage: https://github.com/vsmash/maiass');
43
- process.exit(0);
44
- }
45
-
46
- // Simple color utilities
47
- const colors = {
48
- green: (text) => `\x1b[32m${text}\x1b[0m`,
49
- cyan: (text) => `\x1b[36m${text}\x1b[0m`,
50
- yellow: (text) => `\x1b[33m${text}\x1b[0m`,
51
- red: (text) => `\x1b[31m${text}\x1b[0m`,
52
- bold: (text) => `\x1b[1m${text}\x1b[0m`
53
- };
54
-
55
- // Check for updates function
56
- async function checkForUpdates() {
57
- try {
58
- console.log(colors.cyan('šŸ” Checking for MAIASS updates...'));
59
-
60
- const https = require('https');
61
- const url = 'https://api.github.com/repos/vsmash/maiass/releases/latest';
62
-
63
- return new Promise((resolve, reject) => {
64
- const req = https.get(url, {
65
- headers: {
66
- 'User-Agent': 'MAIASS-CLI'
67
- }
68
- }, (res) => {
69
- let data = '';
70
- res.on('data', (chunk) => data += chunk);
71
- res.on('end', () => {
72
- try {
73
- const release = JSON.parse(data);
74
- const latestVersion = release.tag_name?.replace('v', '') || release.name;
75
-
76
- if (latestVersion && latestVersion !== MAIASS_VERSION) {
77
- console.log(colors.yellow(`šŸ“¦ Update available: ${MAIASS_VERSION} → ${latestVersion}`));
78
- console.log(colors.cyan('šŸŗ Update with: brew upgrade maiass'));
79
- console.log(colors.cyan('šŸ“– Or visit: https://github.com/vsmash/maiass/releases'));
80
- } else {
81
- console.log(colors.green('āœ… You have the latest version!'));
82
- }
83
- resolve(true);
84
- } catch (e) {
85
- console.log(colors.yellow('āš ļø Could not parse update information'));
86
- resolve(false);
87
- }
88
- });
89
- });
90
-
91
- req.on('error', (err) => {
92
- console.log(colors.yellow('āš ļø Could not check for updates (offline?)'));
93
- resolve(false);
94
- });
95
-
96
- req.setTimeout(5000, () => {
97
- req.destroy();
98
- console.log(colors.yellow('āš ļø Update check timed out'));
99
- resolve(false);
100
- });
101
- });
102
- } catch (error) {
103
- console.log(colors.yellow('āš ļø Could not check for updates'));
104
- return false;
105
- }
106
- }
107
-
108
- // Command routing
109
- async function main() {
110
- const command = firstArg || 'hello';
111
-
112
- switch (command) {
113
- case 'hello':
114
- console.log(colors.cyan('\nšŸš€ Hello from MAIASS!'));
115
- console.log(colors.bold(`Version: ${MAIASS_VERSION}`));
116
- console.log('\nThis is the bundled Node.js version with basic functionality.');
117
- console.log('For full features, see: https://github.com/vsmash/maiass');
118
-
119
- // Auto-check for updates
120
- console.log('');
121
- await checkForUpdates();
122
- break;
123
-
124
- case 'version':
125
- console.log(colors.bold(`MAIASS v${MAIASS_VERSION}`));
126
- console.log(`Node.js ${process.version}`);
127
- console.log(`Platform: ${process.platform} ${process.arch}`);
128
- break;
129
-
130
- case 'check-updates':
131
- await checkForUpdates();
132
- break;
133
-
134
- default:
135
- console.log(colors.red(`āŒ Unknown command: ${command}`));
136
- console.log(colors.cyan('Run `maiass --help` for available commands.'));
137
- console.log('\nNote: This bundled version has limited functionality.');
138
- console.log('For full MAIASS features, install from source:');
139
- console.log('https://github.com/vsmash/maiass');
140
- process.exit(1);
141
- }
142
- }
143
-
144
- // Run main function
145
- main().catch(error => {
146
- console.error(colors.red('āŒ Error:'), error.message);
147
- process.exit(1);
148
- });
package/maiass.cjs DELETED
@@ -1,34 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * CommonJS wrapper for maiass.mjs to ensure pkg compatibility
4
- * This file serves as an entry point that pkg can properly handle
5
- */
6
-
7
- // Import the ES module using dynamic import with detailed error handling
8
- (async () => {
9
- try {
10
- // Check if we're running in pkg environment
11
- const isPkg = typeof process.pkg !== 'undefined';
12
-
13
- if (isPkg) {
14
- // In pkg environment, try different import approaches
15
- console.log('Running in pkg environment, attempting ES module import...');
16
- }
17
-
18
- const module = await import('./maiass.mjs');
19
- // console.log('ES module imported successfully');
20
- } catch (error) {
21
- console.error('Error starting maiass:');
22
- console.error('Error type:', error.constructor.name);
23
- console.error('Error message:', error.message);
24
- console.error('Error stack:', error.stack);
25
-
26
- // Check if it's a specific pkg-related error
27
- if (error.message.includes('Invalid host defined options')) {
28
- console.error('\nThis appears to be a pkg/yargs compatibility issue.');
29
- console.error('Try running with Node.js directly: node maiass.cjs');
30
- }
31
-
32
- process.exit(1);
33
- }
34
- })();