@minicor/mcp-server 4.7.0 → 4.9.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/README.md +100 -10
- package/dist/__live__/blueprints.live.test.d.ts +2 -0
- package/dist/__live__/blueprints.live.test.d.ts.map +1 -0
- package/dist/__live__/blueprints.live.test.js +610 -0
- package/dist/__live__/blueprints.live.test.js.map +1 -0
- package/dist/__tests__/blueprints-tools.test.d.ts +2 -0
- package/dist/__tests__/blueprints-tools.test.d.ts.map +1 -0
- package/dist/__tests__/blueprints-tools.test.js +1190 -0
- package/dist/__tests__/blueprints-tools.test.js.map +1 -0
- package/dist/__tests__/config-stores.test.js +8 -7
- package/dist/__tests__/config-stores.test.js.map +1 -1
- package/dist/__tests__/dev-mode-draft.test.js +9 -10
- package/dist/__tests__/dev-mode-draft.test.js.map +1 -1
- package/dist/__tests__/discovery.test.js +6 -5
- package/dist/__tests__/discovery.test.js.map +1 -1
- package/dist/__tests__/helpers.test.js +20 -0
- package/dist/__tests__/helpers.test.js.map +1 -1
- package/dist/__tests__/http-server.test.js +118 -0
- package/dist/__tests__/http-server.test.js.map +1 -1
- package/dist/__tests__/jobs-tools.test.js +76 -0
- package/dist/__tests__/jobs-tools.test.js.map +1 -1
- package/dist/__tests__/mds-errors.test.d.ts +2 -0
- package/dist/__tests__/mds-errors.test.d.ts.map +1 -0
- package/dist/__tests__/mds-errors.test.js +91 -0
- package/dist/__tests__/mds-errors.test.js.map +1 -0
- package/dist/__tests__/server-surface.test.js +19 -0
- package/dist/__tests__/server-surface.test.js.map +1 -1
- package/dist/__tests__/state.test.js +104 -44
- package/dist/__tests__/state.test.js.map +1 -1
- package/dist/__tests__/vm-broker.test.d.ts +2 -0
- package/dist/__tests__/vm-broker.test.d.ts.map +1 -0
- package/dist/__tests__/vm-broker.test.js +812 -0
- package/dist/__tests__/vm-broker.test.js.map +1 -0
- package/dist/__tests__/vm-management.test.d.ts +2 -0
- package/dist/__tests__/vm-management.test.d.ts.map +1 -0
- package/dist/__tests__/vm-management.test.js +507 -0
- package/dist/__tests__/vm-management.test.js.map +1 -0
- package/dist/agent-service-client.d.ts +12 -0
- package/dist/agent-service-client.d.ts.map +1 -1
- package/dist/agent-service-client.js +74 -0
- package/dist/agent-service-client.js.map +1 -1
- package/dist/bootstrap-perms.d.ts +12 -0
- package/dist/bootstrap-perms.d.ts.map +1 -0
- package/dist/bootstrap-perms.js +92 -0
- package/dist/bootstrap-perms.js.map +1 -0
- package/dist/bootstrap.js +2 -63
- package/dist/bootstrap.js.map +1 -1
- package/dist/helpers.d.ts +14 -2
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +12 -3
- package/dist/helpers.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/lds-client.d.ts +59 -10
- package/dist/lds-client.d.ts.map +1 -1
- package/dist/lds-client.js +53 -9
- package/dist/lds-client.js.map +1 -1
- package/dist/lib.d.ts +6 -0
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +5 -1
- package/dist/lib.js.map +1 -1
- package/dist/mds-errors.d.ts +32 -0
- package/dist/mds-errors.d.ts.map +1 -0
- package/dist/mds-errors.js +61 -0
- package/dist/mds-errors.js.map +1 -0
- package/dist/middleware-service-client.d.ts +286 -0
- package/dist/middleware-service-client.d.ts.map +1 -1
- package/dist/middleware-service-client.js +143 -1
- package/dist/middleware-service-client.js.map +1 -1
- package/dist/server-surface.d.ts +2 -0
- package/dist/server-surface.d.ts.map +1 -1
- package/dist/server-surface.js +31 -3
- package/dist/server-surface.js.map +1 -1
- package/dist/state.d.ts +28 -14
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +58 -40
- package/dist/state.js.map +1 -1
- package/dist/sync.js +5 -2
- package/dist/sync.js.map +1 -1
- package/dist/tools/agents.d.ts.map +1 -1
- package/dist/tools/agents.js +2 -3
- package/dist/tools/agents.js.map +1 -1
- package/dist/tools/blueprints.d.ts +20 -0
- package/dist/tools/blueprints.d.ts.map +1 -0
- package/dist/tools/blueprints.js +1193 -0
- package/dist/tools/blueprints.js.map +1 -0
- package/dist/tools/config-stores.d.ts.map +1 -1
- package/dist/tools/config-stores.js +11 -12
- package/dist/tools/config-stores.js.map +1 -1
- package/dist/tools/context.d.ts.map +1 -1
- package/dist/tools/context.js +1 -2
- package/dist/tools/context.js.map +1 -1
- package/dist/tools/core.d.ts.map +1 -1
- package/dist/tools/core.js +2 -3
- package/dist/tools/core.js.map +1 -1
- package/dist/tools/dev-mode-draft.d.ts.map +1 -1
- package/dist/tools/dev-mode-draft.js +16 -17
- package/dist/tools/dev-mode-draft.js.map +1 -1
- package/dist/tools/discovery.d.ts.map +1 -1
- package/dist/tools/discovery.js +7 -8
- package/dist/tools/discovery.js.map +1 -1
- package/dist/tools/issues.d.ts.map +1 -1
- package/dist/tools/issues.js +7 -8
- package/dist/tools/issues.js.map +1 -1
- package/dist/tools/jobs.d.ts.map +1 -1
- package/dist/tools/jobs.js +58 -7
- package/dist/tools/jobs.js.map +1 -1
- package/dist/tools/session.d.ts.map +1 -1
- package/dist/tools/session.js +9 -10
- package/dist/tools/session.js.map +1 -1
- package/dist/tools/skills.d.ts.map +1 -1
- package/dist/tools/skills.js +2 -3
- package/dist/tools/skills.js.map +1 -1
- package/dist/tools/sync-tools.d.ts.map +1 -1
- package/dist/tools/sync-tools.js +2 -3
- package/dist/tools/sync-tools.js.map +1 -1
- package/dist/tools/tasks.d.ts +3 -0
- package/dist/tools/tasks.d.ts.map +1 -0
- package/dist/tools/tasks.js +51 -0
- package/dist/tools/tasks.js.map +1 -0
- package/dist/tools/tfa.d.ts.map +1 -1
- package/dist/tools/tfa.js +14 -5
- package/dist/tools/tfa.js.map +1 -1
- package/dist/tools/vm-rpa.d.ts +2 -1
- package/dist/tools/vm-rpa.d.ts.map +1 -1
- package/dist/tools/vm-rpa.js +82 -38
- package/dist/tools/vm-rpa.js.map +1 -1
- package/dist/tools/vm.d.ts +2 -1
- package/dist/tools/vm.d.ts.map +1 -1
- package/dist/tools/vm.js +511 -114
- package/dist/tools/vm.js.map +1 -1
- package/dist/tools/workflow-ops.d.ts.map +1 -1
- package/dist/tools/workflow-ops.js.map +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/vm-service-client.d.ts +8 -2
- package/dist/vm-service-client.d.ts.map +1 -1
- package/dist/vm-service-client.js.map +1 -1
- package/dist/vm-target.d.ts +55 -0
- package/dist/vm-target.d.ts.map +1 -0
- package/dist/vm-target.js +134 -0
- package/dist/vm-target.js.map +1 -0
- package/package.json +2 -1
- package/skills/general/blueprint-vm-walkthrough.md +162 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: blueprint-vm-walkthrough
|
|
3
|
+
description: Run a guided VM walkthrough session that teaches a blueprint - the user narrates a process on a live VM while you capture screenshots, ground UI boundaries, and persist everything as blueprint library entries (walkthrough + screenshots + screen-maps + anchors). Use when a user wants to walk you through a process on a VM to build or enrich a blueprint.
|
|
4
|
+
category: general
|
|
5
|
+
tags: [blueprint, walkthrough, vm, screen-map, anchor, onboarding]
|
|
6
|
+
priority: 10
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Blueprint VM Walkthrough
|
|
10
|
+
|
|
11
|
+
A walkthrough is a conversational session over a live VM: the user (or you)
|
|
12
|
+
drives the target application step by step while you capture the screens,
|
|
13
|
+
ground the UI elements, and persist the whole session into the blueprint's
|
|
14
|
+
library. The output feeds `blueprint_synthesize` — the walkthrough transcript
|
|
15
|
+
is context, and the screen-maps/anchors/screenshots it produces are
|
|
16
|
+
runtime-referenceable resources (`entry://<id>#<fragment>`).
|
|
17
|
+
|
|
18
|
+
**Persistence contract: create early, update often.** The walkthrough entry is
|
|
19
|
+
your session store — there is no other one. Create it the moment the session
|
|
20
|
+
starts and PATCH it after EVERY step so a crash or disconnect loses at most
|
|
21
|
+
one step.
|
|
22
|
+
|
|
23
|
+
## Step 0: Preflight
|
|
24
|
+
|
|
25
|
+
1. `vm_list` — find a deployed VM with a live agent. If MDS isn't running,
|
|
26
|
+
`start_mds_on_vm`; if none exists, `deploy_vm`.
|
|
27
|
+
2. `vm_connect` (local MCP) or carry `vmId + workspaceId` on every `vm_*` call
|
|
28
|
+
(hosted MCP). The same hosted-MCP rule applies to every `blueprint_*` call:
|
|
29
|
+
`workspaceId` is a required parameter on all of them, so pass it alongside
|
|
30
|
+
`blueprintId` in each example below.
|
|
31
|
+
3. Confirm the blueprint: `blueprint_get` (or `blueprint_create` for a fresh
|
|
32
|
+
one). Note the `blueprintId` — every persistence call needs it.
|
|
33
|
+
4. Tell the user where to watch: the onboarding studio's VM viewer streams the
|
|
34
|
+
same VM's screen, so they can follow along (and drive) while you work.
|
|
35
|
+
|
|
36
|
+
## Step 1: Open the walkthrough entry IMMEDIATELY
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
blueprint_add_entry blueprintId=<id> kind=walkthrough
|
|
40
|
+
title="Walkthrough: <process name> (<date>)"
|
|
41
|
+
content={ "transcript": [], "filmstrip": [], "artifactRefs": [] }
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Save the returned `entryId` — you will PATCH this entry after every step
|
|
45
|
+
(`blueprint_add_entry entryId=<entryId> content=<updated WalkthroughContent>`).
|
|
46
|
+
|
|
47
|
+
`WalkthroughContent` shape:
|
|
48
|
+
|
|
49
|
+
- `transcript`: `[{ role: "agent" | "user", text, at }]` — the conversation, oldest first
|
|
50
|
+
- `filmstrip`: `[{ ref, caption, at, click?: {x, y}, stepHint? }]` — captured screens, oldest first
|
|
51
|
+
- `artifactRefs`: `entry://` refs of sibling entries the session produced (screen-maps, anchors)
|
|
52
|
+
|
|
53
|
+
## Step 2: The per-step loop
|
|
54
|
+
|
|
55
|
+
For each step the user narrates ("now I open the invoice screen and click
|
|
56
|
+
Export"):
|
|
57
|
+
|
|
58
|
+
### 2a. Drive
|
|
59
|
+
|
|
60
|
+
The user drives on the studio viewer, or you drive via `vm_execute_script`
|
|
61
|
+
(pyautogui for desktop, CDP for browsers). Verify the screen settled with
|
|
62
|
+
`vm_screenshot` before capturing.
|
|
63
|
+
|
|
64
|
+
### 2b. Capture — screenshot into the library
|
|
65
|
+
|
|
66
|
+
The VM PUTs the screenshot to blob storage itself (no image bytes through the
|
|
67
|
+
MCP):
|
|
68
|
+
|
|
69
|
+
1. `blueprint_entry_upload_url blueprintId=<id> fileName="step-<n>-<screen>.png"`
|
|
70
|
+
→ `{ uploadUrl, blobRef }`
|
|
71
|
+
2. Capture + upload FROM the VM:
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
# vm_execute_script
|
|
75
|
+
from PIL import ImageGrab
|
|
76
|
+
import io, requests
|
|
77
|
+
|
|
78
|
+
img = ImageGrab.grab()
|
|
79
|
+
buf = io.BytesIO()
|
|
80
|
+
img.save(buf, format="PNG")
|
|
81
|
+
r = requests.put(
|
|
82
|
+
"<uploadUrl>",
|
|
83
|
+
data=buf.getvalue(),
|
|
84
|
+
headers={"Content-Type": "image/png"},
|
|
85
|
+
)
|
|
86
|
+
print(r.status_code) # expect 200
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
3. `blueprint_add_entry blueprintId=<id> kind=screenshot title="Step <n>: <screen>"
|
|
90
|
+
blobRef=<blobRef> fileName=... contentType="image/png"` → screenshot `entryId`
|
|
91
|
+
4. Append to the walkthrough's `filmstrip`:
|
|
92
|
+
`{ "ref": "entry://<screenshotEntryId>", "caption": "<what happened>", "click": {"x": .., "y": ..} }`
|
|
93
|
+
(record `click` when the step was a click — the coordinates you or the user used).
|
|
94
|
+
|
|
95
|
+
### 2c. Ground — element boundaries
|
|
96
|
+
|
|
97
|
+
- `vm_inspect_ui` mode `element_tree` (or `element_at_point` for one control)
|
|
98
|
+
— the element RECTS are the boundary source of truth.
|
|
99
|
+
- The user dictates names and flags conversationally ("that's the amount
|
|
100
|
+
field, mask it in recordings") → accumulate boundaries for this screen:
|
|
101
|
+
`{ name, rect: {x, y, w, h}, flags: { verify?, viewport?, redact? }, note? }`.
|
|
102
|
+
- Click order matters: keep the boundaries array in the order the process
|
|
103
|
+
touches them — reference order IS the grounding contract.
|
|
104
|
+
|
|
105
|
+
### 2d. Transcript + persist
|
|
106
|
+
|
|
107
|
+
Append the exchange to `transcript` (both the user's narration and your
|
|
108
|
+
descriptions), then PATCH the walkthrough entry:
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
blueprint_add_entry blueprintId=<id> entryId=<walkthroughEntryId>
|
|
112
|
+
content=<full updated WalkthroughContent>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Then move to the next step.
|
|
116
|
+
|
|
117
|
+
## Step 3: Anchors (per stable screen)
|
|
118
|
+
|
|
119
|
+
For each screen the automation must recognize deterministically, pick 2-4
|
|
120
|
+
distinctive regions (logos, fixed labels, unique chrome — NOT data that
|
|
121
|
+
changes per record). Verify each region is legible at native resolution with
|
|
122
|
+
`vm_screenshot_region`, then persist:
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
blueprint_add_entry blueprintId=<id> kind=anchor title="Anchor: <screen name>"
|
|
126
|
+
content={ "name": "<screen>", "threshold": 0.9,
|
|
127
|
+
"imageRef": "entry://<screenshotEntryId>",
|
|
128
|
+
"points": [{ "x":.., "y":.., "w":.., "h":.., "label": "<region>" }] }
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Step 4: Finalize
|
|
132
|
+
|
|
133
|
+
1. One `screen-map` entry per named screen, from the boundaries gathered in 2c:
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
blueprint_add_entry blueprintId=<id> kind=screen-map title="Screen map: <screen>"
|
|
137
|
+
content={ "pages": [{ "name": "<screen>",
|
|
138
|
+
"screenshotRef": "entry://<screenshotEntryId>",
|
|
139
|
+
"boundaries": [ ... ] }] }
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Steps reference boundaries as `entry://<screenMapEntryId>#<page>.<boundary>`.
|
|
143
|
+
2. Collect every produced `entry://` ref into the walkthrough's
|
|
144
|
+
`artifactRefs` and make the final PATCH.
|
|
145
|
+
3. Close the loop: the library moved, so the spec is stale —
|
|
146
|
+
`blueprint_synthesize blueprintId=<id>`, then review/apply the proposal and
|
|
147
|
+
`blueprint_build`. `resolve_blueprint_state` confirms where you are.
|
|
148
|
+
|
|
149
|
+
## Known issues
|
|
150
|
+
|
|
151
|
+
- Upload URLs are GCS signed URLs: a plain PUT with the file's `Content-Type`
|
|
152
|
+
is the whole contract (success is a 200). Don't add storage-specific headers
|
|
153
|
+
like Azure's `x-ms-blob-type` — GCS ignores stray extension headers, but
|
|
154
|
+
they're wrong for this backend and will confuse debugging.
|
|
155
|
+
- Upload URLs are short-lived — request one per screenshot, right before the PUT.
|
|
156
|
+
- `blueprint_entry_upload_url` returning blocked (blob storage unconfigured):
|
|
157
|
+
fall back to text-only capture — describe each screen in the transcript and
|
|
158
|
+
skip filmstrip refs; the walkthrough is still valuable synthesis context.
|
|
159
|
+
- On a broker (multi-session) VM, every `vm_execute_script` / `vm_screenshot`
|
|
160
|
+
needs `targetUser`.
|
|
161
|
+
- Don't batch persistence "for later" — the create-early-update-often entry IS
|
|
162
|
+
the crash recovery.
|