-
Notifications
You must be signed in to change notification settings - Fork 11
🤖 feat: add workspace scripts with discovery and execution #510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
9af9019 to
c2479be
Compare
💡 Codex ReviewLines 929 to 1016 in 9af9019
The script IPC handler writes ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
c2479be to
3b400d6
Compare
|
@codex addressed that feedback by provisioning CMUX_OUTPUT/CMUX_PROMPT via runtime temp directories and adding runtimeScriptExecution integration test. |
|
To use Codex here, create an environment for this repo. |
|
@codex address that feedback |
|
To use Codex here, create an environment for this repo. |
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const listResult = await execBuffered( | ||
| runtime, | ||
| `find "${scriptsDir}" -maxdepth 1 -type f -printf '%f\\n' 2>/dev/null | sort || true`, | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace GNU-only find usage when listing scripts
listScripts calls find "${scriptsDir}" -printf '%f' to enumerate .cmux/scripts. The -printf flag only exists in GNU find; the BSD find shipped with macOS errors and returns no filenames, so script discovery and slash-command suggestions will be empty for Mac developers even when scripts exist. Use a portable approach (e.g., find ... -print combined with basename, or perform the traversal via the Runtime API) so discovery works across platforms.
Useful? React with 👍 / 👎.
| // allowedHosts: devServerHost === "0.0.0.0" ? undefined : ["localhost", "127.0.0.1"], | ||
| allowedHosts: ["coderbook-pro.manakin-ray.ts.net"], | ||
| sourcemapIgnoreList: () => false, // Show all sources in DevTools |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dev server host check blocks localhost connections
vite.config.ts now hardcodes server.allowedHosts to ["coderbook-pro.manakin-ray.ts.net"] and removes the previous localhost list. Running the dev server on a typical machine will produce “Invalid Host header” for localhost or 127.0.0.1, making local development impossible unless the browser connects through that single domain. Keep the loopback hosts in the list (or restore the prior conditional) while adding the extra host so local dev remains usable.
Useful? React with 👍 / 👎.
Add complete workspace scripts feature with runtime-aware discovery, execution, and auto-completion for both local and SSH workspaces. **Script Discovery:** - New listScripts() function uses Runtime interface instead of local fs - Works with both local and SSH workspaces via execBuffered() - Extracts descriptions from # Description: or # @description comments - Adds WORKSPACE_LIST_SCRIPTS IPC handler - Includes unit tests with mocked runtime **Script Execution:** - New /script and /s slash commands with tab completion - WORKSPACE_EXECUTE_SCRIPT IPC handler using bash tool - Runtime-aware script existence checking via runtime.stat() - Scripts run in workspace directory with project secrets - 5-minute default timeout **Environment Variables:** - CMUX_OUTPUT: Write markdown for custom toast display - CMUX_PROMPT: Send follow-up message to agent after script runs **UI/UX:** - Script execution shows toast with exit code - Custom toast content from CMUX_OUTPUT (10KB limit) - Auto-send CMUX_PROMPT content as user message (100KB limit) - Command palette integration for script selection - Tab completion in chat input **Documentation:** - Add docs/scripts.md with usage examples - Demo scripts in .cmux/scripts/ - Storybook story for script execution flow Generated with cmux Change-Id: I301cff2ec5551b4b1a08d41be84c363dfbf13f72 Signed-off-by: Test <test@example.com>
3b400d6 to
4b13904
Compare
Add complete workspace scripts feature with runtime-aware discovery, execution, and auto-completion for both local and SSH workspaces.
Script Discovery
listScripts()function uses Runtime interface instead of local fsexecBuffered()# Description:or# @descriptioncommentsWORKSPACE_LIST_SCRIPTSIPC handlerScript Execution
/scriptand/sslash commands with tab completionWORKSPACE_EXECUTE_SCRIPTIPC handler using bash toolruntime.stat()Environment Variables
CMUX_OUTPUT: Write markdown for custom toast displayCMUX_PROMPT: Send follow-up message to agent after script runsUI/UX
CMUX_OUTPUT(10KB limit)CMUX_PROMPTcontent as user message (100KB limit)Documentation
docs/scripts.mdwith usage examples.cmux/scripts/Generated with
cmux