Skip to content

feat(moshscript): complete moshscript implementation (PRD 0004) - #18

Merged
ralyodio merged 1 commit into
mainfrom
feat/moshscript-implementation
Jul 13, 2026
Merged

feat(moshscript): complete moshscript implementation (PRD 0004)#18
ralyodio merged 1 commit into
mainfrom
feat/moshscript-implementation

Conversation

@Preshy

@Preshy Preshy commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Completes the moshscript implementation per PRD 0004.

Closes #16

Changes

File Change PRD Req
bin/moshscript.mjs New — thin shebang-ready executable that forwards to moshcode run. Enables #!/usr/bin/env moshscript in .mosh files R14
package.json Added "moshscript" to the bin map so npm link/npm install -g wires it onto PATH R14
install.sh Creates a moshscript shell wrapper alongside moshcode during install; cleans it up on remove R14
bin/moshcode.mjs Rewrote help() to show the full vocabulary (local + CLI verbs), document JS-legality, shebang support, --dry-run, and ask()/notify() R10
src/tui.mjs Updated /help to show the full moshscript vocabulary, JS-legal note, and shebang line R10
README.md Rewrote the moshscript section: JS-legal, full command tables (local + CLI + specials), shebang, dry-run, human-in-the-loop, extensibility, env vars R10
test/cli.test.mjs Added 17 new tests: verb→argv mapping for all 15 CLI verbs, result shape verification, and an end-to-end dry-run through runScript() R12
prd/0004-...md Updated status from Draft to Accepted

PRD requirement coverage

Req Status Notes
R1-R9 Already done Core JS runtime, vocabulary, --max, CLI shell-out, --dry-run, error handling, extensible registry
R10 Done moshcode commands, help, TUI /help, and README all reflect the full JS-legal vocabulary
R11 Already done Old grammar is a JS subset; alive.mosh runs unchanged
R12 Done 17 pure unit tests for verb→argv mapping (no real spawns)
R13 Already done await, argv, env all work
R14 Done moshscript executable, package.json bin map, install.sh wrapper
R15 Already done notify() + ask() with approval polling
R16 Already done run() composes scripts

Tests

99 pass / 2 fail (pre-existing macOS /private/var symlink issue in tool passthrough tests, unrelated to moshscript)

…#16)

- Add bin/moshscript.mjs shebang-ready executable (R14)
- Add 'moshscript' to package.json bin map (R14)
- Update install.sh to create/remove moshscript wrapper (R14)
- Update help() with full vocabulary + JS-legal docs (R10)
- Update TUI /help with moshscript vocab + shebang info (R10)
- Rewrite README moshscript section: commands, dry-run, shebang, ask/notify (R10)
- Add 17 unit tests for verb→argv dry-run mapping (R12)
- Update PRD 0004 status to Accepted
@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio merged commit 3d271d0 into main Jul 13, 2026
1 check passed
@ralyodio
ralyodio deleted the feat/moshscript-implementation branch July 13, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

implement moshscript

2 participants