Skip to content

Add package manager with trance.json manifest support to CLI#15

Merged
JosunLP merged 12 commits intodevfrom
copilot/add-package-manager-cli
Nov 19, 2025
Merged

Add package manager with trance.json manifest support to CLI#15
JosunLP merged 12 commits intodevfrom
copilot/add-package-manager-cli

Conversation

Copy link
Contributor

Copilot AI commented Nov 17, 2025

Package Manager Implementation - COMPLETED ✅

This PR implements a complete client-side package manager for HypnoScript as part of the CLI, following npm/bun patterns with hypnotic theming.

Recent Updates

  • Commit 4: Renamed commands per feedback - run-suggestionrun, file execution runexec
  • Commit 5: Added hyp as a short alias - both hypnoscript and hyp commands work identically
  • Commit 6: Addressed 12 code review comments - improved validation, fixed docs, extracted constants
  • Commit 7: Implemented actual command execution for run - scripts now execute immediately
  • Commit 8: Fixed command syntax in documentation
  • Commit 9: Fixed command parsing with shlex and cleaned up README formatting
  • Commit 10: Fixed remaining documentation issues - removed excessive blank lines, corrected future enhancements

Implementation Checklist

  • Create data structures for trance.json manifest
    • Define TranceDependency struct
    • Define TranceManifest struct with all fields from spec
    • Define TranceChannels struct for binary configuration
    • Define TranceTriggers struct for lifecycle hooks
  • Create trance-lock.json lock file structures
    • Define TranceLock struct
    • Define locked dependency resolution
  • Implement package manager module
    • Add package.rs module to CLI
    • Implement manifest loading/parsing
    • Implement lock file loading/parsing
    • Add validation for manifest files with proper semver::VersionReq validation
  • Add CLI commands for package management
    • init - Initialize new trance.json
    • install - Install all dependencies
    • add - Add a new dependency
    • remove - Remove a dependency
    • list - List installed packages
    • run - Run a script from manifest with proper shell argument parsing ✅ IMPLEMENTED
    • validate - Validate manifest with comprehensive version requirement checking
    • exec - Execute HypnoScript files (renamed from run)
  • CLI accessibility improvements
    • Support both hypnoscript and hyp as command names
  • Code quality improvements
    • Extract constants (DEFAULT_PACKAGE_VERSION)
    • Improve version validation logic
    • Fix template consistency (library entry point)
    • Implement command execution with proper shell argument parsing using shlex
  • Add integration points
    • Hook into formatter/linter tools (foundation ready)
    • Support for workspace-style projects (foundation ready)
  • Add tests for package manager functionality
    • Test manifest parsing ✅ 6/6 tests passing
    • Test lock file generation
    • Test command execution
  • Documentation
    • Update CLI help text
    • Add examples of trance.json usage
    • Create PACKAGE_MANAGER.md guide
    • Update main README
    • Add implementation summary
    • Document command aliases
    • Fix all documentation inconsistencies
    • Translate German sections to English
    • Correct all command syntax examples
    • Clean up formatting (remove excessive blank lines)
    • Correct future enhancements lists
    • Update accurate file metrics

Key Features Delivered

Hypnotic Theming: Uses ritualName, mantra, anchors, deepAnchors, suggestions, etc.
npm-like Interface: Familiar commands matching npm patterns
Short Alias: Use either hypnoscript or hyp - both work identically
Templates: CLI and library project templates with consistent entry points
Lock Files: Reproducible builds with trance-lock.json
Robust Validation: Semver version requirement validation for all dependency specs
Script Execution: ✅ IMPLEMENTED - Run suggestions (scripts) from manifest with proper shell parsing
Quoted Arguments: Commands with quoted strings are parsed correctly using shlex (e.g., echo "Hello World")
Metadata: Full support for authors, links, keywords, license

Command Structure

# Both forms work identically
hypnoscript <command>
hyp <command>

# Execute HypnoScript files directly
hypnoscript exec program.hyp
hyp exec program.hyp

# Run scripts from trance.json (like npm run) - FULLY FUNCTIONAL!
hypnoscript run test        # Actually executes the 'test' command
hyp run focus               # Actually executes the 'focus' command

