intentic
Download the app
Download the app
Ship and share

Offloaded work

Send heavy commands such as tests and typechecks to a runner on one of your machines

On this page(5 sections)

Heavy commands are sorted into kinds (tests, typechecks, verify…), and the owner can send each kind to a runner on one of their machines instead of running it here. The sandbox's own `offload-run` command drives the run: it asks whether the runner can take the work, hands it a snapshot of the code and streams the output back, ending with the exit code and every file the command changed. The rest lists the kinds and the recent runs.

GET/offload/runners/{runner}Whether a runner can take a heavy command

Answers whether the runner a kind of heavy work is sent to is connected and able to run it, before anything is copied to it. When it is not, the command runs in this sandbox and says why.

What you send

FieldTypeWhere
runnerrequiredstringaddress

What comes back

FieldType
runnerstring
namestring
readyboolean
whystring
Try itanswered in this tab
curl
curl "$SANDBOX/offload/runners/%E2%80%A6" \
  -H "x-intentic-control: $INTENTIC_TOKEN"
TypeScript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.offload.target({
  "runner": "…"
});
POST/offload/runsRun a heavy command on a runnerstream

Hands one command to a runner on one of your machines, together with a snapshot of the code as it stands, and streams its output back as it comes. It ends with the exit code, every file the command changed and any report it wrote.

What you send

FieldTypeWhere
runIdrequiredstringbody
reporequiredstringbody
refrequiredstringbody
cwdrequiredstringbody
commandrequiredstringbody
envobjectbody
exportsstring[]body
labelrequiredstringbody
timeoutMsintegerbody
runnerrequiredstringbody

What comes back

FieldType
when event is "message"shape
dataobject
when kind is "status"shape
textstring
when kind is "output"shape
stream"stdout" | "stderr"
textstring
when kind is "exit"shape
codeinteger
signalstring
failurestring
ranboolean
patchBase64string
filesobject
when kind is "refused"shape
whystring
idstring
retrynumber
when event is "done"shape
dataunknown
idstring
retrynumber
when event is "error"shape
dataunknown
idstring
retrynumber
Try itanswered in this tab
curl
curl -N -X POST "$SANDBOX/offload/runs" \
  -H "x-intentic-control: $INTENTIC_TOKEN" \
  -H "content-type: application/json" \
  -d '{"runId":"run_8c2f41d9","repo":"root","ref":"refs/heads/main","cwd":"/work","command":"pnpm dev","env":{"src/app.ts":"…","README.md":"…"},"exports":["…","…"],"label":"Nightly changelog","timeoutMs":1,"runner":"…"}'
TypeScript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.offload.run({
  "runId": "run_8c2f41d9",
  "repo": "root",
  "ref": "refs/heads/main",
  "cwd": "/work",
  "command": "pnpm dev",
  "env": {
    "src/app.ts": "…",
    "README.md": "…"
  },
  "exports": [
    "…",
    "…"
  ],
  "label": "Nightly changelog",
  "timeoutMs": 1,
  "runner": "…"
});
GET/offload/runsRecent offloaded commands

The heavy commands this sandbox sent to runners lately, newest first, with where they ran and how they ended.

What you send

Nothing. Call it as it is.

What comes back

FieldType
runsobject[]
runIdstring
runnerstring
namestring
labelstring
commandstring
startedAtnumber
endedAtnumber
codeinteger
failurestring
Try itanswered in this tab
curl
curl "$SANDBOX/offload/runs" \
  -H "x-intentic-control: $INTENTIC_TOKEN"
TypeScript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.offload.runs();
POST/offload/runs/{runId}/cancelStop an offloaded command

Stops a command running on a runner, with everything it started there.

What you send

FieldTypeWhere
runIdrequiredstringaddress

What comes back

FieldType
okAlways truetrue
Try itanswered in this tab
curl
curl -X POST "$SANDBOX/offload/runs/run_8c2f41d9/cancel" \
  -H "x-intentic-control: $INTENTIC_TOKEN"
TypeScript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.offload.cancel({
  "runId": "run_8c2f41d9"
});
GET/offload/kindsKinds of heavy work that can run elsewhere

The kinds this sandbox sorts heavy commands into (tests, typechecks, verify…), each of which can be sent to a runner on one of your machines instead of running here.

What you send

Nothing. Call it as it is.

What comes back

FieldType
kindsobject[]
idstring
patternstring
Try itanswered in this tab
curl
curl "$SANDBOX/offload/kinds" \
  -H "x-intentic-control: $INTENTIC_TOKEN"
TypeScript
import { sandbox } from "@intentic/sandbox-client";

const result = await sandbox.offload.kinds();

Type to search every page, in the docs and the API reference.