-
Notifications
You must be signed in to change notification settings - Fork 28
Add warp plugin to plugin marketplace #137
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
7 commits
Select commit
Hold shift + click to select a range
d0345cb
Add warp plugin to plugin marketplace
augmentmoogi 61291f2
Add warp plugin entry to marketplace manifest
augmentmoogi ef1c41a
Fix warp plugin homepage URL to point to correct repo
augmentmoogi 3b9e7bc
Use documented conversation fields in Stop hook
augmentmoogi de1c2e9
Update warp plugin author to Augment Code
augmentmoogi 41aa697
Update warp plugin homepage to augmentcode/auggie
augmentmoogi b9fe19f
Point warp plugin homepage to its subfolder in the repo
augmentmoogi 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "name": "warp", | ||
| "description": "Warp terminal integration for Auggie - native notifications, and more to come", | ||
| "version": "2.0.0", | ||
| "author": { | ||
| "name": "Augment Code", | ||
| "url": "https://www.augmentcode.com" | ||
| }, | ||
| "homepage": "https://github.com/augmentcode/auggie/tree/main/plugin_marketplace/warp" | ||
| } |
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,70 @@ | ||
| { | ||
| "description": "Warp terminal notifications", | ||
| "hooks": { | ||
| "SessionStart": [ | ||
| { | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "${AUGMENT_PLUGIN_ROOT}/scripts/on-session-start.sh" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "Stop": [ | ||
| { | ||
| "metadata": { | ||
| "includeConversationData": true | ||
| }, | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "${AUGMENT_PLUGIN_ROOT}/scripts/on-stop.sh" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "Notification": [ | ||
| { | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "${AUGMENT_PLUGIN_ROOT}/scripts/on-notification.sh" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "PostToolUse": [ | ||
| { | ||
| "matcher": ".*", | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "${AUGMENT_PLUGIN_ROOT}/scripts/on-post-tool-use.sh" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "PreToolUse": [ | ||
| { | ||
| "matcher": ".*", | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "${AUGMENT_PLUGIN_ROOT}/scripts/on-pre-tool-use.sh" | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "PromptSubmit": [ | ||
| { | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "${AUGMENT_PLUGIN_ROOT}/scripts/on-prompt-submit.sh" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } |
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,58 @@ | ||
| #!/bin/bash | ||
| # Builds a structured JSON notification payload for warp://cli-agent. | ||
| # | ||
| # Usage: source this file, then call build_payload with event-specific fields. | ||
| # | ||
| # Example: | ||
| # source "$(dirname "${BASH_SOURCE[0]}")/build-payload.sh" | ||
| # BODY=$(build_payload "$INPUT" "stop" \ | ||
| # --arg query "$QUERY" \ | ||
| # --arg response "$RESPONSE") | ||
| # | ||
| # The function extracts common fields (session_id, cwd, project) from the | ||
| # hook's stdin JSON (passed as $1), then merges any extra jq args you pass. | ||
|
|
||
| # The current protocol version this plugin knows how to produce. | ||
| PLUGIN_CURRENT_PROTOCOL_VERSION=1 | ||
|
|
||
| # Negotiate the protocol version with Warp. | ||
| # Uses min(plugin_current, warp_declared), falling back to 1 if Warp doesn't advertise a version. | ||
| negotiate_protocol_version() { | ||
| local warp_version="${WARP_CLI_AGENT_PROTOCOL_VERSION:-1}" | ||
| if [ "$warp_version" -lt "$PLUGIN_CURRENT_PROTOCOL_VERSION" ] 2>/dev/null; then | ||
| echo "$warp_version" | ||
| else | ||
| echo "$PLUGIN_CURRENT_PROTOCOL_VERSION" | ||
| fi | ||
| } | ||
|
|
||
| build_payload() { | ||
| local input="$1" | ||
| local event="$2" | ||
| local agent="auggie" | ||
| shift 2 | ||
|
|
||
| local protocol_version | ||
| protocol_version=$(negotiate_protocol_version) | ||
|
|
||
| # Extract common fields from the hook input | ||
| local session_id cwd project | ||
| session_id=$(echo "$input" | jq -r '.conversation_id // empty' 2>/dev/null) | ||
| cwd=$(echo "$input" | jq -r '.workspace_roots[0] // empty' 2>/dev/null) | ||
| project="" | ||
| if [ -n "$cwd" ]; then | ||
| project=$(basename "$cwd") | ||
| fi | ||
|
|
||
| # Build the payload: common fields + any extra args passed by the caller. | ||
| # Extra args should be jq flag pairs like: --arg key "value" or --argjson key '{"a":1}' | ||
| jq -nc \ | ||
| --argjson v "$protocol_version" \ | ||
| --arg agent "$agent" \ | ||
| --arg event "$event" \ | ||
| --arg session_id "$session_id" \ | ||
| --arg cwd "$cwd" \ | ||
| --arg project "$project" \ | ||
| "$@" \ | ||
| '{v:$v, agent:$agent, event:$event, session_id:$session_id, cwd:$cwd, project:$project} + $ARGS.named' | ||
| } |
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,21 @@ | ||
| #!/bin/bash | ||
| # Hook script for Auggie Notification event | ||
| # Sends a Warp notification when Auggie needs user input | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
|
|
||
| # Opt-in debug logging (set AUGGIE_WARP_DEBUG=1) | ||
| if [ -n "${AUGGIE_WARP_DEBUG:-}" ]; then | ||
| _LOG="${AUGGIE_WARP_DEBUG_LOG:-/tmp/auggie-warp-debug.log}" | ||
| echo "[$(date '+%Y-%m-%d %H:%M:%S')] $(basename "$0") pid=$$ TERM_PROGRAM=${TERM_PROGRAM:-} WARP_PROTO=${WARP_CLI_AGENT_PROTOCOL_VERSION:-} WARP_VER=${WARP_CLIENT_VERSION:-}" >> "$_LOG" | ||
| fi | ||
|
|
||
| # Read hook input from stdin | ||
| INPUT=$(cat) | ||
| [ -n "${AUGGIE_WARP_DEBUG:-}" ] && echo "[stdin] $INPUT" >> "${AUGGIE_WARP_DEBUG_LOG:-/tmp/auggie-warp-debug.log}" | ||
|
|
||
| # Extract the notification message | ||
| MSG=$(echo "$INPUT" | jq -r '.message // "Input needed"' 2>/dev/null) | ||
| [ -z "$MSG" ] && MSG="Input needed" | ||
|
|
||
| "$SCRIPT_DIR/warp-notify.sh" "Auggie" "$MSG" |
21 changes: 21 additions & 0 deletions
21
plugin_marketplace/warp/scripts/legacy/on-session-start.sh
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,21 @@ | ||
| #!/bin/bash | ||
| # Hook script for Auggie SessionStart event | ||
| # Shows welcome message and Warp detection status | ||
|
|
||
| # Opt-in debug logging (set AUGGIE_WARP_DEBUG=1) | ||
| if [ -n "${AUGGIE_WARP_DEBUG:-}" ]; then | ||
| _LOG="${AUGGIE_WARP_DEBUG_LOG:-/tmp/auggie-warp-debug.log}" | ||
| echo "[$(date '+%Y-%m-%d %H:%M:%S')] $(basename "$0") pid=$$ TERM_PROGRAM=${TERM_PROGRAM:-} WARP_PROTO=${WARP_CLI_AGENT_PROTOCOL_VERSION:-} WARP_VER=${WARP_CLIENT_VERSION:-}" >> "$_LOG" | ||
| fi | ||
|
|
||
| # Check if running in Warp terminal | ||
| if [ "$TERM_PROGRAM" = "WarpTerminal" ]; then | ||
| # Running in Warp - notifications will work | ||
| cat << 'EOF' | ||
| { | ||
| "systemMessage": "🔔 Warp plugin active. You'll receive native Warp notifications when tasks complete or input is needed." | ||
| } | ||
| EOF | ||
| else | ||
| exit 0 | ||
| fi |
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,55 @@ | ||
| #!/bin/bash | ||
| # Hook script for Auggie Stop event | ||
| # Sends a Warp notification when Auggie completes a task | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
|
|
||
| # Opt-in debug logging (set AUGGIE_WARP_DEBUG=1) | ||
| if [ -n "${AUGGIE_WARP_DEBUG:-}" ]; then | ||
| _LOG="${AUGGIE_WARP_DEBUG_LOG:-/tmp/auggie-warp-debug.log}" | ||
| echo "[$(date '+%Y-%m-%d %H:%M:%S')] $(basename "$0") pid=$$ TERM_PROGRAM=${TERM_PROGRAM:-} WARP_PROTO=${WARP_CLI_AGENT_PROTOCOL_VERSION:-} WARP_VER=${WARP_CLIENT_VERSION:-}" >> "$_LOG" | ||
| fi | ||
|
|
||
| # Read hook input from stdin | ||
| INPUT=$(cat) | ||
| [ -n "${AUGGIE_WARP_DEBUG:-}" ] && echo "[stdin] $INPUT" >> "${AUGGIE_WARP_DEBUG_LOG:-/tmp/auggie-warp-debug.log}" | ||
|
|
||
| # Extract transcript path from the hook input | ||
| TRANSCRIPT_PATH=$(echo "$INPUT" | jq -r '.transcript_path // empty' 2>/dev/null) | ||
|
|
||
| # Default message | ||
| MSG="Task completed" | ||
|
|
||
| # Try to extract prompt and response from the transcript (JSONL format) | ||
| if [ -n "$TRANSCRIPT_PATH" ] && [ -f "$TRANSCRIPT_PATH" ]; then | ||
| # Get the first user prompt | ||
| PROMPT=$(jq -rs ' | ||
| [.[] | select(.type == "user")] | first | .message.content // empty | ||
| ' "$TRANSCRIPT_PATH" 2>/dev/null) | ||
|
|
||
| # Get the last assistant response | ||
| RESPONSE=$(jq -rs ' | ||
| [.[] | select(.type == "assistant" and .message.content)] | last | | ||
| [.message.content[] | select(.type == "text") | .text] | join(" ") | ||
| ' "$TRANSCRIPT_PATH" 2>/dev/null) | ||
|
|
||
| if [ -n "$PROMPT" ] && [ -n "$RESPONSE" ]; then | ||
| # Truncate prompt to 50 chars | ||
| if [ ${#PROMPT} -gt 50 ]; then | ||
| PROMPT="${PROMPT:0:47}..." | ||
| fi | ||
| # Truncate response to 120 chars | ||
| if [ ${#RESPONSE} -gt 120 ]; then | ||
| RESPONSE="${RESPONSE:0:117}..." | ||
| fi | ||
| MSG="\"${PROMPT}\" → ${RESPONSE}" | ||
| elif [ -n "$RESPONSE" ]; then | ||
| # Fallback to just response if no prompt found | ||
| if [ ${#RESPONSE} -gt 175 ]; then | ||
| RESPONSE="${RESPONSE:0:172}..." | ||
| fi | ||
| MSG="$RESPONSE" | ||
| fi | ||
| fi | ||
|
|
||
| "$SCRIPT_DIR/warp-notify.sh" "Auggie" "$MSG" |
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,10 @@ | ||
| #!/bin/bash | ||
| # Warp notification utility using OSC escape sequences | ||
| # Usage: warp-notify.sh <title> <body> | ||
|
|
||
| TITLE="${1:-Notification}" | ||
| BODY="${2:-}" | ||
|
|
||
| # OSC 777 format: \033]777;notify;<title>;<body>\007 | ||
| # Write directly to /dev/tty to ensure it reaches the terminal | ||
| printf '\033]777;notify;%s;%s\007' "$TITLE" "$BODY" > /dev/tty 2>/dev/null || true |
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,27 @@ | ||
| #!/bin/bash | ||
| # Hook script for Auggie Notification event (idle_prompt only) | ||
| # Sends a structured Warp notification when Auggie has been idle | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
|
|
||
| source "$SCRIPT_DIR/should-use-structured.sh" | ||
|
|
||
| # Legacy fallback for old Warp versions | ||
| if ! should_use_structured; then | ||
| [ "$TERM_PROGRAM" = "WarpTerminal" ] && exec "$SCRIPT_DIR/legacy/on-notification.sh" | ||
| exit 0 | ||
| fi | ||
|
|
||
| source "$SCRIPT_DIR/build-payload.sh" | ||
|
|
||
| # Read hook input from stdin | ||
| INPUT=$(cat) | ||
|
|
||
| # Extract notification-specific fields | ||
| NOTIF_TYPE=$(echo "$INPUT" | jq -r '.notification_type // "unknown"' 2>/dev/null) | ||
| MSG=$(echo "$INPUT" | jq -r '.notification_message // "Input needed"' 2>/dev/null) | ||
| [ -z "$MSG" ] && MSG="Input needed" | ||
|
|
||
| BODY=$(build_payload "$INPUT" "$NOTIF_TYPE" \ | ||
| --arg summary "$MSG") | ||
| "$SCRIPT_DIR/warp-notify.sh" "warp://cli-agent" "$BODY" |
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,25 @@ | ||
| #!/bin/bash | ||
| # Hook script for Auggie PostToolUse event | ||
| # Sends a structured Warp notification after a tool call completes, | ||
| # transitioning the session status from Blocked back to Running. | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
|
|
||
| source "$SCRIPT_DIR/should-use-structured.sh" | ||
|
|
||
| # No legacy equivalent for this hook | ||
| if ! should_use_structured; then | ||
| exit 0 | ||
| fi | ||
|
|
||
| source "$SCRIPT_DIR/build-payload.sh" | ||
|
|
||
| # Read hook input from stdin | ||
| INPUT=$(cat) | ||
|
|
||
| TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name // empty' 2>/dev/null) | ||
|
|
||
| BODY=$(build_payload "$INPUT" "tool_complete" \ | ||
| --arg tool_name "$TOOL_NAME") | ||
|
|
||
| "$SCRIPT_DIR/warp-notify.sh" "warp://cli-agent" "$BODY" |
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,28 @@ | ||
| #!/bin/bash | ||
| # Hook script for Auggie PreToolUse event | ||
| # Detects when Auggie is waiting for user input (ask-user tool) and sends | ||
| # a "permission_request" so Warp shows the stop sign / blocked indicator. | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
|
|
||
| source "$SCRIPT_DIR/should-use-structured.sh" | ||
|
|
||
| # No legacy equivalent for this hook | ||
| if ! should_use_structured; then | ||
| exit 0 | ||
| fi | ||
|
|
||
| source "$SCRIPT_DIR/build-payload.sh" | ||
|
|
||
| # Read hook input from stdin | ||
| INPUT=$(cat) | ||
|
|
||
| TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name // empty' 2>/dev/null) | ||
|
|
||
| # ask-user means the agent is waiting for input (plan mode / permission). | ||
| # Send "permission_request" so Warp shows the stop sign instead of "in progress". | ||
| if [ "$TOOL_NAME" = "ask-user" ]; then | ||
| BODY=$(build_payload "$INPUT" "permission_request" \ | ||
| --arg tool_name "$TOOL_NAME") | ||
| "$SCRIPT_DIR/warp-notify.sh" "warp://cli-agent" "$BODY" | ||
| fi | ||
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,28 @@ | ||
| #!/bin/bash | ||
| # Hook script for Auggie PromptSubmit event | ||
| # Sends a "prompt_submit" Warp notification when the user submits a prompt, | ||
| # transitioning the session status from idle/done back to running. | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
|
|
||
| source "$SCRIPT_DIR/should-use-structured.sh" | ||
|
|
||
| # No legacy equivalent for this hook | ||
| if ! should_use_structured; then | ||
| exit 0 | ||
| fi | ||
|
|
||
| source "$SCRIPT_DIR/build-payload.sh" | ||
|
|
||
| # Read hook input from stdin | ||
| INPUT=$(cat) | ||
|
|
||
| # Extract the user's prompt | ||
| QUERY=$(echo "$INPUT" | jq -r '.user_prompt // empty' 2>/dev/null) | ||
| if [ -n "$QUERY" ] && [ ${#QUERY} -gt 200 ]; then | ||
| QUERY="${QUERY:0:197}..." | ||
| fi | ||
|
|
||
| BODY=$(build_payload "$INPUT" "prompt_submit" \ | ||
| --arg query "$QUERY") | ||
| "$SCRIPT_DIR/warp-notify.sh" "warp://cli-agent" "$BODY" |
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.
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.
Code Review Agent🛡️ on behalf of @augmentmoogi
The
permission_requesttest intests/test-hooks.shbuilds a payload withtool_input.command, but this hook only forwards--arg tool_name "$TOOL_NAME"— nevertool_input. The test is exercisingbuild-payload.sh's arg-forwarding generically, not what the hook actually emits, so the assertedtool_input.commandfield will not appear in real notifications. Either droptool_inputfrom that test case (since the hook doesn't emit it) or, if you do want Warp to receive the tool input onpermission_request, plumb it through here with--argjson tool_input "$(echo "$INPUT" | jq -c '.tool_input // {}')".