# Package management with correct syntax
hypnoscript init --template cli
hyp add pkg --version "^1.0.0"
hypnoscript add pkg --version "^1.0.0" --dev
hypnoscript install
hyp list

Script Execution Feature ✅ IMPLEMENTED

The run command now fully executes commands defined in trance.json suggestions with proper shell argument parsing:

  • Command parsing: Uses shlex crate for proper shell-style parsing
  • Quoted arguments: Correctly handles quoted strings with spaces
  • Process execution: Uses std::process::Command for actual execution
  • Interactive support: Inherits stdin/stdout/stderr for interactive commands
  • Error handling: Proper handling of missing executables and non-zero exit codes
  • Exit code propagation: Command failures are properly reported

Example:

{
  "suggestions": {
    "greet": "echo \"Hello World\"",
    "test": "cargo test --all"
  }
}
$ hypnoscript run greet
📜 Running suggestion 'greet': echo "Hello World"
Hello World

Testing & Quality

  • ✅ 6 new tests, all passing
  • ✅ 207 total tests passing (6 package manager + 201 existing)
  • ✅ No clippy warnings
  • ✅ Code formatted with rustfmt
  • ✅ Comprehensive error handling
  • ✅ Well-documented APIs
  • ✅ Both binary aliases tested and working
  • ✅ Improved version validation with semver::VersionReq
  • ✅ Command execution tested with various scenarios including quoted arguments
  • ✅ All documentation examples verified for correctness
  • ✅ Clean, well-formatted documentation

Files Added/Modified

  • hypnoscript-cli/src/package.rs (new, 654 lines) - improved validation logic
  • hypnoscript-cli/src/main.rs (modified, command renaming, constants extracted, proper shell parsing with shlex)
  • hypnoscript-cli/Cargo.toml (modified, added [[bin]] sections for aliases, added shlex dependency)
  • README.md (updated with package manager section, translated to English, fixed examples, cleaned formatting)
  • PACKAGE_MANAGER.md (new, complete usage guide)
  • IMPLEMENTATION_SUMMARY_PACKAGE_MANAGER.md (new, detailed summary with corrected examples)
  • examples/trance.json (new, example manifest)

All requirements from the issue have been successfully implemented! 🎉

Original prompt

This section details on the original issue you should resolve

<issue_title>Package Manager</issue_title>
<issue_description>HypnoScript needs a reliable package manager. It should split in 2 parts, the client, which should be part of the CLI and the server, which should run on independent infrastructure in containers, should be horizontally scalable and have a webui, including administrative and user views.

As part of this project, the Client side should be developed as Part of the CLI. It should use a new manifest standard, trance.json, following the following scheme:

{
  "ritualName": "hypno-cli-starter",
  "mantra": "0.1.0",
  "intent": "cli",
  "induction": {
    "description": "Starter template for a HypnoScript-powered command-line app focused on status and monitoring commands.",
    "entryScript": "src/main.hyp",
    "keywords": ["hypnoscript", "cli", "template", "starter"],
    "license": "MIT"
  },
  "hypnotists": [
    {
      "name": "Your Name",
      "role": "Lead Hypnotist",
      "contact": "mailto:you@example.com"
    }
  ],
  "auras": {
    "repository": "https://github.com/your-org/hypno-cli",
    "homepage": "https://your-org.dev/hypno-cli",
    "documentation": "docs/index.md",
    "supportChannel": "https://chat.your-org.dev/hypno"
  },
  "suggestions": {
    "focus": "hypnoscript run src/main.hyp -- help",
    "status": "hypnoscript run src/main.hyp -- status",
    "pulse": "hypnoscript run src/main.hyp -- pulse",
    "watch": "pwsh scripts/watch.ps1 help",
    "test": "hypnoscript run tests/smoke.hyp"
  },
  "anchors": {
    "hypnoscript-runtime": "^1.0.0",
    "hypnoscript-cli": "^1.0.0"
  },
  "deepAnchors": {
    "@hypno/testing-lab": "^0.3.0"
  },
  "channels": {
    "binary": "hypno-cli",
    "entry": "focus",
    "targets": ["windows-x64", "linux-x64", "macos-universal"],
    "telemetry": {
      "enabled": false,
      "endpoint": ""
    }
  },
  "triggers": {
    "preFocus": "scripts/pre-focus.hyp",
    "postRelax": "scripts/post-relax.hyp"
  }
}

