@webpresso/plugin-grok 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,104 @@
1
+ Elastic License 2.0
2
+ ===================
3
+
4
+ Copyright (c) 2026 Webpresso, Inc.
5
+
6
+ Acceptance
7
+ ----------
8
+
9
+ By using the software, you agree to all of the terms and conditions below.
10
+
11
+ Copyright License
12
+ -----------------
13
+
14
+ The licensor grants you a non-exclusive, royalty-free, worldwide,
15
+ non-sublicensable, non-transferable license to use, copy, distribute, make
16
+ available, and prepare derivative works of the software, in each case subject
17
+ to the limitations and conditions below.
18
+
19
+ Limitations
20
+ -----------
21
+
22
+ You may not provide the software to third parties as a hosted or managed
23
+ service, where the service provides users with access to any substantial set of
24
+ the features or functionality of the software.
25
+
26
+ You may not move, change, disable, or circumvent the license key
27
+ functionality in the software, and you may not remove or obscure any
28
+ functionality in the software that is protected by the license key.
29
+
30
+ You may not alter, remove, or obscure any licensing, copyright, or other
31
+ notices of the licensor in the software. Any use of the licensor's trademarks
32
+ is subject to applicable law.
33
+
34
+ Patents
35
+ -------
36
+
37
+ The licensor grants you a license, under any patent claims the licensor can
38
+ license, or becomes able to license, to make, have made, use, sell, offer for
39
+ sale, import and have imported the software, in each case subject to the
40
+ limitations and conditions in this license. This license does not cover any
41
+ patent claims that you cause to be infringed by modifications or additions to
42
+ the software.
43
+
44
+ If you or your company make any written claim that the software infringes or
45
+ contributes to infringement of any patent, your patent license for the software
46
+ granted under these terms ends immediately. If your company makes such a claim,
47
+ your patent license ends immediately for work on behalf of your company.
48
+
49
+ Notices
50
+ -------
51
+
52
+ You must ensure that anyone who gets a copy of any part of the software from
53
+ you also gets a copy of these terms.
54
+
55
+ If you modify the software, you must include in any modified copies of the
56
+ software prominent notices stating that you have modified the software.
57
+
58
+ No Other Rights
59
+ ---------------
60
+
61
+ These terms do not imply any licenses other than those expressly granted in
62
+ these terms.
63
+
64
+ Termination
65
+ -----------
66
+
67
+ If you use the software in violation of these terms, such use is not licensed,
68
+ and your licenses will automatically terminate. If the licensor provides you
69
+ with a notice of your violation, and you cease all violation of this license no
70
+ later than 30 days after you receive that notice, your licenses will be
71
+ reinstated retroactively. However, if you violate these terms after such
72
+ reinstatement, any additional violation of these terms will cause your licenses
73
+ to terminate automatically and permanently.
74
+
75
+ No Liability
76
+ ------------
77
+
78
+ As far as the law allows, the software comes as is, without any warranty or
79
+ condition, and the licensor will not be liable to you for any damages arising
80
+ out of these terms or the use or nature of the software, under any kind of
81
+ legal claim.
82
+
83
+ Definitions
84
+ -----------
85
+
86
+ The licensor is the entity offering these terms, and the software is the
87
+ software the licensor makes available under these terms, including any portion
88
+ of it.
89
+
90
+ you refers to the individual or entity agreeing to these terms.
91
+
92
+ your company is any legal entity, sole proprietorship, or other kind of
93
+ organization that you work for, plus all organizations that have control over,
94
+ are under the control of, or are under common control with that organization.
95
+ control means ownership of substantially all the assets of an entity, or the
96
+ power to direct its management and policies by vote, contract, or otherwise.
97
+ Control can be direct or indirect.
98
+
99
+ your licenses are all the licenses granted to you for the software under these
100
+ terms.
101
+
102
+ use means anything you do with the software requiring one of your licenses.
103
+
104
+ trademark means trademarks, service marks, and similar rights.
package/bin/wp ADDED
@@ -0,0 +1,54 @@
1
+ #!/bin/sh
2
+ # Resolve the Webpresso `wp` executable and hand this process over to it.
3
+ #
4
+ # `exec` rather than a spawn wrapper: the MCP server this shim launches is a
5
+ # long-lived stdio service, and a wrapper process that merely relays for it is a
6
+ # layer that can die while leaving the server behind, orphaned and holding the
7
+ # client's pipe. After `exec` there is no shim process left to strand — the
8
+ # launcher IS this pid, so the host's signals and pipe closure reach it directly.
9
+ # It also makes every non-MCP command a byte-exact passthrough, including TTY
10
+ # behavior that a relay would otherwise disturb.
11
+ #
12
+ # Arguments are forwarded verbatim through the quoted "$@" expansion. The plugin
13
+ # manifest invokes this file as `bin/wp mcp`, so dropping or word-splitting
14
+ # arguments would silently break the only real launch surface.
15
+
16
+ set -u
17
+
18
+ fail() {
19
+ printf '%s\n' "$1" >&2
20
+ exit 1
21
+ }
22
+
23
+ : "${WEBPRESSO_WP_BIN:=}"
24
+ : "${WP_FORCE_JIT_PATH:=}"
25
+
26
+ if [ -n "$WEBPRESSO_WP_BIN" ] && [ -n "$WP_FORCE_JIT_PATH" ]; then
27
+ fail "WEBPRESSO_WP_BIN and WP_FORCE_JIT_PATH are both set; unset one. Product path is the Webpresso app launcher (~/.webpresso/bin/wp) or monorepo JIT (WP_FORCE_JIT_PATH to a webpresso/app checkout). Do not dual-set overrides."
28
+ fi
29
+
30
+ if [ -n "$WEBPRESSO_WP_BIN" ]; then
31
+ target=$WEBPRESSO_WP_BIN
32
+ source_label=WEBPRESSO_WP_BIN
33
+ elif [ -n "$WP_FORCE_JIT_PATH" ]; then
34
+ target=$WP_FORCE_JIT_PATH/bin/wp
35
+ source_label=WP_FORCE_JIT_PATH
36
+ else
37
+ target=${HOME:-}/.webpresso/bin/wp
38
+ source_label="Webpresso app launcher"
39
+ fi
40
+
41
+ # Refuse to exec this shim again: a self-referential target would loop forever
42
+ # instead of failing with a diagnostic.
43
+ if [ "$target" = "$0" ]; then
44
+ fail "$source_label points to this shim ($target); set it to the Webpresso wp executable instead."
45
+ fi
46
+
47
+ if [ ! -f "$target" ] || [ ! -x "$target" ]; then
48
+ fail "$source_label points to $target, but that executable is not available. Set WEBPRESSO_WP_BIN to the Webpresso wp executable, set WP_FORCE_JIT_PATH to an agent-kit checkout, or install the Webpresso app."
49
+ fi
50
+
51
+ WP_SKIP_UPDATE_CHECK=${WP_SKIP_UPDATE_CHECK:-1}
52
+ export WP_SKIP_UPDATE_CHECK
53
+
54
+ exec "$target" "$@"
@@ -0,0 +1,81 @@
1
+ {
2
+ "hooks": {
3
+ "SessionStart": [
4
+ {
5
+ "hooks": [
6
+ {
7
+ "type": "command",
8
+ "command": "wp_bin=; if [ -n \"${WEBPRESSO_WP_BIN:-}\" ] && [ -n \"${WP_FORCE_JIT_PATH:-}\" ]; then printf '%s\\n' 'WEBPRESSO_WP_BIN and WP_FORCE_JIT_PATH are both set; unset one.' >&2; exit 2; fi; if [ -n \"${WEBPRESSO_WP_BIN:-}\" ] && [ -x \"${WEBPRESSO_WP_BIN}\" ]; then wp_bin=\"${WEBPRESSO_WP_BIN}\"; elif [ -n \"${WP_FORCE_JIT_PATH:-}\" ] && [ -x \"${WP_FORCE_JIT_PATH}/bin/wp\" ]; then wp_bin=\"${WP_FORCE_JIT_PATH}/bin/wp\"; elif [ -x \"${HOME}/.webpresso/bin/wp\" ]; then wp_bin=\"${HOME}/.webpresso/bin/wp\"; fi; if [ -n \"$wp_bin\" ]; then env WP_HOOK_HOST='grok' \"$wp_bin\" hook sessionstart-routing; hook_status=$?; if [ \"$hook_status\" -eq 2 ]; then exit 2; elif [ \"$hook_status\" -ne 0 ]; then true; fi; else true; fi # wp-sessionstart-routing",
9
+ "timeout": 5
10
+ }
11
+ ]
12
+ }
13
+ ],
14
+ "PreToolUse": [
15
+ {
16
+ "matcher": "Bash|run_terminal_command|Write|write|Edit|search_replace|MultiEdit",
17
+ "hooks": [
18
+ {
19
+ "type": "command",
20
+ "command": "wp_bin=; if [ -n \"${WEBPRESSO_WP_BIN:-}\" ] && [ -n \"${WP_FORCE_JIT_PATH:-}\" ]; then printf '%s\\n' 'WEBPRESSO_WP_BIN and WP_FORCE_JIT_PATH are both set; unset one.' >&2; exit 2; fi; if [ -n \"${WEBPRESSO_WP_BIN:-}\" ] && [ -x \"${WEBPRESSO_WP_BIN}\" ]; then wp_bin=\"${WEBPRESSO_WP_BIN}\"; elif [ -n \"${WP_FORCE_JIT_PATH:-}\" ] && [ -x \"${WP_FORCE_JIT_PATH}/bin/wp\" ]; then wp_bin=\"${WP_FORCE_JIT_PATH}/bin/wp\"; elif [ -x \"${HOME}/.webpresso/bin/wp\" ]; then wp_bin=\"${HOME}/.webpresso/bin/wp\"; fi; if [ -n \"$wp_bin\" ]; then env WP_HOOK_HOST='grok' \"$wp_bin\" hook pretool-guard; hook_status=$?; if [ \"$hook_status\" -eq 2 ]; then exit 2; elif [ \"$hook_status\" -ne 0 ]; then printf '%s\\n' \"{\\\"decision\\\":\\\"deny\\\",\\\"reason\\\":\\\"GUARD_PRETOOL_FAILURE: pretool-guard exit $hook_status; run wp hooks doctor\\\",\\\"hookSpecificOutput\\\":{\\\"hookEventName\\\":\\\"PreToolUse\\\",\\\"permissionDecision\\\":\\\"deny\\\",\\\"permissionDecisionReason\\\":\\\"GUARD_PRETOOL_FAILURE: pretool-guard exit $hook_status; run wp hooks doctor\\\"}}\"; printf '%s\\n' \"GUARD_PRETOOL_FAILURE: pretool-guard exit $hook_status; run wp hooks doctor\" >&2; exit 2; fi; else printf '%s\\n' '{\"decision\":\"deny\",\"reason\":\"GUARD_PRETOOL_FAILURE: wp missing; set WEBPRESSO_WP_BIN or install the app\",\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"deny\",\"permissionDecisionReason\":\"GUARD_PRETOOL_FAILURE: wp missing; set WEBPRESSO_WP_BIN or install the app\"}}'; printf '%s\\n' 'GUARD_PRETOOL_FAILURE: wp missing; set WEBPRESSO_WP_BIN or install the app' >&2; exit 2; fi # wp-pretool-guard",
21
+ "timeout": 5
22
+ }
23
+ ]
24
+ }
25
+ ],
26
+ "PostToolUse": [
27
+ {
28
+ "matcher": "Write|write|Edit|search_replace|MultiEdit",
29
+ "hooks": [
30
+ {
31
+ "type": "command",
32
+ "command": "wp_bin=; if [ -n \"${WEBPRESSO_WP_BIN:-}\" ] && [ -n \"${WP_FORCE_JIT_PATH:-}\" ]; then printf '%s\\n' 'WEBPRESSO_WP_BIN and WP_FORCE_JIT_PATH are both set; unset one.' >&2; exit 2; fi; if [ -n \"${WEBPRESSO_WP_BIN:-}\" ] && [ -x \"${WEBPRESSO_WP_BIN}\" ]; then wp_bin=\"${WEBPRESSO_WP_BIN}\"; elif [ -n \"${WP_FORCE_JIT_PATH:-}\" ] && [ -x \"${WP_FORCE_JIT_PATH}/bin/wp\" ]; then wp_bin=\"${WP_FORCE_JIT_PATH}/bin/wp\"; elif [ -x \"${HOME}/.webpresso/bin/wp\" ]; then wp_bin=\"${HOME}/.webpresso/bin/wp\"; fi; if [ -n \"$wp_bin\" ]; then env WP_HOOK_HOST='grok' \"$wp_bin\" hook post-tool; hook_status=$?; if [ \"$hook_status\" -eq 2 ]; then exit 2; elif [ \"$hook_status\" -ne 0 ]; then true; fi; else true; fi # wp-post-tool",
33
+ "timeout": 15
34
+ }
35
+ ]
36
+ }
37
+ ],
38
+ "UserPromptSubmit": [
39
+ {
40
+ "hooks": [
41
+ {
42
+ "type": "command",
43
+ "command": "wp_bin=; if [ -n \"${WEBPRESSO_WP_BIN:-}\" ] && [ -n \"${WP_FORCE_JIT_PATH:-}\" ]; then printf '%s\\n' 'WEBPRESSO_WP_BIN and WP_FORCE_JIT_PATH are both set; unset one.' >&2; exit 2; fi; if [ -n \"${WEBPRESSO_WP_BIN:-}\" ] && [ -x \"${WEBPRESSO_WP_BIN}\" ]; then wp_bin=\"${WEBPRESSO_WP_BIN}\"; elif [ -n \"${WP_FORCE_JIT_PATH:-}\" ] && [ -x \"${WP_FORCE_JIT_PATH}/bin/wp\" ]; then wp_bin=\"${WP_FORCE_JIT_PATH}/bin/wp\"; elif [ -x \"${HOME}/.webpresso/bin/wp\" ]; then wp_bin=\"${HOME}/.webpresso/bin/wp\"; fi; if [ -n \"$wp_bin\" ]; then env WP_HOOK_HOST='grok' \"$wp_bin\" hook guard-switch; hook_status=$?; if [ \"$hook_status\" -eq 2 ]; then exit 2; elif [ \"$hook_status\" -ne 0 ]; then true; fi; else true; fi # wp-guard-switch",
44
+ "timeout": 5
45
+ }
46
+ ]
47
+ }
48
+ ],
49
+ "Stop": [
50
+ {
51
+ "hooks": [
52
+ {
53
+ "type": "command",
54
+ "command": "wp_bin=; if [ -n \"${WEBPRESSO_WP_BIN:-}\" ] && [ -n \"${WP_FORCE_JIT_PATH:-}\" ]; then printf '%s\\n' 'WEBPRESSO_WP_BIN and WP_FORCE_JIT_PATH are both set; unset one.' >&2; exit 2; fi; if [ -n \"${WEBPRESSO_WP_BIN:-}\" ] && [ -x \"${WEBPRESSO_WP_BIN}\" ]; then wp_bin=\"${WEBPRESSO_WP_BIN}\"; elif [ -n \"${WP_FORCE_JIT_PATH:-}\" ] && [ -x \"${WP_FORCE_JIT_PATH}/bin/wp\" ]; then wp_bin=\"${WP_FORCE_JIT_PATH}/bin/wp\"; elif [ -x \"${HOME}/.webpresso/bin/wp\" ]; then wp_bin=\"${HOME}/.webpresso/bin/wp\"; fi; if [ -n \"$wp_bin\" ]; then env WP_HOOK_HOST='grok' \"$wp_bin\" hook stop-qa; hook_status=$?; if [ \"$hook_status\" -eq 2 ]; then exit 2; elif [ \"$hook_status\" -ne 0 ]; then printf '%s\\n' '{}'; fi; else printf '%s\\n' '{}'; fi # wp-stop-qa",
55
+ "timeout": 10
56
+ }
57
+ ]
58
+ },
59
+ {
60
+ "hooks": [
61
+ {
62
+ "type": "command",
63
+ "command": "wp_bin=; if [ -n \"${WEBPRESSO_WP_BIN:-}\" ] && [ -n \"${WP_FORCE_JIT_PATH:-}\" ]; then printf '%s\\n' 'WEBPRESSO_WP_BIN and WP_FORCE_JIT_PATH are both set; unset one.' >&2; exit 2; fi; if [ -n \"${WEBPRESSO_WP_BIN:-}\" ] && [ -x \"${WEBPRESSO_WP_BIN}\" ]; then wp_bin=\"${WEBPRESSO_WP_BIN}\"; elif [ -n \"${WP_FORCE_JIT_PATH:-}\" ] && [ -x \"${WP_FORCE_JIT_PATH}/bin/wp\" ]; then wp_bin=\"${WP_FORCE_JIT_PATH}/bin/wp\"; elif [ -x \"${HOME}/.webpresso/bin/wp\" ]; then wp_bin=\"${HOME}/.webpresso/bin/wp\"; fi; if [ -n \"$wp_bin\" ]; then env WP_HOOK_HOST='grok' \"$wp_bin\" hook stop-ultragoal; hook_status=$?; if [ \"$hook_status\" -eq 2 ]; then exit 2; elif [ \"$hook_status\" -ne 0 ]; then printf '%s\\n' '{}'; fi; else printf '%s\\n' '{}'; fi # wp-stop-ultragoal",
64
+ "timeout": 10
65
+ }
66
+ ]
67
+ }
68
+ ],
69
+ "PreCompact": [
70
+ {
71
+ "hooks": [
72
+ {
73
+ "type": "command",
74
+ "command": "wp_bin=; if [ -n \"${WEBPRESSO_WP_BIN:-}\" ] && [ -n \"${WP_FORCE_JIT_PATH:-}\" ]; then printf '%s\\n' 'WEBPRESSO_WP_BIN and WP_FORCE_JIT_PATH are both set; unset one.' >&2; exit 2; fi; if [ -n \"${WEBPRESSO_WP_BIN:-}\" ] && [ -x \"${WEBPRESSO_WP_BIN}\" ]; then wp_bin=\"${WEBPRESSO_WP_BIN}\"; elif [ -n \"${WP_FORCE_JIT_PATH:-}\" ] && [ -x \"${WP_FORCE_JIT_PATH}/bin/wp\" ]; then wp_bin=\"${WP_FORCE_JIT_PATH}/bin/wp\"; elif [ -x \"${HOME}/.webpresso/bin/wp\" ]; then wp_bin=\"${HOME}/.webpresso/bin/wp\"; fi; if [ -n \"$wp_bin\" ]; then env WP_HOOK_HOST='grok' \"$wp_bin\" hook precompact-snapshot; hook_status=$?; if [ \"$hook_status\" -eq 2 ]; then exit 2; elif [ \"$hook_status\" -ne 0 ]; then printf '%s\\n' '{}'; fi; else printf '%s\\n' '{}'; fi # wp-precompact-snapshot",
75
+ "timeout": 5
76
+ }
77
+ ]
78
+ }
79
+ ]
80
+ }
81
+ }
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@webpresso/plugin-grok",
3
+ "version": "0.0.10",
4
+ "private": false,
5
+ "description": "Grok Build plugin adapter for Webpresso agent-kit skills, hooks, and MCP runtime.",
6
+ "homepage": "https://github.com/webpresso/app#readme",
7
+ "bugs": {
8
+ "url": "https://github.com/webpresso/app/issues"
9
+ },
10
+ "license": "Elastic-2.0",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/webpresso/app.git",
14
+ "directory": "packages/plugin-grok"
15
+ },
16
+ "files": [
17
+ "plugin.json",
18
+ "hooks",
19
+ "bin/wp",
20
+ "LICENSE",
21
+ "!README.md",
22
+ "!CHANGELOG.md",
23
+ "!**/*.test.js",
24
+ "!**/*.test.ts"
25
+ ],
26
+ "type": "module",
27
+ "sideEffects": false,
28
+ "publishConfig": {
29
+ "access": "public",
30
+ "registry": "https://registry.npmjs.org/"
31
+ },
32
+ "engines": {
33
+ "node": ">=24"
34
+ }
35
+ }
package/plugin.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "agent-kit",
3
+ "version": "0.0.10",
4
+ "description": "Webpresso agent-kit: blueprints, skills, hooks, and MCP server",
5
+ "author": {
6
+ "name": "Webpresso",
7
+ "url": "https://github.com/webpresso"
8
+ },
9
+ "homepage": "https://github.com/webpresso/agent-kit#readme",
10
+ "repository": "https://github.com/webpresso/agent-kit",
11
+ "license": "Elastic-2.0",
12
+ "keywords": ["agent", "blueprint", "mcp", "skills", "developer-tools", "grok"],
13
+ "hooks": "./hooks/hooks.json"
14
+ }