@vellumai/assistant 0.11.10-dev.202609091114.7b6342c → 0.11.10-dev.202609091224.201657f
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/package.json
CHANGED
|
@@ -31,18 +31,46 @@ Marks are drawn on the frame around the surface the user is sharing with the
|
|
|
31
31
|
call. With nothing shared there is nowhere to draw, and `screen_point_at`
|
|
32
32
|
fails saying so. Ask them to share their screen from the call, then point.
|
|
33
33
|
|
|
34
|
-
##
|
|
34
|
+
## Say what to point at
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
**Name the thing.** `{"target": "color balance", "caption": "Click this"}`.
|
|
37
|
+
The name is looked up on the surface itself, which knows where its controls
|
|
38
|
+
actually are, so the ring lands on the thing rather than near it.
|
|
39
|
+
|
|
40
|
+
**The label, not a description of it.** What is matched is the control's own
|
|
41
|
+
name. Casing, spacing and punctuation are forgiven, so `Color Balance` finds
|
|
42
|
+
`color balance`; nothing beyond that is, so "the stabilization button" finds
|
|
43
|
+
nothing, because no control is called that. Give the label on its own:
|
|
44
|
+
`stabilization`, `Send`, `Search`.
|
|
45
|
+
|
|
46
|
+
You are answered with what was drawn and the name it resolved to, which is not
|
|
47
|
+
always the name you asked for. Say the resolved one out loud: it is the word
|
|
48
|
+
the user can see.
|
|
39
49
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
50
|
+
A name the surface does not carry draws nothing and comes back with the names
|
|
51
|
+
it does carry. That is the answer, not a setback: the thing is nearly always
|
|
52
|
+
one of those, so read the list and point again. Do not fall back to guessing
|
|
53
|
+
coordinates for something that simply is not there. What the user calls
|
|
54
|
+
something and what the surface calls it often differ, which is what the list
|
|
55
|
+
is for: they may say "white balance" where the control reads `color balance`,
|
|
56
|
+
or "the stabilization button" where it reads `stabilization`.
|
|
43
57
|
|
|
44
|
-
|
|
45
|
-
|
|
58
|
+
## Coordinates, for what has no name
|
|
59
|
+
|
|
60
|
+
Only for something the surface cannot name: a region of an image, a spot on a
|
|
61
|
+
canvas, a control a plugin draws itself. You will know, because naming it
|
|
62
|
+
comes back saying so.
|
|
63
|
+
|
|
64
|
+
Fractions of the shared surface, `0` to `1`, measured against **the picture of
|
|
65
|
+
that surface you were last shown**. `x` and `y` are the top-left corner,
|
|
66
|
+
`width` and `height` the size. Give the bounds of the thing itself: the ring is
|
|
67
|
+
drawn around them, so a box tight on a button reads as a ring around that
|
|
68
|
+
button, and a box drawn where you think the ring should go puts the ring
|
|
69
|
+
outside that instead.
|
|
70
|
+
|
|
71
|
+
These are a guess measured off a picture that has been scaled on its way to
|
|
72
|
+
you, and they are only as fresh as the last frame you were sent. If the user
|
|
73
|
+
has scrolled or moved a window since, say what you are pointing at as well as
|
|
46
74
|
drawing it, so a mark that has drifted is still recoverable in words.
|
|
47
75
|
|
|
48
76
|
Moving the share is the one kind of drift that is caught for you. A mark
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"tools": [
|
|
4
4
|
{
|
|
5
5
|
"name": "screen_point_at",
|
|
6
|
-
"description": "Point at something on the screen the user is sharing with the call: draws a ring around it, with a short caption beside it. Replaces whatever is currently drawn.\n\
|
|
6
|
+
"description": "Point at something on the screen the user is sharing with the call: draws a ring around it, with a short caption beside it. Replaces whatever is currently drawn.\n\nName what to point at with `target`, written the way the control's own label is written: \"color balance\", \"Send\", \"Search\". The name is looked up on the surface itself, so the ring lands on the control rather than near it. Prefer this always. A name the surface does not carry draws nothing and comes back with the names it does carry, to point again with or to say out loud.\n\nGive `x`/`y`/`width`/`height` only for something with no label to find it by: a region of an image, a spot on a canvas, a plugin's own drawing. They are fractions of the shared surface, 0 to 1, measured against the picture you were last shown, and they are a guess at where the thing is rather than a reading of it.\n\nRequires the user to be sharing their screen. If nothing is shared this fails, and the right move is to ask them to share before pointing again.",
|
|
7
7
|
"category": "screen-annotation",
|
|
8
8
|
"risk": "low",
|
|
9
9
|
"input_schema": {
|
|
@@ -15,14 +15,31 @@
|
|
|
15
15
|
"maxItems": 4,
|
|
16
16
|
"items": {
|
|
17
17
|
"type": "object",
|
|
18
|
+
"description": "One thing to point at: either `target` naming it, or all four bounds giving its rectangle. Naming is exact; bounds are estimated, so name it whenever it has a name. One or the other, never both and never part of either.",
|
|
19
|
+
"oneOf": [
|
|
20
|
+
{
|
|
21
|
+
"description": "Named, and found on the surface.",
|
|
22
|
+
"required": ["target"]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"description": "Measured off the last picture, for something with no name to find it by. All four bounds or none.",
|
|
26
|
+
"required": ["x", "y", "width", "height"]
|
|
27
|
+
}
|
|
28
|
+
],
|
|
18
29
|
"properties": {
|
|
30
|
+
"target": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"minLength": 1,
|
|
33
|
+
"maxLength": 120,
|
|
34
|
+
"description": "The control's label, written the way the label itself is written: \"color balance\", \"Send\". Looked up on the surface, so it lands exactly. Leave out only when the thing has no label."
|
|
35
|
+
},
|
|
19
36
|
"x": {
|
|
20
37
|
"type": "number",
|
|
21
|
-
"description": "Left edge
|
|
38
|
+
"description": "Left edge as a fraction of the shared surface's width (0 to 1). Only for something `target` cannot name."
|
|
22
39
|
},
|
|
23
40
|
"y": {
|
|
24
41
|
"type": "number",
|
|
25
|
-
"description": "Top edge
|
|
42
|
+
"description": "Top edge as a fraction of the shared surface's height (0 to 1). Only for something `target` cannot name."
|
|
26
43
|
},
|
|
27
44
|
"width": {
|
|
28
45
|
"type": "number",
|
|
@@ -37,8 +54,7 @@
|
|
|
37
54
|
"maxLength": 80,
|
|
38
55
|
"description": "A short imperative for what to do with it, e.g. \"Click Share\". Say the rest out loud."
|
|
39
56
|
}
|
|
40
|
-
}
|
|
41
|
-
"required": ["x", "y", "width", "height"]
|
|
57
|
+
}
|
|
42
58
|
}
|
|
43
59
|
},
|
|
44
60
|
"target_client_id": {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
1
3
|
import { describe, expect, test } from "bun:test";
|
|
2
4
|
|
|
3
5
|
import type { ToolContext } from "../../../../tools/types.js";
|
|
@@ -72,3 +74,68 @@ describe("screen_clear_marks", () => {
|
|
|
72
74
|
});
|
|
73
75
|
});
|
|
74
76
|
});
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The shape of a mark, as the model is told it.
|
|
80
|
+
*
|
|
81
|
+
* The published schema is the only account of the contract the model ever
|
|
82
|
+
* sees: a mark it composes from that schema and sends is rejected on the host
|
|
83
|
+
* by a union that admits exactly two shapes, and the model has no way to
|
|
84
|
+
* learn why. So the schema carries the same two shapes.
|
|
85
|
+
*/
|
|
86
|
+
describe("the published mark schema", () => {
|
|
87
|
+
interface OneOfBranch {
|
|
88
|
+
required?: string[];
|
|
89
|
+
}
|
|
90
|
+
interface ItemSchema {
|
|
91
|
+
oneOf?: OneOfBranch[];
|
|
92
|
+
properties?: Record<string, unknown>;
|
|
93
|
+
}
|
|
94
|
+
const toolsJson = JSON.parse(
|
|
95
|
+
readFileSync(join(import.meta.dir, "..", "TOOLS.json"), "utf-8"),
|
|
96
|
+
) as {
|
|
97
|
+
tools: {
|
|
98
|
+
name: string;
|
|
99
|
+
input_schema: { properties: { marks: { items: ItemSchema } } };
|
|
100
|
+
}[];
|
|
101
|
+
};
|
|
102
|
+
const item = toolsJson.tools.find((tool) => tool.name === "screen_point_at")!
|
|
103
|
+
.input_schema.properties.marks.items;
|
|
104
|
+
|
|
105
|
+
/** `oneOf` as JSON Schema reads it: satisfied by exactly one branch. */
|
|
106
|
+
const accepts = (mark: Record<string, unknown>): boolean => {
|
|
107
|
+
const fits = (item.oneOf ?? []).filter((branch) =>
|
|
108
|
+
(branch.required ?? []).every((key) => key in mark),
|
|
109
|
+
);
|
|
110
|
+
return fits.length === 1;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
test("a named target is a mark", () => {
|
|
114
|
+
expect(accepts({ target: "Send" })).toBe(true);
|
|
115
|
+
expect(accepts({ target: "Send", caption: "Click this" })).toBe(true);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
test("all four bounds are a mark", () => {
|
|
119
|
+
expect(accepts({ x: 0.1, y: 0.2, width: 0.3, height: 0.1 })).toBe(true);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
test("neither shape, or half of one, is not a mark", () => {
|
|
123
|
+
expect(accepts({})).toBe(false);
|
|
124
|
+
expect(accepts({ caption: "Click this" })).toBe(false);
|
|
125
|
+
expect(accepts({ x: 0.2 })).toBe(false);
|
|
126
|
+
expect(accepts({ x: 0.1, y: 0.2, width: 0.3 })).toBe(false);
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
/** An empty name is a name of nothing, and the host rejects it as one. */
|
|
130
|
+
test("a target has to say something", () => {
|
|
131
|
+
const target = item.properties?.target as { minLength?: number };
|
|
132
|
+
expect(target.minLength).toBe(1);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
/** Both shapes at once names a target and estimates it in the same breath. */
|
|
136
|
+
test("a name and bounds together is not a mark", () => {
|
|
137
|
+
expect(
|
|
138
|
+
accepts({ target: "Send", x: 0.1, y: 0.2, width: 0.3, height: 0.1 }),
|
|
139
|
+
).toBe(false);
|
|
140
|
+
});
|
|
141
|
+
});
|