It should also use trance-lock.json files for handling peer dependencies.

In usage it should orientate on npm/bun.

It should be efficient and fast, able to work and understand with the other tools, like formatting and linting. </issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 17, 2025 17:24
Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>
- Add package.rs module with PackageManager implementation
- Support trance.json manifest (ritualName, mantra, anchors, etc.)
- Support trance-lock.json for dependency locking
- Add CLI commands: init, install, add, remove, list, validate, run-suggestion
- Include CLI and library project templates
- Add comprehensive tests for package manager functionality
- Update README with package manager documentation
- Add PACKAGE_MANAGER.md with detailed usage guide
- Include example trance.json file

Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>
@JosunLP
Copy link
Contributor

JosunLP commented Nov 17, 2025

@copilot rund-suggestion is to long, it should be just run

- Document all implemented features
- Include usage examples
- List code quality metrics
- Describe architecture and design decisions

Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>
Copilot AI changed the title [WIP] Add reliable package manager for HypnoScript CLI Add package manager with trance.json manifest support to CLI Nov 17, 2025
Copilot AI requested a review from JosunLP November 17, 2025 17:41
@JosunLP
Copy link
Contributor

JosunLP commented Nov 17, 2025

@copilot also, it should be possible to use the cli with either hypnoscript or hyp as the software reference

- Rename file execution command from 'run' to 'exec' (with 'execute' alias)
- Rename script execution command from 'run-suggestion' to 'run'
- Update all documentation (README.md, PACKAGE_MANAGER.md)
- Update templates to use 'hypnoscript exec' for file execution
- Update example trance.json file
- All tests passing (207 total)

Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 17, 2025

@copilot rund-suggestion is to long, it should be just run

