@relauts/spotcheck-service 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/LICENSE +661 -0
- package/NOTICE +19 -0
- package/README.md +169 -0
- package/dist/api/auth.d.ts +11 -0
- package/dist/api/auth.js +32 -0
- package/dist/api/auth.js.map +1 -0
- package/dist/api/history.d.ts +46 -0
- package/dist/api/history.js +172 -0
- package/dist/api/history.js.map +1 -0
- package/dist/api/saved-run.d.ts +35 -0
- package/dist/api/saved-run.js +234 -0
- package/dist/api/saved-run.js.map +1 -0
- package/dist/api/saved.d.ts +33 -0
- package/dist/api/saved.js +209 -0
- package/dist/api/saved.js.map +1 -0
- package/dist/api/server.d.ts +23 -0
- package/dist/api/server.js +852 -0
- package/dist/api/server.js.map +1 -0
- package/dist/computer-use/actions.d.ts +14 -0
- package/dist/computer-use/actions.js +212 -0
- package/dist/computer-use/actions.js.map +1 -0
- package/dist/computer-use/args.d.ts +11 -0
- package/dist/computer-use/args.js +74 -0
- package/dist/computer-use/args.js.map +1 -0
- package/dist/computer-use/cli.d.ts +1 -0
- package/dist/computer-use/cli.js +8 -0
- package/dist/computer-use/cli.js.map +1 -0
- package/dist/computer-use/client.d.ts +3 -0
- package/dist/computer-use/client.js +68 -0
- package/dist/computer-use/client.js.map +1 -0
- package/dist/computer-use/coords.d.ts +5 -0
- package/dist/computer-use/coords.js +21 -0
- package/dist/computer-use/coords.js.map +1 -0
- package/dist/computer-use/history.d.ts +11 -0
- package/dist/computer-use/history.js +59 -0
- package/dist/computer-use/history.js.map +1 -0
- package/dist/computer-use/index.d.ts +17 -0
- package/dist/computer-use/index.js +75 -0
- package/dist/computer-use/index.js.map +1 -0
- package/dist/computer-use/keys.d.ts +3 -0
- package/dist/computer-use/keys.js +50 -0
- package/dist/computer-use/keys.js.map +1 -0
- package/dist/computer-use/loop.d.ts +22 -0
- package/dist/computer-use/loop.js +90 -0
- package/dist/computer-use/loop.js.map +1 -0
- package/dist/computer-use/safety.d.ts +15 -0
- package/dist/computer-use/safety.js +45 -0
- package/dist/computer-use/safety.js.map +1 -0
- package/dist/computer-use/screenshot.d.ts +5 -0
- package/dist/computer-use/screenshot.js +16 -0
- package/dist/computer-use/screenshot.js.map +1 -0
- package/dist/computer-use/system-prompt.d.ts +11 -0
- package/dist/computer-use/system-prompt.js +41 -0
- package/dist/computer-use/system-prompt.js.map +1 -0
- package/dist/computer-use/types.d.ts +83 -0
- package/dist/computer-use/types.js +31 -0
- package/dist/computer-use/types.js.map +1 -0
- package/dist/playwright/actions.d.ts +81 -0
- package/dist/playwright/actions.js +170 -0
- package/dist/playwright/actions.js.map +1 -0
- package/dist/playwright/chromium.d.ts +10 -0
- package/dist/playwright/chromium.js +27 -0
- package/dist/playwright/chromium.js.map +1 -0
- package/dist/playwright/index.d.ts +2 -0
- package/dist/playwright/index.js +64 -0
- package/dist/playwright/index.js.map +1 -0
- package/dist/playwright/processed.d.ts +11 -0
- package/dist/playwright/processed.js +183 -0
- package/dist/playwright/processed.js.map +1 -0
- package/dist/playwright/session.d.ts +28 -0
- package/dist/playwright/session.js +165 -0
- package/dist/playwright/session.js.map +1 -0
- package/dist/shared/config.d.ts +38 -0
- package/dist/shared/config.js +227 -0
- package/dist/shared/config.js.map +1 -0
- package/dist/shared/cost.d.ts +15 -0
- package/dist/shared/cost.js +40 -0
- package/dist/shared/cost.js.map +1 -0
- package/dist/shared/logger.d.ts +4 -0
- package/dist/shared/logger.js +10 -0
- package/dist/shared/logger.js.map +1 -0
- package/dist/shared/main-module.d.ts +1 -0
- package/dist/shared/main-module.js +19 -0
- package/dist/shared/main-module.js.map +1 -0
- package/dist/shared/models.d.ts +12 -0
- package/dist/shared/models.js +40 -0
- package/dist/shared/models.js.map +1 -0
- package/dist/shared/telemetry.d.ts +9 -0
- package/dist/shared/telemetry.js +43 -0
- package/dist/shared/telemetry.js.map +1 -0
- package/files/model.json +26 -0
- package/files/system_prompt.txt +15 -0
- package/openapi.yaml +901 -0
- package/package.json +60 -0
- package/relauts-spotcheck-service-config.example.json +19 -0
- package/src/api/auth.ts +40 -0
- package/src/api/history.ts +251 -0
- package/src/api/saved-run.ts +346 -0
- package/src/api/saved.ts +275 -0
- package/src/api/server.ts +1198 -0
- package/src/computer-use/actions.ts +273 -0
- package/src/computer-use/args.ts +97 -0
- package/src/computer-use/cli.ts +8 -0
- package/src/computer-use/client.ts +81 -0
- package/src/computer-use/coords.ts +26 -0
- package/src/computer-use/history.ts +80 -0
- package/src/computer-use/index.ts +121 -0
- package/src/computer-use/keys.ts +54 -0
- package/src/computer-use/loop.ts +140 -0
- package/src/computer-use/safety.ts +59 -0
- package/src/computer-use/screenshot.ts +20 -0
- package/src/computer-use/system-prompt.ts +65 -0
- package/src/computer-use/types.ts +126 -0
- package/src/playwright/actions.ts +332 -0
- package/src/playwright/chromium.ts +30 -0
- package/src/playwright/index.ts +77 -0
- package/src/playwright/processed.ts +253 -0
- package/src/playwright/session.ts +220 -0
- package/src/shared/config.ts +320 -0
- package/src/shared/cost.ts +58 -0
- package/src/shared/logger.ts +9 -0
- package/src/shared/main-module.ts +20 -0
- package/src/shared/models.ts +62 -0
- package/src/shared/telemetry.ts +63 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { logger } from "./logger.js";
|
|
3
|
+
export const MIN_AUTOMATION_DURATION_MS = 1_000;
|
|
4
|
+
const TELEMETRY_TIMEOUT_MS = 10_000;
|
|
5
|
+
export function createAutomationReporter(config, deps = {}) {
|
|
6
|
+
return (startedAt, endedAt) => {
|
|
7
|
+
void postSuccessfulAutomation(config, startedAt, endedAt, deps);
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export async function postSuccessfulAutomation(config, startedAt, endedAt, deps = {}) {
|
|
11
|
+
const installationId = config.installationId;
|
|
12
|
+
const telemetryUrl = config.telemetryUrl;
|
|
13
|
+
if (!installationId || !telemetryUrl) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const durationMs = endedAt.getTime() - startedAt.getTime();
|
|
17
|
+
if (!Number.isFinite(durationMs) || durationMs < MIN_AUTOMATION_DURATION_MS) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const fetchFn = deps.fetch ?? fetch;
|
|
21
|
+
const createId = deps.randomUUID ?? randomUUID;
|
|
22
|
+
const body = {
|
|
23
|
+
eventId: createId(),
|
|
24
|
+
uuid: installationId,
|
|
25
|
+
startedAt: startedAt.toISOString(),
|
|
26
|
+
endedAt: endedAt.toISOString(),
|
|
27
|
+
};
|
|
28
|
+
try {
|
|
29
|
+
const response = await fetchFn(telemetryUrl, {
|
|
30
|
+
method: "POST",
|
|
31
|
+
headers: { "Content-Type": "application/json" },
|
|
32
|
+
body: JSON.stringify(body),
|
|
33
|
+
signal: AbortSignal.timeout(TELEMETRY_TIMEOUT_MS),
|
|
34
|
+
});
|
|
35
|
+
if (!response.ok) {
|
|
36
|
+
logger.error(`Telemetry request failed: ${response.status}`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
logger.error("Telemetry request failed", error);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=telemetry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../src/shared/telemetry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,CAAC;AAChD,MAAM,oBAAoB,GAAG,MAAM,CAAC;AASpC,MAAM,UAAU,wBAAwB,CACtC,MAA0D,EAC1D,OAA0B,EAAE;IAE5B,OAAO,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE;QAC5B,KAAK,wBAAwB,CAAC,MAAM,EAAE,SAAS,EA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C;QAC/D,CAAC;IACH,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,MAAM,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;IAClD,CAAC;AACH,CAAC"}
|
package/files/model.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"provider": "GEMINI",
|
|
4
|
+
"model": "gemini-3.5-flash-lite",
|
|
5
|
+
"input_price_per_million": 0.3,
|
|
6
|
+
"output_price_per_million": 2.5,
|
|
7
|
+
"cache_price_per_million": 0.03,
|
|
8
|
+
"description": "Google's most cost-efficient GA model, optimized for high-volume agentic tasks, translation, and simple data processing"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"provider": "GEMINI",
|
|
12
|
+
"model": "gemini-3.7-flash",
|
|
13
|
+
"input_price_per_million": 0.75,
|
|
14
|
+
"output_price_per_million": 3.75,
|
|
15
|
+
"cache_price_per_million": 0.075,
|
|
16
|
+
"description": "Google's most capable Flash model for agentic workflows and multimodal reasoning. Introductory price through December 31, 2026."
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"provider": "GEMINI",
|
|
20
|
+
"model": "gemini-3.6-flash",
|
|
21
|
+
"input_price_per_million": 0.75,
|
|
22
|
+
"output_price_per_million": 3.75,
|
|
23
|
+
"cache_price_per_million": 0.075,
|
|
24
|
+
"description": "Google's most intelligent model built for speed, combining frontier intelligence with superior search and grounding. Introductory price through December 31, 2026."
|
|
25
|
+
}
|
|
26
|
+
]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<non_negotiable_roles>
|
|
2
|
+
You are a very strict browser testing agent that must perform only the exact request and validation what users ask you to do and return what is present in screen.
|
|
3
|
+
</non_negotiable_roles>
|
|
4
|
+
|
|
5
|
+
<environment>
|
|
6
|
+
- Operating Browser: {{os}}
|
|
7
|
+
- Display resolution: {{display_width}}x{{display_height}} logical pixels (primary display)
|
|
8
|
+
- Keyboard layout: {{keyboard_layout}}
|
|
9
|
+
</environment>
|
|
10
|
+
|
|
11
|
+
<strict_response_format>
|
|
12
|
+
When done, reply with JSON only:
|
|
13
|
+
{"action":"summary","summary":"actions you did","validations":[{"check":"what user asked to verify","result":"pass or fail","observed":"what is on screen"}]}
|
|
14
|
+
Use "validations": [] if the user asked for no checks. Use only what is on screen.
|
|
15
|
+
</strict_response_format>
|