tapline-host 1.4.0 → 1.6.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/dist/accounts.d.ts +72 -0
- package/dist/accounts.js +208 -0
- package/dist/accounts.js.map +1 -0
- package/dist/actionlog.d.ts +20 -0
- package/dist/actionlog.js.map +1 -1
- package/dist/animations.d.ts +39 -0
- package/dist/animations.js +124 -0
- package/dist/animations.js.map +1 -0
- package/dist/api.d.ts +43 -0
- package/dist/api.js +154 -0
- package/dist/api.js.map +1 -0
- package/dist/audit.d.ts +3 -0
- package/dist/audit.js +1 -1
- package/dist/audit.js.map +1 -1
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +19 -0
- package/dist/bin.js.map +1 -0
- package/dist/brief.d.ts +41 -0
- package/dist/brief.js +78 -0
- package/dist/brief.js.map +1 -0
- package/dist/cli.d.ts +41 -1
- package/dist/cli.js +100 -53
- package/dist/cli.js.map +1 -1
- package/dist/conditions.d.ts +36 -0
- package/dist/conditions.js +67 -0
- package/dist/conditions.js.map +1 -0
- package/dist/confirm.d.ts +21 -2
- package/dist/confirm.js +39 -6
- package/dist/confirm.js.map +1 -1
- package/dist/dispatch.d.ts +27 -0
- package/dist/dispatch.js +114 -0
- package/dist/dispatch.js.map +1 -0
- package/dist/doctor.d.ts +5 -0
- package/dist/doctor.js +20 -0
- package/dist/doctor.js.map +1 -1
- package/dist/drive.d.ts +184 -0
- package/dist/drive.js +908 -0
- package/dist/drive.js.map +1 -0
- package/dist/elicit.d.ts +90 -0
- package/dist/elicit.js +179 -0
- package/dist/elicit.js.map +1 -0
- package/dist/format.d.ts +16 -0
- package/dist/format.js +81 -24
- package/dist/format.js.map +1 -1
- package/dist/images.d.ts +35 -0
- package/dist/images.js +76 -6
- package/dist/images.js.map +1 -1
- package/dist/inspect.d.ts +1 -0
- package/dist/journey.d.ts +276 -0
- package/dist/journey.js +368 -0
- package/dist/journey.js.map +1 -0
- package/dist/journeyexport.d.ts +58 -0
- package/dist/journeyexport.js +318 -0
- package/dist/journeyexport.js.map +1 -0
- package/dist/journeygif.d.ts +62 -0
- package/dist/journeygif.js +192 -0
- package/dist/journeygif.js.map +1 -0
- package/dist/journeyreport.d.ts +202 -0
- package/dist/journeyreport.js +666 -0
- package/dist/journeyreport.js.map +1 -0
- package/dist/mapcmd.d.ts +200 -0
- package/dist/mapcmd.js +412 -0
- package/dist/mapcmd.js.map +1 -0
- package/dist/mapfile.d.ts +155 -0
- package/dist/mapfile.js +575 -0
- package/dist/mapfile.js.map +1 -0
- package/dist/mcp.d.ts +14 -11
- package/dist/mcp.js +50 -318
- package/dist/mcp.js.map +1 -1
- package/dist/media.d.ts +88 -0
- package/dist/media.js +263 -0
- package/dist/media.js.map +1 -0
- package/dist/nochange.d.ts +77 -0
- package/dist/nochange.js +77 -0
- package/dist/nochange.js.map +1 -0
- package/dist/places.d.ts +239 -0
- package/dist/places.js +823 -0
- package/dist/places.js.map +1 -0
- package/dist/policy.d.ts +18 -0
- package/dist/policy.js +52 -0
- package/dist/policy.js.map +1 -1
- package/dist/protocol.d.ts +27 -1
- package/dist/protocol.js +25 -0
- package/dist/protocol.js.map +1 -1
- package/dist/reflexes.d.ts +59 -0
- package/dist/reflexes.js +133 -0
- package/dist/reflexes.js.map +1 -0
- package/dist/report.d.ts +32 -2
- package/dist/report.js +154 -9
- package/dist/report.js.map +1 -1
- package/dist/routes.d.ts +115 -0
- package/dist/routes.js +287 -0
- package/dist/routes.js.map +1 -0
- package/dist/run.d.ts +28 -1
- package/dist/run.js +32 -3
- package/dist/run.js.map +1 -1
- package/dist/runtime.d.ts +60 -0
- package/dist/runtime.js +255 -0
- package/dist/runtime.js.map +1 -0
- package/dist/script.d.ts +114 -10
- package/dist/script.js +30 -2
- package/dist/script.js.map +1 -1
- package/dist/server.d.ts +48 -2
- package/dist/server.js +88 -13
- package/dist/server.js.map +1 -1
- package/dist/thincall.d.ts +13 -0
- package/dist/thincall.js +335 -0
- package/dist/thincall.js.map +1 -0
- package/dist/tool-text-data.d.ts +10 -5
- package/dist/tool-text-data.js +11 -6
- package/dist/tool-text-data.js.map +1 -1
- package/dist/tool-text.d.ts +1 -1
- package/dist/tools.d.ts +585 -5
- package/dist/tools.js +2926 -185
- package/dist/tools.js.map +1 -1
- package/dist/uxcheck.d.ts +103 -0
- package/dist/uxcheck.js +128 -0
- package/dist/uxcheck.js.map +1 -0
- package/package.json +3 -2
- package/skills/tapline/SKILL.md +57 -11
- package/skills/tapline/references/personas.md +45 -0
- package/skills/tapline/references/setup.md +6 -1
package/dist/routes.js
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import { readFileSync, statSync } from "node:fs";
|
|
2
|
+
import { join, resolve, sep } from "node:path";
|
|
3
|
+
import { insideDir, loadMap, readRouteSync, saveMap, saveRouteFile } from "./mapfile.js";
|
|
4
|
+
import { sharedScriptV2Schema } from "./script.js";
|
|
5
|
+
// Routes (AGENT-TOOLS 1.13 §18.5, §9.4): a script in version 2 that starts at a place, with variables. A route lives in
|
|
6
|
+
// the map folder's `routes/` and is listed in the map's `routes`. Nothing here stores a value taken from a screen: a
|
|
7
|
+
// variable is a name, its value comes with the call, and an account's value stays a placeholder (§18.6).
|
|
8
|
+
const ROUTE_NAME_MAX = 60;
|
|
9
|
+
/** A route's name reduced to the characters a file name may keep (letters, digits, '.', '_', '-'); null when nothing is left. */
|
|
10
|
+
export function routeSlug(raw) {
|
|
11
|
+
const reduced = raw
|
|
12
|
+
.trim()
|
|
13
|
+
.replace(/[^A-Za-z0-9._-]+/g, "_")
|
|
14
|
+
.replace(/^[^A-Za-z0-9]+/, "")
|
|
15
|
+
.slice(0, ROUTE_NAME_MAX)
|
|
16
|
+
// Windows drops trailing dots and spaces from a file name.
|
|
17
|
+
.replace(/[._]+$/, "");
|
|
18
|
+
if (reduced === "")
|
|
19
|
+
return null;
|
|
20
|
+
// Device names such as CON or NUL can't be files on Windows (the rule mapDir uses).
|
|
21
|
+
return /^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\.|$)/i.test(reduced) ? `_${reduced}`.slice(0, ROUTE_NAME_MAX) : reduced;
|
|
22
|
+
}
|
|
23
|
+
// -- variables
|
|
24
|
+
/** `${name}` or `${account.field}`; `$${` is a literal `${`. ASCII names only. */
|
|
25
|
+
const TOKEN = /\$\$\{|\$\{([A-Za-z_]\w*(?:\.\w+)?)\}/g;
|
|
26
|
+
const WHOLE_ACCOUNT = /^\$\{account\.\w+\}$/;
|
|
27
|
+
const ACCOUNT_BRIEF = "an account value is the whole text of a step, not part of one.";
|
|
28
|
+
/** Typed text written so a replay reads it back as it was: a literal `${` becomes `$${`. */
|
|
29
|
+
export function escapeLiteral(text) {
|
|
30
|
+
// A function, since `$$` in a replacement string means one `$`.
|
|
31
|
+
return text.replaceAll("${", () => "$${");
|
|
32
|
+
}
|
|
33
|
+
/** The text a step keeps for a variable. */
|
|
34
|
+
export function variablePlaceholder(name) {
|
|
35
|
+
return `\${${name}}`;
|
|
36
|
+
}
|
|
37
|
+
class Refusal extends Error {
|
|
38
|
+
}
|
|
39
|
+
function fillText(text, { values, variables }) {
|
|
40
|
+
return text.replace(TOKEN, (match, name) => {
|
|
41
|
+
if (name === undefined)
|
|
42
|
+
return "${";
|
|
43
|
+
// An account's value is typed by the tool when the step runs; it stays a placeholder here.
|
|
44
|
+
if (name.startsWith("account."))
|
|
45
|
+
return match;
|
|
46
|
+
if (variables !== undefined && !variables.includes(name))
|
|
47
|
+
throw new Refusal(`the step uses ${name} but the route's variables don't list it.`);
|
|
48
|
+
if (!Object.hasOwn(values, name))
|
|
49
|
+
throw new Refusal(`no value given for the variable "${name}".`);
|
|
50
|
+
const value = values[name];
|
|
51
|
+
if (value.includes("${account."))
|
|
52
|
+
throw new Refusal(`the value of "${name}" can't hold an account placeholder; name the account instead.`);
|
|
53
|
+
return value;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function fillValue(value, fill) {
|
|
57
|
+
if (typeof value === "string")
|
|
58
|
+
return fillText(value, fill);
|
|
59
|
+
if (Array.isArray(value))
|
|
60
|
+
return value.map((item) => fillValue(item, fill));
|
|
61
|
+
if (typeof value === "object" && value !== null) {
|
|
62
|
+
return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, fillValue(item, fill)]));
|
|
63
|
+
}
|
|
64
|
+
return value;
|
|
65
|
+
}
|
|
66
|
+
/** An account placeholder in a typed step's text must be the whole text, and a field an account has. */
|
|
67
|
+
function checkAccountText(text, accounts) {
|
|
68
|
+
const found = [...text.matchAll(TOKEN)].filter((m) => m[1]?.startsWith("account.") === true);
|
|
69
|
+
if (found.length === 0)
|
|
70
|
+
return;
|
|
71
|
+
if (!WHOLE_ACCOUNT.test(text))
|
|
72
|
+
throw new Refusal(ACCOUNT_BRIEF);
|
|
73
|
+
const field = (found[0]?.[1] ?? "").slice("account.".length);
|
|
74
|
+
if (accounts !== undefined && field !== "username" && field !== "password") {
|
|
75
|
+
throw new Refusal(`\${account.${field}} isn't a value an account has; use \${account.username} or \${account.password}.`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The step with its variables filled and its `$${` made `${`. A variable with no value is refused, naming it. An account
|
|
80
|
+
* placeholder stays as it is (the tool types the value later), and only as the whole text of a `type_text`.
|
|
81
|
+
*/
|
|
82
|
+
export function substituteVariables(step, values, accounts, variables) {
|
|
83
|
+
try {
|
|
84
|
+
const unlisted = variables === undefined ? undefined : Object.keys(values).find((key) => !variables.includes(key));
|
|
85
|
+
if (unlisted !== undefined)
|
|
86
|
+
throw new Refusal(`a value was given for "${unlisted}", which the route's variables don't list.`);
|
|
87
|
+
const text = step["text"];
|
|
88
|
+
if (step.tool === "type_text" && typeof text === "string")
|
|
89
|
+
checkAccountText(text, accounts);
|
|
90
|
+
const fill = { values, variables };
|
|
91
|
+
const filled = Object.fromEntries(Object.entries(step).map(([key, value]) => [key, key === "tool" ? value : fillValue(value, fill)]));
|
|
92
|
+
// Checked again on the filled text: a literal or a value must never turn into an account placeholder.
|
|
93
|
+
const after = filled["text"];
|
|
94
|
+
if (step.tool === "type_text" && typeof after === "string" && after.includes("${account.") && after !== text) {
|
|
95
|
+
throw new Refusal("a literal ${account. can't become an account placeholder; an account value is the whole text of a step, written as its own placeholder.");
|
|
96
|
+
}
|
|
97
|
+
return { ok: true, step: filled };
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
if (error instanceof Refusal)
|
|
101
|
+
return { ok: false, code: "bad_params", message: error.message };
|
|
102
|
+
throw error;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/** Every step filled, or the first refusal with its step number. */
|
|
106
|
+
export function substituteSteps(steps, values, accounts, variables) {
|
|
107
|
+
const done = [];
|
|
108
|
+
for (const [i, step] of steps.entries()) {
|
|
109
|
+
const filled = substituteVariables(step, values, accounts, variables);
|
|
110
|
+
if (!filled.ok)
|
|
111
|
+
return { ok: false, code: "bad_params", message: `step ${i + 1}: ${filled.message}` };
|
|
112
|
+
done.push(filled.step);
|
|
113
|
+
}
|
|
114
|
+
return { ok: true, steps: done };
|
|
115
|
+
}
|
|
116
|
+
// -- recording
|
|
117
|
+
/** A variable's name for `type_text`'s `as`: a plain name, and not `account` (that names a test account). A message, or null. */
|
|
118
|
+
export function variableProblem(name) {
|
|
119
|
+
if (!/^[A-Za-z_]\w*$/.test(name))
|
|
120
|
+
return `as names a variable with letters, digits and '_'; "${name}" isn't one.`;
|
|
121
|
+
if (name === "account")
|
|
122
|
+
return 'as can\'t be "account": that name is for a test account (type ${account.username} with account).';
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
/** What a typed step keeps in a route: `as` makes its text a variable, and an account's text stays its placeholder. */
|
|
126
|
+
export function routeTyped(params) {
|
|
127
|
+
const { as, ...rest } = params;
|
|
128
|
+
if (typeof as === "string")
|
|
129
|
+
return { params: { ...rest, text: variablePlaceholder(as) }, placeholder: true, variable: as, account: false };
|
|
130
|
+
const account = typeof rest["text"] === "string" && rest["text"].includes("${account.");
|
|
131
|
+
return { params: rest, placeholder: account, account };
|
|
132
|
+
}
|
|
133
|
+
function escapeValue(value) {
|
|
134
|
+
if (typeof value === "string")
|
|
135
|
+
return escapeLiteral(value);
|
|
136
|
+
if (Array.isArray(value))
|
|
137
|
+
return value.map(escapeValue);
|
|
138
|
+
if (typeof value === "object" && value !== null)
|
|
139
|
+
return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, escapeValue(item)]));
|
|
140
|
+
return value;
|
|
141
|
+
}
|
|
142
|
+
/** A recorded step's params with every literal `${` escaped, except the text that is a variable or an account's placeholder. */
|
|
143
|
+
export function escapeParams(params, keepText) {
|
|
144
|
+
return Object.fromEntries(Object.entries(params).map(([key, value]) => [key, keepText && key === "text" ? value : escapeValue(value)]));
|
|
145
|
+
}
|
|
146
|
+
export function routeScript(input) {
|
|
147
|
+
const variables = [...new Set(input.variables)];
|
|
148
|
+
return {
|
|
149
|
+
format: "agent-tools-script",
|
|
150
|
+
version: 2,
|
|
151
|
+
app: input.app,
|
|
152
|
+
name: input.name,
|
|
153
|
+
...(input.start !== undefined ? { start: input.start } : {}),
|
|
154
|
+
...(input.end !== undefined ? { end: input.end } : {}),
|
|
155
|
+
...(variables.length > 0 ? { variables } : {}),
|
|
156
|
+
steps: input.steps,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
// -- storage
|
|
160
|
+
const relativeOf = (slug) => `routes/${slug}.json`;
|
|
161
|
+
/**
|
|
162
|
+
* Writes `<map folder>/routes/<name>.json` and lists it in the map's `routes`. The name is reduced (`routeSlug`); a route
|
|
163
|
+
* with that name is replaced. With the app's open `map` the change goes through it, else straight into the file.
|
|
164
|
+
* Answers the path written. Throws with the reason when the file or the map can't be written.
|
|
165
|
+
*/
|
|
166
|
+
export async function saveRoute(dir, script, map) {
|
|
167
|
+
const name = routeSlug(script.name);
|
|
168
|
+
if (name === null)
|
|
169
|
+
throw new Error(`"${script.name}" can't name a route; use letters, digits, '.', '_' and '-'.`);
|
|
170
|
+
const relative = relativeOf(name);
|
|
171
|
+
await saveRouteFile(dir, relative, `${JSON.stringify({ ...script, name }, null, 2)}\n`);
|
|
172
|
+
if (map !== undefined) {
|
|
173
|
+
map.addRoute(name, relative);
|
|
174
|
+
await map.flush();
|
|
175
|
+
const failed = map.lastError();
|
|
176
|
+
if (failed !== null)
|
|
177
|
+
throw new Error(`the map file wasn't written (${failed})`);
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
const loaded = loadMap(dir, script.app ?? "");
|
|
181
|
+
if (loaded.status === "unreadable")
|
|
182
|
+
throw new Error("the map file is unreadable and was left alone");
|
|
183
|
+
loaded.map.routes[name] = relative;
|
|
184
|
+
await saveMap(dir, loaded.map);
|
|
185
|
+
}
|
|
186
|
+
return join(dir, relative);
|
|
187
|
+
}
|
|
188
|
+
/** The map's `routes` (name to file) as the file holds them, whichever app wrote it; empty when it can't be read. */
|
|
189
|
+
function registeredRoutes(dir) {
|
|
190
|
+
try {
|
|
191
|
+
const raw = JSON.parse(readFileSync(join(dir, "map.json"), "utf8"));
|
|
192
|
+
const routes = typeof raw === "object" && raw !== null ? raw.routes : undefined;
|
|
193
|
+
if (typeof routes !== "object" || routes === null)
|
|
194
|
+
return {};
|
|
195
|
+
return Object.fromEntries(Object.entries(routes).filter((entry) => typeof entry[1] === "string"));
|
|
196
|
+
}
|
|
197
|
+
catch {
|
|
198
|
+
return {};
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* The full path of a registered route file, only when it is a .json file inside the map folder's `routes/`. A map can be
|
|
203
|
+
* shared and edited by another tool, so an entry like "../../x.json" is never read, and nothing is written beside it.
|
|
204
|
+
*/
|
|
205
|
+
export function routeFileIn(dir, relative) {
|
|
206
|
+
const full = insideDir(dir, relative);
|
|
207
|
+
if (full === null || !full.startsWith(resolve(dir, "routes") + sep) || !full.endsWith(".json"))
|
|
208
|
+
return null;
|
|
209
|
+
return full;
|
|
210
|
+
}
|
|
211
|
+
/** Where a route of that name is kept in the app's map folder (its full path), or null when the map has none. */
|
|
212
|
+
export function routePathOf(map, name) {
|
|
213
|
+
const routes = map.data().routes;
|
|
214
|
+
const key = Object.hasOwn(routes, name) ? name : routeSlug(name);
|
|
215
|
+
const relative = key === null || !Object.hasOwn(routes, key) ? undefined : routes[key];
|
|
216
|
+
return relative === undefined ? null : routeFileIn(map.folder(), relative);
|
|
217
|
+
}
|
|
218
|
+
/** The route of that name from the map folder, or null (unknown, or a file that isn't a version 2 script). */
|
|
219
|
+
export function loadRoute(dir, name) {
|
|
220
|
+
const routes = registeredRoutes(dir);
|
|
221
|
+
const key = Object.hasOwn(routes, name) ? name : routeSlug(name);
|
|
222
|
+
const relative = key === null || !Object.hasOwn(routes, key) ? undefined : routes[key];
|
|
223
|
+
if (relative === undefined || routeFileIn(dir, relative) === null)
|
|
224
|
+
return null;
|
|
225
|
+
const file = readRouteSync(dir, relative);
|
|
226
|
+
const parsed = file === null ? null : sharedScriptV2Schema.safeParse(file);
|
|
227
|
+
return parsed?.success === true ? parsed.data : null;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* The saved routes `drive {"to"}` may plan through: those with a start and an end that differ, and no variable but the
|
|
231
|
+
* test account (a plan has no value to give a variable).
|
|
232
|
+
*/
|
|
233
|
+
export function routeEdges(map) {
|
|
234
|
+
const edges = [];
|
|
235
|
+
for (const [route, relative] of Object.entries(map.data().routes)) {
|
|
236
|
+
const file = routeFileIn(map.folder(), relative) === null ? null : readRouteSync(map.folder(), relative);
|
|
237
|
+
const parsed = file === null ? null : sharedScriptV2Schema.safeParse(file);
|
|
238
|
+
if (parsed?.success !== true)
|
|
239
|
+
continue;
|
|
240
|
+
const { start, end, variables = [], steps } = parsed.data;
|
|
241
|
+
if (start === undefined || end === undefined || start === end || steps.length === 0)
|
|
242
|
+
continue;
|
|
243
|
+
if (variables.some((variable) => variable !== "account"))
|
|
244
|
+
continue;
|
|
245
|
+
let last = new Date(0).toISOString();
|
|
246
|
+
try {
|
|
247
|
+
last = statSync(join(map.folder(), relative)).mtime.toISOString();
|
|
248
|
+
}
|
|
249
|
+
catch {
|
|
250
|
+
// The file is read already; a clock is only a tie-break.
|
|
251
|
+
}
|
|
252
|
+
edges.push({ route, from: start, to: end, moves: steps.length, last });
|
|
253
|
+
}
|
|
254
|
+
return edges;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Takes the app to the route's start when it is elsewhere. Null when it is there; else why it can't be. Without a driver
|
|
258
|
+
* (task 15) a route that isn't at its start is refused; a caller can ask before it restarts the app.
|
|
259
|
+
*/
|
|
260
|
+
export async function reachStart(route, ctx) {
|
|
261
|
+
if (route.start === undefined)
|
|
262
|
+
return null;
|
|
263
|
+
const here = await ctx.here();
|
|
264
|
+
if (here === route.start)
|
|
265
|
+
return null;
|
|
266
|
+
if (ctx.driveTo === undefined) {
|
|
267
|
+
const where = here === null ? "the app's place isn't known" : `the app is at ${here}`;
|
|
268
|
+
return { kind: "refused", code: "unsupported", message: `the route "${route.name}" starts at ${route.start}, and ${where}. Go to ${route.start} first, then run it again.` };
|
|
269
|
+
}
|
|
270
|
+
const driven = await ctx.driveTo(route.start);
|
|
271
|
+
return driven.ok ? null : { kind: "refused", code: "off_route", message: driven.message };
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Runs a route (§18.5): fills its variables, takes the app to `start` when it is elsewhere, then runs the steps. Nothing is
|
|
275
|
+
* touched when a variable has no value or the app can't be taken to the start.
|
|
276
|
+
*/
|
|
277
|
+
export async function runRoute(route, values, ctx, accounts) {
|
|
278
|
+
const filled = substituteSteps(route.steps, values, accounts, route.variables ?? []);
|
|
279
|
+
if (!filled.ok)
|
|
280
|
+
return { kind: "refused", code: filled.code, message: filled.message };
|
|
281
|
+
const start = await reachStart(route, ctx);
|
|
282
|
+
if (start !== null)
|
|
283
|
+
return start;
|
|
284
|
+
return { kind: "ran", answer: await ctx.runSteps(filled.steps) };
|
|
285
|
+
}
|
|
286
|
+
export const routeRunner = { run: runRoute };
|
|
287
|
+
//# sourceMappingURL=routes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGzF,OAAO,EAAE,oBAAoB,EAAuB,MAAM,aAAa,CAAC;AAExE,wHAAwH;AACxH,qHAAqH;AACrH,yGAAyG;AAEzG,MAAM,cAAc,GAAG,EAAE,CAAC;AAE1B,iIAAiI;AACjI,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,MAAM,OAAO,GAAG,GAAG;SAChB,IAAI,EAAE;SACN,OAAO,CAAC,mBAAmB,EAAE,GAAG,CAAC;SACjC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC;SAC7B,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC;QACzB,2DAA2D;SAC1D,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IACzB,IAAI,OAAO,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IAChC,oFAAoF;IACpF,OAAO,6CAA6C,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;AACxH,CAAC;AAED,eAAe;AAEf,kFAAkF;AAClF,MAAM,KAAK,GAAG,wCAAwC,CAAC;AACvD,MAAM,aAAa,GAAG,sBAAsB,CAAC;AAC7C,MAAM,aAAa,GAAG,gEAAgE,CAAC;AAEvF,4FAA4F;AAC5F,MAAM,UAAU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E,MAAM,CAAC,OAAO,EAAE,CAAC;IACvF,MAAM,KAAK,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC3C,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACjC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AACnE,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAgB,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC"}
|
package/dist/run.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { z } from "zod";
|
|
|
5
5
|
* goes to the app as it would alone (no screen list in between), and the one change block at the end covers
|
|
6
6
|
* the whole batch.
|
|
7
7
|
*/
|
|
8
|
-
export declare const RUN_TOOLS: readonly ["tap", "long_press", "type_text", "scroll", "toggle", "back", "swipe", "open_url", "wait", "wait_for", "app_command", "compare_screen", "performance"];
|
|
8
|
+
export declare const RUN_TOOLS: readonly ["tap", "long_press", "type_text", "scroll", "toggle", "back", "swipe", "open_url", "wait", "wait_for", "app_command", "compare_screen", "performance", "drive"];
|
|
9
9
|
export type RunTool = (typeof RUN_TOOLS)[number];
|
|
10
10
|
/** Tools a step may not be (they read or manage, rather than act): `bad_params`. */
|
|
11
11
|
export declare const NOT_IN_RUN: string[];
|
|
@@ -26,6 +26,14 @@ export declare const expectSchema: z.ZodObject<{
|
|
|
26
26
|
under: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
27
27
|
}, z.core.$strip>;
|
|
28
28
|
export type Expect = z.infer<typeof expectSchema>;
|
|
29
|
+
/** AGENT-TOOLS 1.13 §9.1: a step's `if`, one of text, id or label (as in `expect`), `gone: true` for when it isn't there. */
|
|
30
|
+
export declare const ifSchema: z.ZodObject<{
|
|
31
|
+
text: z.ZodOptional<z.ZodString>;
|
|
32
|
+
id: z.ZodOptional<z.ZodString>;
|
|
33
|
+
label: z.ZodOptional<z.ZodString>;
|
|
34
|
+
gone: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
export type If = z.infer<typeof ifSchema>;
|
|
29
37
|
export declare const stepSchema: z.ZodObject<{
|
|
30
38
|
tool: z.ZodString;
|
|
31
39
|
expect: z.ZodOptional<z.ZodObject<{
|
|
@@ -40,8 +48,27 @@ export declare const stepSchema: z.ZodObject<{
|
|
|
40
48
|
timeout: z.ZodOptional<z.ZodNumber>;
|
|
41
49
|
under: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
42
50
|
}, z.core.$strip>>;
|
|
51
|
+
if: z.ZodOptional<z.ZodObject<{
|
|
52
|
+
text: z.ZodOptional<z.ZodString>;
|
|
53
|
+
id: z.ZodOptional<z.ZodString>;
|
|
54
|
+
label: z.ZodOptional<z.ZodString>;
|
|
55
|
+
gone: z.ZodOptional<z.ZodBoolean>;
|
|
56
|
+
}, z.core.$strict>>;
|
|
57
|
+
optional: z.ZodOptional<z.ZodBoolean>;
|
|
43
58
|
}, z.core.$loose>;
|
|
44
59
|
export type Step = z.infer<typeof stepSchema>;
|
|
60
|
+
/** How a probe reads in the skipped line: `"Not now"` for a text or a label, `id=save`, or a ref as it is. */
|
|
61
|
+
export declare function describeProbe(probe: {
|
|
62
|
+
text: string;
|
|
63
|
+
} | {
|
|
64
|
+
testID: string;
|
|
65
|
+
} | {
|
|
66
|
+
label: string;
|
|
67
|
+
} | {
|
|
68
|
+
ref: string;
|
|
69
|
+
}): string;
|
|
70
|
+
/** The line that says a step didn't run (AGENT-TOOLS 1.13 §9.1): ` 3. skipped (if: "Not now" isn't on screen).` */
|
|
71
|
+
export declare function skippedLine(index: number, kind: "if" | "optional", what: string, gone?: boolean): string;
|
|
45
72
|
export declare const MAX_STEPS = 50;
|
|
46
73
|
export declare const RUN_TIMEOUT_MS = 120000;
|
|
47
74
|
export declare const EXPECT_TIMEOUT_S = 2;
|
package/dist/run.js
CHANGED
|
@@ -5,9 +5,9 @@ import { z } from "zod";
|
|
|
5
5
|
* goes to the app as it would alone (no screen list in between), and the one change block at the end covers
|
|
6
6
|
* the whole batch.
|
|
7
7
|
*/
|
|
8
|
-
export const RUN_TOOLS = ["tap", "long_press", "type_text", "scroll", "toggle", "back", "swipe", "open_url", "wait", "wait_for", "app_command", "compare_screen", "performance"];
|
|
8
|
+
export const RUN_TOOLS = ["tap", "long_press", "type_text", "scroll", "toggle", "back", "swipe", "open_url", "wait", "wait_for", "app_command", "compare_screen", "performance", "drive"];
|
|
9
9
|
/** Tools a step may not be (they read or manage, rather than act): `bad_params`. */
|
|
10
|
-
export const NOT_IN_RUN = ["look", "run", "audit", "apps", "viewer", "record", "replay", "inspect", "check_layout", "pair", "open_app", "logs", "crash", "reload", "filmstrip", "session_report"];
|
|
10
|
+
export const NOT_IN_RUN = ["look", "run", "audit", "ux_check", "media", "apps", "viewer", "record", "replay", "inspect", "check_layout", "pair", "open_app", "logs", "crash", "reload", "filmstrip", "session_report", "journey", "map"];
|
|
11
11
|
/** AGENT-TOOLS §15.3: the limits a `performance` step may carry in `expect.under`. */
|
|
12
12
|
export const UNDER_KEYS = ["launch_s", "memory_mb", "js_heap_mb", "cpu_percent", "fps_min", "drops", "busy_ms"];
|
|
13
13
|
/** Limits Tapline can't measure: ignored with a note, one per key. */
|
|
@@ -38,9 +38,33 @@ export const expectSchema = z
|
|
|
38
38
|
.refine((e) => e.threshold === undefined || e.matches !== undefined, { message: "expect.threshold goes with matches" })
|
|
39
39
|
.refine((e) => e.ignore === undefined || e.matches !== undefined, { message: "expect.ignore goes with matches" })
|
|
40
40
|
.refine((e) => e.value === undefined || e.text === undefined, { message: "expect.value goes with id or label" });
|
|
41
|
+
/** AGENT-TOOLS 1.13 §9.1: a step's `if`, one of text, id or label (as in `expect`), `gone: true` for when it isn't there. */
|
|
42
|
+
export const ifSchema = z
|
|
43
|
+
.object({
|
|
44
|
+
text: z.string().min(1, "if text can't be empty").optional(),
|
|
45
|
+
id: z.string().min(1, "if id can't be empty").optional(),
|
|
46
|
+
label: z.string().min(1, "if label can't be empty").optional(),
|
|
47
|
+
gone: z.boolean().optional(),
|
|
48
|
+
})
|
|
49
|
+
.strict()
|
|
50
|
+
.refine((c) => [c.text, c.id, c.label].filter((v) => v !== undefined).length === 1, { message: "if needs exactly one of text, id or label" });
|
|
41
51
|
export const stepSchema = z
|
|
42
|
-
.object({ tool: z.string(), expect: expectSchema.optional() })
|
|
52
|
+
.object({ tool: z.string(), expect: expectSchema.optional(), if: ifSchema.optional(), optional: z.boolean().optional() })
|
|
43
53
|
.passthrough();
|
|
54
|
+
/** How a probe reads in the skipped line: `"Not now"` for a text or a label, `id=save`, or a ref as it is. */
|
|
55
|
+
export function describeProbe(probe) {
|
|
56
|
+
if ("text" in probe)
|
|
57
|
+
return JSON.stringify(probe.text);
|
|
58
|
+
if ("testID" in probe)
|
|
59
|
+
return `id=${probe.testID}`;
|
|
60
|
+
if ("label" in probe)
|
|
61
|
+
return JSON.stringify(probe.label);
|
|
62
|
+
return probe.ref;
|
|
63
|
+
}
|
|
64
|
+
/** The line that says a step didn't run (AGENT-TOOLS 1.13 §9.1): ` 3. skipped (if: "Not now" isn't on screen).` */
|
|
65
|
+
export function skippedLine(index, kind, what, gone) {
|
|
66
|
+
return ` ${index}. skipped (${kind}: ${what} ${gone === true ? "is on screen" : "isn't on screen"}).`;
|
|
67
|
+
}
|
|
44
68
|
export const MAX_STEPS = 50;
|
|
45
69
|
export const RUN_TIMEOUT_MS = 120_000;
|
|
46
70
|
export const EXPECT_TIMEOUT_S = 2;
|
|
@@ -79,6 +103,11 @@ export function describeRunStep(step) {
|
|
|
79
103
|
return p["launch"] === true ? "performance launch" : `performance ${Number(p["seconds"] ?? 3)} s`;
|
|
80
104
|
case "back":
|
|
81
105
|
return "back";
|
|
106
|
+
case "drive": {
|
|
107
|
+
// A drive step reads as the place or route it goes to (AGENT-TOOLS 1.13 9.1: it counts as one step).
|
|
108
|
+
const where = typeof p["to"] === "string" ? p["to"] : typeof p["route"] === "string" ? `route ${p["route"]}` : "";
|
|
109
|
+
return `drive${where !== "" ? ` ${where}` : ""}`;
|
|
110
|
+
}
|
|
82
111
|
case "compare_screen":
|
|
83
112
|
return `compare_screen ${JSON.stringify(p["name"] ?? "")}`;
|
|
84
113
|
default:
|
package/dist/run.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,CAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,OAAO,CAAU,CAAC;AAGnM,oFAAoF;AACpF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EA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C;AAED,iFAAiF;AACjF,MAAM,UAAU,UAAU,CAAC,MAAc;IACvC,MAAM,CAAC,KAAK,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACjD,MAAM,CAAC,GAAG,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5C,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAE,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAChG,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type HostConfig, type ResolveOptions } from "./config.js";
|
|
2
|
+
import { type GitProbe } from "./accounts.js";
|
|
3
|
+
import { Confirmations } from "./confirm.js";
|
|
4
|
+
import { TaplineHost, type ListenResult } from "./server.js";
|
|
5
|
+
import { TaplineTools } from "./tools.js";
|
|
6
|
+
/** How long a client of the thin call may stay silent before its tools (its report, its journey) are dropped. */
|
|
7
|
+
export declare const CLIENT_IDLE_MS: number;
|
|
8
|
+
/** The client id of a thin call that names none. */
|
|
9
|
+
export declare const ANONYMOUS_CLIENT = "anonymous";
|
|
10
|
+
export interface RuntimeOptions extends ResolveOptions {
|
|
11
|
+
screenshots?: string;
|
|
12
|
+
viewer?: string;
|
|
13
|
+
noLog?: boolean;
|
|
14
|
+
policy?: string;
|
|
15
|
+
noPolicy?: boolean;
|
|
16
|
+
/** `--no-dialog`: a person's OK is asked in the live view only, never in the host's dialog (AGENT-TOOLS 1.13 §11.3). */
|
|
17
|
+
noDialog?: boolean;
|
|
18
|
+
viewerLink?: boolean;
|
|
19
|
+
uxRules?: string;
|
|
20
|
+
/** `--accounts FILE`: test accounts (AGENT-TOOLS 1.13 §18.6). A file inside a git work tree that doesn't ignore it loads nothing. */
|
|
21
|
+
accounts?: string;
|
|
22
|
+
/** Tests: the git questions the accounts file is checked with. */
|
|
23
|
+
gitProbe?: GitProbe;
|
|
24
|
+
/** `--brief`: actions answer briefly unless a call says `brief: false` (AGENT-TOOLS 1.13 §13.4). */
|
|
25
|
+
brief?: boolean;
|
|
26
|
+
/** `--maps DIR`: where the apps' maps live, `<DIR>/<app id>/` (AGENT-TOOLS 1.13 §18.9). Default `~/.tapline/maps`. */
|
|
27
|
+
maps?: string;
|
|
28
|
+
/** Serve `POST /api/<tool>`: set by a standalone `tapline host`, never by an agent's MCP server (AGENT-TOOLS 1.13 §18.10). */
|
|
29
|
+
api?: boolean;
|
|
30
|
+
/** Where the host's own lines go. Default: stderr with a `[tapline]` prefix (stdout is the MCP protocol's). */
|
|
31
|
+
log?: (message: string) => void;
|
|
32
|
+
/** Clock for the idle sweep (tests). Default Date.now. */
|
|
33
|
+
clock?: () => number;
|
|
34
|
+
/** Opens the live view in a browser (tests). Default: this computer's default browser. */
|
|
35
|
+
openBrowser?: (link: string) => boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface Runtime {
|
|
38
|
+
host: TaplineHost;
|
|
39
|
+
confirmations: Confirmations;
|
|
40
|
+
config: HostConfig;
|
|
41
|
+
listening: ListenResult;
|
|
42
|
+
/** Where apps reach this host. */
|
|
43
|
+
url: string;
|
|
44
|
+
/** The port the host bound. */
|
|
45
|
+
port: number;
|
|
46
|
+
viewerLinks: string[];
|
|
47
|
+
remoteViewer: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* A tools object for one client; the same object for the same id. `undefined` is the connection itself (one MCP
|
|
50
|
+
* server). Other ids are dropped after 30 minutes without a call.
|
|
51
|
+
*/
|
|
52
|
+
toolsFor(clientId: string | undefined): TaplineTools;
|
|
53
|
+
close(): Promise<void>;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The wiring an MCP server and a standalone host share: the host, the person's confirmations, the live viewer on the
|
|
57
|
+
* host's port, the policy, the log folders and the 3 s control queue. Rejects with a plain message when an option is
|
|
58
|
+
* wrong or no port is free (the message's lines are for the log).
|
|
59
|
+
*/
|
|
60
|
+
export declare function createRuntime(options?: RuntimeOptions): Promise<Runtime>;
|