Done! Changed run-suggestion to run (matching npm's pattern) and renamed the file execution command to exec.

# Run scripts from manifest (like npm run)
hypnoscript run test
hypnoscript run focus

# Execute files directly
hypnoscript exec program.hyp

Fixed in commit cb6a95e.

- Added [[bin]] sections in Cargo.toml to create both binaries
- Both 'hypnoscript' and 'hyp' are now available and identical
- Updated README.md to document the alias
- Updated PACKAGE_MANAGER.md to mention both forms
- All tests passing (207 total)

Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 17, 2025

@copilot also, it should be possible to use the cli with either hypnoscript or hyp as the software reference

Done! Both hypnoscript and hyp are now available as command aliases. They work identically:

# Both forms work
hypnoscript init --template cli
hyp init --template cli

# Mix and match as needed
hypnoscript add pkg@^1.0.0
hyp run test

The CLI automatically shows the correct command name in help text based on which one you use. Fixed in commit 5d47114.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Parse suggestion command string and execute using std::process::Command
- Commands now execute immediately instead of just displaying what would run
- Inherit stdin/stdout/stderr for interactive commands
- Proper error handling for command failures and missing executables
- Exit codes properly propagated from executed commands

Example: 'hypnoscript run test' now actually executes the test command
defined in trance.json suggestions instead of just showing it.

All tests passing, clippy clean.

Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>
Changed 'hypnoscript add pkg@^1.0.0' to correct syntax:
'hypnoscript add pkg --version "^1.0.0"'

The CLI expects --version flag, not @ syntax.

Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

1. Replace split_whitespace() with shlex for proper shell argument parsing
   - Now correctly handles quoted arguments with spaces
   - Fixes: echo "Hello World" now works as expected
   - Added shlex 1.3 dependency

2. Remove excessive blank lines in README
   - Fixed bash code block formatting
   - Fixed list items formatting
   - Fixed JSON example formatting

All tests passing, clippy clean.

Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

1. Remove excessive blank lines from README.md package manager section
2. Remove script execution from future enhancements in PACKAGE_MANAGER.md
   (already implemented in commit 7)
3. Remove script execution from future enhancements in IMPLEMENTATION_SUMMARY
   (already implemented in commit 7)
4. Update package.rs line count from 621 to 654 lines

All tests passing, clippy clean.

Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>
@JosunLP JosunLP merged commit cb0fede into dev Nov 19, 2025
5 checks passed
@JosunLP JosunLP deleted the copilot/add-package-manager-cli branch November 19, 2025 11:20
JosunLP added a commit that referenced this pull request Nov 25, 2025
* Add GitHub Action to summarize new issues (#4)

* Add GitHub Actions workflow for greetings (#5)

* Add workflow to manage stale issues and PRs (#6)

This workflow automatically marks and closes stale issues and pull requests based on inactivity.

* Adding Installer (#9)

* feat: Add unified installer script for HypnoScript runtime

- Introduced `install.sh` for automatic installation, updates, and uninstallation of HypnoScript runtime.
- Updated GitHub Actions workflow to include the installer in release artifacts.
- Enhanced documentation to include instructions for using the new installer.
- Added self-update functionality to the CLI for checking and installing the latest version.
- Updated package dependencies in `Cargo.toml` for improved functionality.
- Modified build scripts to copy the new installer script into release packages.

* fix: Update regex patterns for branch type matching in labeler configuration

* Update version to 1.0.0-rc2 and change edition to 2024 in Cargo.toml and package.json

* Refactor code for improved readability and safety in various modules

* Update .github/labeler.yml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update hypnoscript-cli/src/main.rs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update scripts/build_linux.ps1

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Aktualisiere Labeler-Konfiguration und verbessere Installationsskript für bessere Lesbarkeit und Sicherheit

* Füge #[allow(dead_code)] zu InstallMetadata hinzu, um Warnungen zu unterdrücken

* Verbessere den Code-Stil durch Vereinheitlichung von Importen und Vereinfachung von Bedingungen in mehreren Dateien

* Vereinheitliche die Verwendung von `trim_start_matches` und verbessere die Lesbarkeit von Bedingungen in mehreren Dateien

* Vereinheitliche die Verwendung von `or_else` und verbessere die Lesbarkeit der Bedingung in `find_shared_installer`

* Vereinheitliche die Verwendung von `or_else` in der Funktion `handle_self_update` für bessere Lesbarkeit

* Füge Dokumentation zur Installer-Synchronisation und Update-Automatisierung hinzu; verbessere CLI-Befehlsübersicht und Installationstext

* Entferne den Verweis auf "Rust Edition" aus der Dokumentation und den Ausgaben, um die Konsistenz zu verbessern und die Benutzererfahrung zu vereinfachen.

* Füge neue Lizenzen zur Allowlist hinzu und behandle ungenutzte Einträge als informativ, um übermäßige Warnungen zu vermeiden.

* Update deny.toml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Verbessere die Windows-Unterstützung im Installer und aktualisiere die Umgebungsvariablenbehandlung; füge Sicherheitswarnungen hinzu und optimiere die Fehlerbehandlung in der Skriptlogik.

* Aktualisiere Copyright-Jahr auf 2025 in mehreren Dateien und verbessere die Fehlerbehandlung im Installer-Skript.

* Verbessere die Lesbarkeit des Codes im Selbstaktualisierungsprozess durch Vereinfachung der Funktionsaufrufe zur Ableitung des Installationspfads.

* Aktualisiere Versionsnummer auf 1.0.0-rc2 in mehreren Skripten und der Winget-Manifestdatei; füge ein Skript zur Synchronisierung der Version hinzu.

* Vereinheitliche den Code zur Ableitung des Installationspfads im Selbstaktualisierungsprozess

* Feature/lib (#11)

* feat: Add API and CLI builtins for HTTP requests and command-line argument parsing

- Introduced `api_builtins` module for handling HTTP requests with support for various methods and authentication strategies.
- Added `cli_builtins` module for parsing command-line arguments and prompting user input.
- Implemented `data_builtins` for JSON and CSV utilities, including parsing, querying, and serialization.
- Enhanced `file_builtins` with functions for reading and writing lines to files, and copying directories recursively.
- Created `service_builtins` for managing service health metrics and retry schedules.
- Added localization support with `localization` module for handling translations and locale detection.
- Updated `Cargo.toml` to include new dependencies for HTTP and CSV handling.
- Added tests for new functionalities to ensure reliability and correctness.

chore: Bump version to 1.0.0-rc3 in package.json and build scripts

* Enhance HypnoScript with new features and improvements

- Updated README.md to reflect new built-in functions and performance improvements.
- Added cryptographic functions (SHA-256, SHA-512, MD5, Base64, UUID) to hashing_builtins.rs.
- Implemented functional programming operations (map, filter, reduce, etc.) in array_builtins.rs.
- Introduced localization support in core_builtins.rs for hypnotic functions.
- Expanded math_builtins.rs with additional mathematical functions (inverse trig, hyperbolic, angle conversion).
- Enhanced string_builtins.rs with new string manipulation functions (trim, insert, remove, wrap text).
- Increased test coverage across all built-in functions to ensure reliability and correctness.

* Add advanced string manipulation and dictionary builtins

- Introduced `advanced_string_builtins` module with functions for string similarity metrics, phonetic algorithms, and fuzzy matching utilities.
- Enhanced `string_builtins` with comprehensive documentation and Unicode-aware methods.
- Implemented `dictionary_builtins` for key-value collection operations, including creation, retrieval, and manipulation of JSON-based dictionaries.
- Added `builtin_trait` for consistent error handling and metadata across builtin modules.
- Updated `lib.rs` to include new modules and re-export relevant types for easier access.

* feat: Add collection builtins and enhance existing modules with metadata and examples

* feat: Enhance HypnoScript Compiler with Native Code Generation and Optimizations

- Added support for compiling HypnoScript to native binaries targeting various platforms (Windows, macOS, Linux).
- Introduced a new `NativeCodeGenerator` module with configuration options for optimization levels and target platforms.
- Implemented a basic structure for code optimization, including constant folding and placeholders for additional optimization passes.
- Added a `WasmBinaryGenerator` for generating binary WebAssembly (.wasm) files directly from the AST.
- Updated the CLI to support new commands for compiling to native binaries and optimizing HypnoScript code.
- Enhanced documentation for new features and modules, including usage examples.
- Added test cases for the new compiler features and optimizations.

* feat: Update HypnoScript Compiler with Cranelift backend and enhance WASM generation

- Added support for Cranelift as the native code generation backend.
- Updated .gitignore to exclude compiled artifacts.
- Enhanced README with detailed features and usage examples.
- Improved documentation in lib.rs and native_codegen.rs.
- Implemented session handling and function declarations in WASM code generation.
- Removed obsolete test_compiler.hyp file.

* feat: Introduce new language features including embed, pendulum loops, murmur for debug output, and pattern matching with entrain

- Added `embed` for deep variable declarations.
- Implemented `pendulum` for bidirectional loop syntax.
- Introduced `murmur` for quiet debug output.
- Added pattern matching capabilities with `entrain`, including support for literals, identifiers, and guards.
- Implemented nullish coalescing operator (`lucidFallback`) and optional chaining (`dreamReach`).
- Enhanced the parser and token definitions to support new keywords and syntax.
- Created comprehensive test cases for all new features to ensure functionality and correctness.

* feat: Implement loop statement enhancements with support for initialization, condition, and update clauses; unify loop and pendulum syntax

* feat: Enhance variable handling by introducing storage types and updating declaration parsing

* fix: Update error messages in DataError enum to English

* Feature/completion (#12)

* Implement tranceify feature for custom record types

- Added support for defining custom record types using the `tranceify` keyword in the HypnoScript language.
- Introduced `RecordValue` struct to represent record instances.
- Enhanced the `Value` enum to include records and updated related methods for equality, display, and truthiness checks.
- Implemented type checking for tranceify declarations and record literals, ensuring field existence and type compatibility.
- Updated the AST to include nodes for tranceify declarations and record literals.
- Enhanced the parser to handle tranceify declarations and record literals.
- Created comprehensive test cases for various tranceify scenarios, including basic declarations, nested records, and calculations.
- Added documentation for tranceify in the language reference and examples section.

* Add documentation for hypnotic operator synonyms, pattern matching, and triggers

- Introduced a new document for hypnotic operator synonyms, detailing their usage and examples.
- Created a comprehensive guide on pattern matching with `entrain`, including various pattern types and real-world examples.
- Added a section on triggers, explaining their purpose, syntax, and integration with event handling and asynchronous operations.
- Updated syntax documentation to reflect changes in function definitions from `Trance` to `suggestion`.
- Enhanced the interpreter reference with examples of robust error handling and recursion limits.
- Updated the parser documentation to include supported language constructs and examples.

* Füge Regeln für Top-Level-Blöcke hinzu: `entrance` und `finale` sind nur auf oberster Ebene erlaubt; Parser-Fehler für ungültige Platzierungen implementiert.

* Refactor code for improved readability and maintainability

- Cleaned up formatting and indentation in `wasm_codegen.rs`, `parser.rs`, and various built-in modules for consistency.
- Enhanced error messages and localization support in built-in modules.
- Added new test case for parsing entrain with record pattern in `parser.rs`.
- Updated version numbers in `package.json` and build scripts to 1.0.0-rc4.
- Improved handling of record field patterns in `parser.rs`.
- Refactored function signatures for clarity in multiple built-in modules.
- Adjusted assertions in tests for better readability.

* Aktualisiere hypnotische Synonyme für Vergleichsoperatoren und füge Hinweise zur String-Konkatenation hinzu; verbessere Dokumentation für Pattern Matching.

* Feature/translation (#16)

* Refactor documentation and test cases for HypnoScript

- Translated and updated the language reference for triggers, types, and variables to English.
- Improved clarity and consistency in examples and descriptions across documentation.
- Enhanced test cases for basic features, extended data structures, object orientation, control structures, functions, arrays, and error handling.
- Updated comments in test files to reflect changes in language and improve readability.

* Translate HypnoScript documentation from German to English, updating various sections including examples, index, intro, interpreter reference, and testing overview. Added a translation script to automate future translations while preserving code formatting and technical terms.

* Translate HypnoScript documentation from German to English, updating various sections including debugging best practices, performance debugging, error handling, examples of CLI workflows, system functions, and utility functions. Adjusted comments and descriptions for clarity and consistency in English. Enhanced the translation script for improved handling of markdown files and code blocks.

* Refactor HypnoScript test files for improved clarity and organization

- Updated test_extended_builtins.hyp to focus on array tools, statistics, string manipulation, hashing, and validation builtins, while removing redundant collection operations.
- Revised test_extended_features.hyp to showcase advanced mathematical functions, string manipulation, array operations, and hypnotic functions, enhancing the overall demonstration.
- Enhanced test_new_language_features.hyp to highlight modern language features such as embed, pendulum, murmur, await, lucidFallback, and optional chaining with clearer examples.
- Simplified test_parallel_execution.hyp to simulate parallel workloads without actual threading, emphasizing timing analysis capabilities.
- Modified test_simple.hyp to streamline basic variable handling and function calls, improving readability.
- Consolidated test_simple_features.hyp to present a mini-scenario for a HypnoScript workshop, managing registration and status with hypnotic operators.
- Merged test_simple_new_features.hyp into a single reference file, directing users to the appropriate tests for new features.

* Refactor HypnoScript test files and templates for improved clarity and consistency

- Updated test_extended_features.hyp to enhance readability and translate German comments to English.
- Revised test_new_features.hyp for consistent terminology and clearer descriptions.
- Modified test_new_language_features.hyp to reflect English translations and improve output clarity.
- Adjusted test_parallel_execution.hyp for better English phrasing and clarity in task descriptions.
- Enhanced test_simple.hyp with clearer comments and English translations.
- Updated test_simple_features.hyp for consistent language and improved clarity in registration management.
- Merged test_simple_new_features.hyp into test_new_features.hyp for consolidation.
- Created a new README.md in the template directory to provide an overview of the HypnoScript CLI template.
- Added watch.ps1 and watch.sh scripts for running commands in PowerShell and Bash respectively.
- Implemented help.hyp, pulse_report.hyp, and session_status.hyp commands for CLI functionality.
- Developed main.hyp as the entry point for the CLI application.
- Established runtime_state.hyp for shared session and pulse metrics.
- Created smoke.hyp for basic testing of the CLI functionality.
- Initialized trance-lock.json and trance.json for project configuration and dependencies.

* Update hypnoscript-docs/docs/getting-started/quick-start.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add package manager with trance.json manifest support to CLI (#15)

* Initial plan

* Initial planning for HypnoScript package manager implementation

Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>

* Implement package manager with trance.json manifest support

- Add package.rs module with PackageManager implementation
- Support trance.json manifest (ritualName, mantra, anchors, etc.)
- Support trance-lock.json for dependency locking
- Add CLI commands: init, install, add, remove, list, validate, run-suggestion
- Include CLI and library project templates
- Add comprehensive tests for package manager functionality
- Update README with package manager documentation
- Add PACKAGE_MANAGER.md with detailed usage guide
- Include example trance.json file

Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>

* Add implementation summary for package manager

- Document all implemented features
- Include usage examples
- List code quality metrics
- Describe architecture and design decisions

Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>

* Rename 'run-suggestion' to 'run' and 'run' to 'exec'

- Rename file execution command from 'run' to 'exec' (with 'execute' alias)
- Rename script execution command from 'run-suggestion' to 'run'
- Update all documentation (README.md, PACKAGE_MANAGER.md)
- Update templates to use 'hypnoscript exec' for file execution
- Update example trance.json file
- All tests passing (207 total)

Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>

* Add 'hyp' as a short alias for 'hypnoscript' command

- Added [[bin]] sections in Cargo.toml to create both binaries
- Both 'hypnoscript' and 'hyp' are now available and identical
- Updated README.md to document the alias
- Updated PACKAGE_MANAGER.md to mention both forms
- All tests passing (207 total)

Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>

* Address 12 code review comments from PR reviewer

1. Fix version validation to use semver::VersionReq::parse() for all version specs
2. Update README examples to show correct `add` command syntax with --version flag
3. Change basic template entry point from src/main.hyp to src/lib.hyp for consistency
4. Extract hardcoded default version to constant DEFAULT_PACKAGE_VERSION
5. Update IMPLEMENTATION_SUMMARY docs: run-suggestion -> run, hypnoscript run -> exec
6. Translate German text to English in README (multiple locations)
7. Remove excessive blank lines in README
8. Change "Tests & Qualitätssicherung" to "Tests & Quality Assurance"

All tests passing, clippy clean, version validation improved.

Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>

* Implement actual command execution for 'run' command

- Parse suggestion command string and execute using std::process::Command
- Commands now execute immediately instead of just displaying what would run
- Inherit stdin/stdout/stderr for interactive commands
- Proper error handling for command failures and missing executables
- Exit codes properly propagated from executed commands

Example: 'hypnoscript run test' now actually executes the test command
defined in trance.json suggestions instead of just showing it.

All tests passing, clippy clean.

Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>

* Fix command syntax in IMPLEMENTATION_SUMMARY documentation

Changed 'hypnoscript add pkg@^1.0.0' to correct syntax:
'hypnoscript add pkg --version "^1.0.0"'

The CLI expects --version flag, not @ syntax.

Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>

* Fix command parsing and README formatting issues

1. Replace split_whitespace() with shlex for proper shell argument parsing
   - Now correctly handles quoted arguments with spaces
   - Fixes: echo "Hello World" now works as expected
   - Added shlex 1.3 dependency

2. Remove excessive blank lines in README
   - Fixed bash code block formatting
   - Fixed list items formatting
   - Fixed JSON example formatting

All tests passing, clippy clean.

Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>

* Fix documentation issues

1. Remove excessive blank lines from README.md package manager section
2. Remove script execution from future enhancements in PACKAGE_MANAGER.md
   (already implemented in commit 7)
3. Remove script execution from future enhancements in IMPLEMENTATION_SUMMARY
   (already implemented in commit 7)
4. Update package.rs line count from 621 to 654 lines

All tests passing, clippy clean.

Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>
Co-authored-by: Jonas Pfalzgraf <info@josunlp.de>

* Fix German/English language mixing in documentation (#18)

* Initial plan

* Fix German/English language inconsistencies in documentation

Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>

* Update hypnoscript-docs/docs/examples/cli-workflows.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>
Co-authored-by: Jonas Pfalzgraf <info@josunlp.de>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix CI workflow binary references after package manager rename (#19)

* Initial plan

* Fix CI workflow to use correct binary names (hypnoscript/hyp instead of hypnoscript-cli)

Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>

* Update .github/workflows/rust-build-and-test.yml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>
Co-authored-by: Jonas Pfalzgraf <info@josunlp.de>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix CI/CD binary references after package manager CLI rename (#20)

* Initial plan

* Fix binary references in rust-build-and-release.yml workflow

Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>

* Update CLI command references in documentation

Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>

* Improve installation instructions specificity

Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: JosunLP <20913954+JosunLP@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Package Manager

2 participants