@weavetab/plugin-gamer 0.0.0-stage → 1.0.0

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/weavetab.json ADDED
@@ -0,0 +1,295 @@
1
+ {
2
+ "$schema": "https://weavetab.dev/schema/plugin.json",
3
+ "name": "@weavetab/plugin-gamer",
4
+ "displayName": "Gamer",
5
+ "description": "Local-vision real-time controller powered by Weavetab Gate v2.0 — CLI-first bounded burst playbooks, MCP parity, and universal CDP inputs for 2D/3D/turn-based browser and Electron sessions.",
6
+ "entry": "dist/index.js",
7
+ "instructions": "Two-tier Planner-Actor control via Gate v2.0 local ONNX (~8-12 Hz CPU, zero tokens):\n1. Prefer CLI `weavetab plugin use gamer run --rules \"when1 => hold:w ; when2 => yield\"` (or `--rules_file playbook.json`) for live stdout streaming without context bloat. Use MCP `gamer_play` when you want the final JPEG frame inline.\n2. Keep vision `when`/`stop_if` labels short & visual (e.g. 'red warning box', 'white pause menu'); use declarative statements for `text_selector` NLI (`ask`/`stop_if`).\n3. Calibrate labels with `gamer_decide` / `decide`; dispatch manual inputs (`hold`, `tap`, `click`, `drag`, `look`) with `gamer_act` / `act`.",
8
+ "tags": [
9
+ "Gamer",
10
+ "Vision",
11
+ "Gate",
12
+ "Realtime",
13
+ "Electron",
14
+ "CDP",
15
+ "Official"
16
+ ],
17
+ "links": {
18
+ "github": "https://github.com/Weavetab/Gamer",
19
+ "npm": "https://www.npmjs.com/package/@weavetab/plugin-gamer"
20
+ },
21
+ "defaultConfig": {
22
+ "defaultIntervalMs": 100,
23
+ "defaultSteps": 30,
24
+ "minConfidence": 0.45,
25
+ "jpegQuality": 65
26
+ },
27
+ "permissions": {
28
+ "cdp": {
29
+ "evaluate": true,
30
+ "screenshot": true,
31
+ "input": true,
32
+ "reason": "Captures fast viewport/selector screenshots, reads optional HUD text or canvas focus/pointer-lock state, and dispatches keyboard/mouse/drag/camera inputs."
33
+ },
34
+ "tools": {
35
+ "add": true,
36
+ "reason": "Registers gamer_play, gamer_decide, and gamer_act MCP tools."
37
+ },
38
+ "commands": {
39
+ "add": true,
40
+ "reason": "Registers run, decide, and act CLI commands with live transition streaming."
41
+ },
42
+ "prompts": {
43
+ "add": true,
44
+ "reason": "Registers the /gamer_playbook prompt utility."
45
+ },
46
+ "config": {
47
+ "read": true,
48
+ "write": true,
49
+ "reason": "Reads default burst interval, step budget, confidence threshold, and JPEG quality."
50
+ }
51
+ },
52
+ "commands": [
53
+ {
54
+ "name": "run",
55
+ "description": "Run a bounded real-time Gate v2.0 vision/NLI playbook loop and stream transition-only progress lines to stdout.",
56
+ "usage": "weavetab plugin use gamer run --rules \"clear path => hold:w ; menu visible => yield\" [--clip canvas] [--steps 30] [--stop_if \"pause menu\"]",
57
+ "requiresSession": true,
58
+ "parameters": {
59
+ "type": "object",
60
+ "properties": {
61
+ "rules": {
62
+ "description": "Playbook rules array, '@file' path, JSON string, or DSL ('<when> => hold:w ; <when2> => yield')."
63
+ },
64
+ "rules_file": {
65
+ "type": "string",
66
+ "description": "Path to a JSON playbook file containing a rules array."
67
+ },
68
+ "steps": {
69
+ "type": "number",
70
+ "description": "Maximum decision ticks (1-200, default 30)."
71
+ },
72
+ "max_ms": {
73
+ "type": "number",
74
+ "description": "Maximum wall-clock burst duration in ms (200-30000, default 6000)."
75
+ },
76
+ "interval_ms": {
77
+ "type": "number",
78
+ "description": "Target loop interval in ms (50-2000, default 100)."
79
+ },
80
+ "min_conf": {
81
+ "type": "number",
82
+ "description": "Minimum Gate confidence threshold (0-1, default 0.45)."
83
+ },
84
+ "yield_on_low_conf": {
85
+ "type": "number",
86
+ "description": "Pause burst after N consecutive low-confidence ticks."
87
+ },
88
+ "stop_if": {
89
+ "type": "string",
90
+ "description": "Visual label (vision) or declarative statement (text_selector) that stops the burst."
91
+ },
92
+ "stop_conf": {
93
+ "type": "number",
94
+ "description": "Confidence required for stop_if (0-1, default 0.65)."
95
+ },
96
+ "stop_check_every": {
97
+ "type": "number",
98
+ "description": "Evaluate stop_if every N ticks (1-20, default 1)."
99
+ },
100
+ "clip": {
101
+ "description": "CSS selector string (e.g. 'canvas') or {x, y, w, h} crop rect (pixels or 0..1 normalized)."
102
+ },
103
+ "text_selector": {
104
+ "type": "string",
105
+ "description": "Optional DOM selector to evaluate via Gate text NLI instead of vision."
106
+ },
107
+ "focus": {
108
+ "description": "CSS selector to focus before running, or false to skip auto-focusing the largest canvas."
109
+ },
110
+ "quality": {
111
+ "type": "number",
112
+ "description": "JPEG screenshot quality (25-95, default 65)."
113
+ },
114
+ "save_frame": {
115
+ "type": "string",
116
+ "description": "Optional file path to save the final JPEG screenshot after the burst."
117
+ }
118
+ }
119
+ }
120
+ },
121
+ {
122
+ "name": "decide",
123
+ "description": "Capture a single frame (or selector text) and evaluate Gate v2.0 decide, yes/no, or ordered score.",
124
+ "usage": "weavetab plugin use gamer decide --choices \"label1,label2\" | --ask \"declarative claim\" | --levels \"low,high\" [--clip canvas]",
125
+ "requiresSession": true,
126
+ "parameters": {
127
+ "type": "object",
128
+ "properties": {
129
+ "choices": {
130
+ "description": "2-64 candidate labels (array or JSON string) for Gate decide."
131
+ },
132
+ "ask": {
133
+ "type": "string",
134
+ "description": "Declarative claim (text_selector) or visual phrase (vision) for Gate yesNo."
135
+ },
136
+ "levels": {
137
+ "description": "2-64 ordered rubric levels (array or JSON string) for Gate score."
138
+ },
139
+ "clip": {
140
+ "description": "Optional CSS selector or {x, y, w, h} crop rect."
141
+ },
142
+ "text_selector": {
143
+ "type": "string",
144
+ "description": "Optional DOM selector to score via text NLI instead of screenshot vision."
145
+ },
146
+ "quality": {
147
+ "type": "number",
148
+ "description": "JPEG quality (25-95, default 65)."
149
+ },
150
+ "save_frame": {
151
+ "type": "string",
152
+ "description": "Optional path to write the captured JPEG frame."
153
+ }
154
+ }
155
+ }
156
+ },
157
+ {
158
+ "name": "act",
159
+ "description": "Dispatch an immediate CDP keyboard, mouse, drag, or camera-look action on the active tab or Electron window.",
160
+ "usage": "weavetab plugin use gamer act --type tap|hold|click|mouse_hold|drag|look --keys \"w\"",
161
+ "requiresSession": true,
162
+ "parameters": {
163
+ "type": "object",
164
+ "required": ["type"],
165
+ "properties": {
166
+ "type": {
167
+ "type": "string",
168
+ "enum": ["hold", "tap", "click", "mouse_hold", "drag", "look", "idle", "yield"],
169
+ "description": "Input action kind."
170
+ },
171
+ "keys": {
172
+ "description": "Keys array or JSON/comma list for tap/hold (e.g. ['w','Space'])."
173
+ },
174
+ "button": {
175
+ "type": "string",
176
+ "enum": ["left", "right", "middle"],
177
+ "description": "Mouse button."
178
+ },
179
+ "x": { "type": "number", "description": "Pixel or 0..1 normalized X coordinate." },
180
+ "y": { "type": "number", "description": "Pixel or 0..1 normalized Y coordinate." },
181
+ "x1": { "type": "number", "description": "Drag start X (pixel or 0..1)." },
182
+ "y1": { "type": "number", "description": "Drag start Y (pixel or 0..1)." },
183
+ "x2": { "type": "number", "description": "Drag end X (pixel or 0..1)." },
184
+ "y2": { "type": "number", "description": "Drag end Y (pixel or 0..1)." },
185
+ "dx": { "type": "number", "description": "Relative pointer delta X for look." },
186
+ "dy": { "type": "number", "description": "Relative pointer delta Y for look." },
187
+ "steps": { "type": "number", "description": "Interpolation steps for drag/look." },
188
+ "hold_ms": { "type": "number", "description": "Hold duration in ms." },
189
+ "focus": { "description": "Optional selector to focus before input, or false to skip." }
190
+ }
191
+ }
192
+ }
193
+ ],
194
+ "prompts": [
195
+ {
196
+ "name": "gamer_playbook",
197
+ "description": "Inspect viewport dimensions and active canvas/focus state, then guide writing a Playbook rule set for CLI `run` or MCP `gamer_play`.",
198
+ "arguments": {
199
+ "type": "object",
200
+ "properties": {
201
+ "goal": {
202
+ "type": "string",
203
+ "description": "Short description of the mission or interactive task."
204
+ }
205
+ }
206
+ }
207
+ }
208
+ ],
209
+ "tools": [
210
+ {
211
+ "name": "gamer_play",
212
+ "description": "Runs a bounded ~8-12 Hz local Gate v2.0 vision/NLI playbook loop and returns compacted Run-Length Encoded transitions plus an optional final JPEG frame for LLM re-planning.",
213
+ "requiresSession": true,
214
+ "inputSchema": {
215
+ "type": "object",
216
+ "properties": {
217
+ "rules": {
218
+ "type": "array",
219
+ "description": "Playbook rules mapping 'when' conditions to 'do' actions.",
220
+ "items": {
221
+ "type": "object",
222
+ "required": ["when", "do"],
223
+ "properties": {
224
+ "when": { "type": "string" },
225
+ "do": { "type": "object" },
226
+ "min_conf": { "type": "number" },
227
+ "yield": { "type": "boolean" },
228
+ "cooldown_ms": { "type": "number" }
229
+ }
230
+ }
231
+ },
232
+ "rules_file": { "type": "string", "description": "Optional path to a JSON playbook file." },
233
+ "steps": { "type": "number", "description": "Max decision ticks (1-200, default 30)." },
234
+ "max_ms": { "type": "number", "description": "Max burst duration in ms (200-30000, default 6000)." },
235
+ "interval_ms": { "type": "number", "description": "Loop interval in ms (50-2000, default 100)." },
236
+ "min_conf": { "type": "number", "description": "Minimum confidence (0-1, default 0.45)." },
237
+ "yield_on_low_conf": { "type": "number", "description": "Stop after N consecutive low-confidence ticks." },
238
+ "stop_if": { "type": "string", "description": "Optional Gate yesNo stop condition." },
239
+ "stop_conf": { "type": "number", "description": "Confidence threshold for stop_if (default 0.65)." },
240
+ "stop_check_every": { "type": "number", "description": "Check stop_if every N ticks (default 1)." },
241
+ "clip": { "description": "CSS selector string or {x, y, w, h} crop rect." },
242
+ "text_selector": { "type": "string", "description": "Optional DOM selector for Gate text NLI mode." },
243
+ "focus": { "description": "Selector to focus before starting, or false to skip." },
244
+ "quality": { "type": "number", "description": "JPEG screenshot quality (25-95, default 65)." },
245
+ "return_frame": { "type": "boolean", "description": "Attach final JPEG frame inline (default true)." }
246
+ }
247
+ }
248
+ },
249
+ {
250
+ "name": "gamer_decide",
251
+ "description": "Evaluates a single live frame (or selector text) using Gate v2.0 decide, yesNo, or score to calibrate labels or check state without burning LLM vision tokens.",
252
+ "requiresSession": true,
253
+ "inputSchema": {
254
+ "type": "object",
255
+ "properties": {
256
+ "choices": { "type": "array", "items": { "type": "string" }, "description": "2-64 choice labels." },
257
+ "ask": { "type": "string", "description": "Statement for Gate yesNo." },
258
+ "levels": { "type": "array", "items": { "type": "string" }, "description": "2-64 ordered rubric levels." },
259
+ "clip": { "description": "Optional CSS selector or {x, y, w, h} crop rect." },
260
+ "text_selector": { "type": "string", "description": "Optional DOM selector for Gate text NLI." },
261
+ "quality": { "type": "number", "description": "JPEG quality (25-95, default 65)." },
262
+ "return_frame": { "type": "boolean", "description": "Attach captured JPEG frame inline (default false)." }
263
+ }
264
+ }
265
+ },
266
+ {
267
+ "name": "gamer_act",
268
+ "description": "Dispatches an immediate keyboard, mouse click/hold, drag, or pointer-lock look input via CDP.",
269
+ "requiresSession": true,
270
+ "inputSchema": {
271
+ "type": "object",
272
+ "required": ["type"],
273
+ "properties": {
274
+ "type": {
275
+ "type": "string",
276
+ "enum": ["hold", "tap", "click", "mouse_hold", "drag", "look", "idle", "yield"]
277
+ },
278
+ "keys": { "type": "array", "items": { "type": "string" } },
279
+ "button": { "type": "string", "enum": ["left", "right", "middle"] },
280
+ "x": { "type": "number" },
281
+ "y": { "type": "number" },
282
+ "x1": { "type": "number" },
283
+ "y1": { "type": "number" },
284
+ "x2": { "type": "number" },
285
+ "y2": { "type": "number" },
286
+ "dx": { "type": "number" },
287
+ "dy": { "type": "number" },
288
+ "steps": { "type": "number" },
289
+ "hold_ms": { "type": "number" },
290
+ "focus": { "description": "Optional selector to focus before input, or false to skip." }
291
+ }
292
+ }
293
+ }
294
+ ]
295
+ }