@moonsurf/sdk 0.1.0 → 0.2.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/index.d.ts CHANGED
@@ -1,13 +1,15 @@
1
1
  export type Status = 'missing' | 'untrusted' | 'ready';
2
2
  export type TrustResult = 'trusted' | 'denied' | 'blocked' | 'dismissed' | 'needs_user_gesture';
3
- export type FailureCode = 'needs_sign_in' | 'check_failed' | 'not_found' | 'step_timeout' | 'job_timeout' | 'left_allowed_site' | 'browser_unavailable' | 'tool_error' | 'outputs_too_large' | 'tab_closed' | 'detached';
3
+ export type FailureCode = 'needs_sign_in' | 'check_failed' | 'not_found' | 'step_timeout' | 'job_timeout' | 'left_allowed_site' | 'browser_unavailable' | 'tool_error' | 'outputs_too_large' | 'tab_closed' | 'detached' | 'request_failed' | 'too_many_requests';
4
4
  export type RefusalReason = 'not_trusted' | 'needs_user_gesture' | 'request_invalid' | 'job_seen' | 'busy' | 'recipe_invalid' | 'host_not_allowed' | 'inputs_invalid' | 'input_not_allowed' | 'user_denied' | 'prompt_expired' | 'unsupported_version';
5
- export type RunResult = {
5
+ export type RunResult =
6
+ /** `outputs`: a read step gives a string; a request step gives JSON (an `each` request: `[{ item, value } | { item, error }]`). */
7
+ {
6
8
  v: 1;
7
9
  requestId: string;
8
10
  status: 'succeeded';
9
11
  recipeHash: string;
10
- outputs: Record<string, string>;
12
+ outputs: Record<string, unknown>;
11
13
  startedAt: string;
12
14
  finishedAt: string;
13
15
  } | {
package/dist/index.js CHANGED
@@ -146,13 +146,15 @@ const SENTENCES = {
146
146
  check_failed: '{site} didn’t show the page the automation expected.',
147
147
  not_found: 'Something the automation needed wasn’t on the page at {site}.',
148
148
  step_timeout: '{site} took too long to respond.',
149
- job_timeout: 'The automation took longer than 2 minutes and was stopped.',
149
+ job_timeout: 'The automation ran out of time and was stopped.',
150
150
  left_allowed_site: 'The page went to a site the automation isn’t allowed to use, so it stopped.',
151
151
  browser_unavailable: 'The browser tab went away before the automation finished.',
152
152
  tool_error: 'The browser couldn’t do one of the steps.',
153
153
  outputs_too_large: 'The automation read more than it may send back.',
154
154
  tab_closed: 'The tab was closed before the automation finished.',
155
155
  detached: 'The automation was stopped from Chrome’s debugging bar.',
156
+ request_failed: '{site} didn’t answer one of the automation’s requests.',
157
+ too_many_requests: 'The automation made more than 500 requests and was stopped.',
156
158
  not_trusted: 'Moonsurf doesn’t trust this site yet.',
157
159
  needs_user_gesture: 'Start the automation with a click.',
158
160
  busy: 'Another automation is running in this browser. Try again when it ends.',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moonsurf/sdk",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Run Moonsurf recipes in the person's browser from your web app, through the Moonsurf extension, with their approval.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",