-
Notifications
You must be signed in to change notification settings - Fork 283
feat: add cli.trigger event type and maestro-cli cue trigger command #786
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
ce6bfe4
feat: add cli.trigger event type and maestro-cli cue trigger command
chr1syy b7d37f4
fix: address CodeRabbit and Greptile review feedback
chr1syy 4211694
merge: resolve conflicts with upstream/main
chr1syy 42b4e58
fix: address remaining CodeRabbit review feedback
chr1syy a4c3b3a
merge: resolve conflicts with upstream/rc
chr1syy fe74cee
fix: add missing import and exhaustive case for cli.trigger
chr1syy 6ff28a9
fix: restore upstream/rc versions of files with merge resolution errors
chr1syy 2461237
fix: restore full upstream/rc WebServer.ts with assets check fix
chr1syy a738daa
fix: add setTriggerCueSubscriptionCallback to WebServer
chr1syy 567f180
fix(test): update DEFAULT_TRIGGER_LABELS test for cli.trigger event type
chr1syy 664ad2d
test: add cue trigger mocks to useRemoteIntegration test
chr1syy 2626913
fix(test): update tests for cli.trigger event type
chr1syy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| // Cue trigger command - manually trigger a Cue subscription by name | ||
|
|
||
| import { withMaestroClient } from '../services/maestro-client'; | ||
|
|
||
| interface CueTriggerOptions { | ||
| prompt?: string; | ||
| json?: boolean; | ||
| } | ||
|
|
||
| export async function cueTrigger( | ||
| subscriptionName: string, | ||
| options: CueTriggerOptions | ||
| ): Promise<void> { | ||
| try { | ||
| const result = await withMaestroClient(async (client) => { | ||
| return client.sendCommand<{ | ||
| type: string; | ||
| success: boolean; | ||
| subscriptionName: string; | ||
| error?: string; | ||
| }>( | ||
| { | ||
| type: 'trigger_cue_subscription', | ||
| subscriptionName, | ||
| prompt: options.prompt, | ||
| }, | ||
| 'trigger_cue_subscription_result' | ||
| ); | ||
| }); | ||
|
|
||
| if (options.json) { | ||
| console.log( | ||
| JSON.stringify({ | ||
| type: 'trigger_result', | ||
| success: result.success, | ||
| subscriptionName, | ||
| ...(options.prompt !== undefined ? { prompt: options.prompt } : {}), | ||
| ...(result.error ? { error: result.error } : {}), | ||
| }) | ||
| ); | ||
| if (!result.success) { | ||
| process.exitCode = 1; | ||
| } | ||
| } else if (result.success) { | ||
| console.log( | ||
| `Triggered Cue subscription "${subscriptionName}"${options.prompt ? ' with custom prompt' : ''}` | ||
| ); | ||
| } else { | ||
| console.error( | ||
| `Subscription "${subscriptionName}" not found or could not be triggered${ | ||
| result.error ? `: ${result.error}` : '' | ||
| }` | ||
| ); | ||
| process.exit(1); | ||
| } | ||
chr1syy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } catch (error) { | ||
| if (options.json) { | ||
| console.log( | ||
| JSON.stringify({ | ||
| type: 'error', | ||
| error: error instanceof Error ? error.message : String(error), | ||
| }) | ||
| ); | ||
| } else { | ||
| console.error(`Error: ${error instanceof Error ? error.message : String(error)}`); | ||
| } | ||
| process.exit(1); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.