@cloop/runner 0.3.45 → 0.3.48

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.
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  serveTakeovers
4
- } from "./chunk-PUDWLT5C.js";
5
- import "./chunk-KG2RA3FJ.js";
4
+ } from "./chunk-ZA6NA5C7.js";
5
+ import "./chunk-PEV6CY2G.js";
6
6
  import {
7
7
  CAPTURE_TICK_MS,
8
8
  DEFAULT_FALLBACK_MODEL,
@@ -39,7 +39,7 @@ import {
39
39
  systemServices,
40
40
  unitFor,
41
41
  which
42
- } from "./chunk-HHNLRNOM.js";
42
+ } from "./chunk-NGYMPOZX.js";
43
43
  import {
44
44
  MeshSocket,
45
45
  WAKE_TICK_MS,
@@ -47,7 +47,7 @@ import {
47
47
  defaultSocketFactory,
48
48
  runnerLog,
49
49
  wakeWatch
50
- } from "./chunk-CVVYCLZ6.js";
50
+ } from "./chunk-BI2Y5ZCL.js";
51
51
  import {
52
52
  BoxWatch,
53
53
  hostedThreadsFilePath,
@@ -57,7 +57,7 @@ import {
57
57
  runnerStatePath,
58
58
  threadsFilePath,
59
59
  writeRunnerState
60
- } from "./chunk-UXMDNJ3O.js";
60
+ } from "./chunk-WOIIO52C.js";
61
61
  import {
62
62
  BackgroundReading,
63
63
  BoxToolError,
@@ -106,20 +106,20 @@ import {
106
106
  utcWindow,
107
107
  windowsPowerShellEnv,
108
108
  writeBoxConfig
109
- } from "./chunk-RRRV64ZB.js";
109
+ } from "./chunk-4JIQIWPX.js";
110
110
  import "./chunk-VK6GV757.js";
111
111
  import {
112
112
  olderThan
113
113
  } from "./chunk-365HFCQQ.js";
114
114
  import "./chunk-PKIEWBR7.js";
115
- import "./chunk-L763FCD7.js";
116
- import "./chunk-EPWLBMCR.js";
115
+ import "./chunk-HXK4TF4W.js";
116
+ import "./chunk-IMT5EQ75.js";
117
117
  import {
118
118
  getMachine
119
119
  } from "./chunk-SBYSVZ7J.js";
120
120
  import {
121
121
  VERSION
122
- } from "./chunk-AAHVP23O.js";
122
+ } from "./chunk-QR5NTMXB.js";
123
123
  import {
124
124
  getMeshUrl,
125
125
  getOrigin,
@@ -2762,6 +2762,7 @@ function boxPresence(beat) {
2762
2762
  surface: {
2763
2763
  driver: beat.driver,
2764
2764
  version: VERSION,
2765
+ os: process.platform,
2765
2766
  outsideThreads: beat.outsideThreads,
2766
2767
  otherThreads: beat.otherThreads,
2767
2768
  ...beat.t3 ? { t3: beat.t3 } : {},
@@ -828,7 +828,7 @@ var RESULT_INSTRUCTION = [
828
828
  ].join("\n");
829
829
  var MACHINE_RESULT_INSTRUCTION = [
830
830
  RESULT_INSTRUCTION,
831
- `To show the owner a picture, such as a screenshot of a UI change or a result a picture explains better than words, save it as a PNG, JPEG or WebP file outside the repository (for example in /tmp) and list it as an output: {"kind": "image", "title": "The new sign-in page", "path": "/tmp/sign-in.png"}, with the file's absolute path. Cloop uploads the file and shows it on the run. At most ${RUN_IMAGES_MAX} images, each under ${RUN_IMAGE_MAX_BYTES / (1024 * 1024)} MB. On a Cloop Box, the Playwright browser tool takes a screenshot of any page, a local server's page too.`,
831
+ `To show the owner a picture, such as a screenshot of a UI change or a result a picture explains better than words, save it as a PNG, JPEG or WebP file outside the repository (for example in /tmp) and list it as an output: {"kind": "image", "title": "The new sign-in page", "path": "/tmp/sign-in.png"}, with the file's absolute path. Cloop uploads the file and shows it on the run. At most ${RUN_IMAGES_MAX} images, each under ${RUN_IMAGE_MAX_BYTES / (1024 * 1024)} MB. On a Cloop Box, take a picture of a website with the cloop \`browser\` tool: action screenshot shows you the page, and with a title it also saves the picture to this run. List the output that result gives, {"kind": "image", "title": "\u2026", "media": "\u2026"}, as it is, with no path. Use the Playwright browser tool only for a page on localhost, and list its file by path.`,
832
832
  `To let the owner open a web app or page you are running on this machine, such as a dev server, leave the server running after your turn ends: start it in the background, detached from your shell (for example \`nohup npm run dev -- --port 5173 > /tmp/dev.log 2>&1 &\`), and check it answers on its port. Then list it as an output: {"kind": "preview", "title": "The new sign-in page", "port": 5173, "path": "/sign-in"}, with the port it listens on and an optional path to open first. Cloop gives the owner a private link to it for ${PREVIEW_HOURS} hours, while this machine is on. At most ${RUN_PREVIEWS_MAX} previews a run.`,
833
833
  `When you started something that keeps running after this turn (a build, a deploy, a long job) or you wait on something outside, do not wait in the turn: add "check_back": {"in_minutes": 120, "why": "Read the training log and report the score."} to the block. Cloop sends you a message in this conversation then, with your why, and you carry on from there. Give ${CHECK_BACK_MIN_MINUTES} to ${CHECK_BACK_MAX_MINUTES} minutes. Leave it out when the work is done.`
834
834
  ].join("\n");
@@ -884,14 +884,12 @@ function readOutput(o) {
884
884
  ...body !== void 0 ? { body } : {}
885
885
  };
886
886
  }
887
- case "image":
887
+ case "image": {
888
+ const media = typeof out.media === "string" && RUN_MEDIA_KEY.test(out.media) ? out.media : void 0;
889
+ if (out.path === void 0) return media ? { kind: "image", title, media } : null;
888
890
  if (!text(out.path, 400)) return null;
889
- return {
890
- kind: "image",
891
- title,
892
- path: out.path,
893
- ...typeof out.media === "string" && RUN_MEDIA_KEY.test(out.media) ? { media: out.media } : {}
894
- };
891
+ return { kind: "image", title, path: out.path, ...media ? { media } : {} };
892
+ }
895
893
  case "preview":
896
894
  if (!isPort(out.port) || out.path !== void 0 && !isPreviewPath(out.path)) return null;
897
895
  return {
@@ -10,7 +10,8 @@ var RUNNER_TOOLS = [
10
10
  "thread.interrupt",
11
11
  "thread.settle",
12
12
  "setup.share",
13
- "diag"
13
+ "diag",
14
+ "cookies.import"
14
15
  ];
15
16
  var RUNNER_ERRORS = [
16
17
  "expired",
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  ConnectFailure,
4
4
  deviceLogin
5
- } from "./chunk-EPWLBMCR.js";
5
+ } from "./chunk-IMT5EQ75.js";
6
6
  import {
7
7
  ApiError,
8
8
  ReauthError,
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-SBYSVZ7J.js";
7
7
  import {
8
8
  VERSION
9
- } from "./chunk-AAHVP23O.js";
9
+ } from "./chunk-QR5NTMXB.js";
10
10
  import {
11
11
  getOrigin,
12
12
  readCredentials,