@mindstudio-ai/agent 0.1.130 → 0.1.131

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
@@ -23,15 +23,15 @@ interface PutOptions {
23
23
  */
24
24
  contentAddressed?: boolean;
25
25
  /**
26
- * Cache-Control header stored on the object and served by the CDN — this is
27
- * how you control public-read freshness. Defaults (public stores):
28
- * auto-minted keys (`key` omitted — UUID or content-addressed, never
29
- * reused) → `public, max-age=31536000, immutable`; explicitly named
30
- * (overwritable) keys → `public, max-age=300`, so an overwrite propagates
31
- * within ~5 minutes. Recipes: `'public, max-age=31536000, immutable'`
32
- * (content never changes at this key), `'public, max-age=60'` (near-live
33
- * config), `'no-store'` (revalidate every read). Validated server-side —
34
- * known directives only.
26
+ * Cache-Control header stored on the object: how long a browser that
27
+ * already fetched a public file may keep its copy, at most an hour. The CDN
28
+ * itself drops a public file when it is overwritten or deleted. Defaults
29
+ * (public stores): auto-minted keys (`key` omitted — UUID or
30
+ * content-addressed, never reused) → an hour; explicitly named (overwritable)
31
+ * keys → `public, max-age=300`, so an overwrite reaches every browser within
32
+ * ~5 minutes. Recipes: `'public, max-age=60'` (near-live config),
33
+ * `'no-store'` (revalidate every read). Validated server-side — known
34
+ * directives only; a longer `max-age`, or `immutable`, is capped at an hour.
35
35
  */
36
36
  cacheControl?: string;
37
37
  }
@@ -7214,7 +7214,7 @@ interface ScrapeUrlStepInput {
7214
7214
  outputFormat?: "text" | "json" | "html" | "summary";
7215
7215
  /** Page-level scraping options (content filtering, screenshots, headers, etc.) */
7216
7216
  pageOptions?: {
7217
- /** Whether to extract only the main content of the page, excluding navigation, footers, etc. */
7217
+ /** Whether to extract only the main content of the page, excluding navigation, footers, etc. Firecrawl only. */
7218
7218
  onlyMainContent: boolean;
7219
7219
  /** Whether to capture a screenshot of the page */
7220
7220
  screenshot: boolean;
@@ -7224,9 +7224,9 @@ interface ScrapeUrlStepInput {
7224
7224
  replaceAllPathsWithAbsolutePaths: boolean;
7225
7225
  /** Custom HTTP request headers as key-value pairs */
7226
7226
  headers: Record<string, unknown>;
7227
- /** HTML tags to remove from the scraped result */
7227
+ /** HTML tags to remove from the scraped result. Firecrawl only. */
7228
7228
  removeTags: string[];
7229
- /** Whether to scrape using a mobile user-agent */
7229
+ /** Whether to scrape using a mobile user-agent. Firecrawl only. */
7230
7230
  mobile: boolean;
7231
7231
  };
7232
7232
  }
@@ -7252,7 +7252,7 @@ interface ScrapeUrlStepOutput {
7252
7252
  /** Open Graph image URL */
7253
7253
  image: string;
7254
7254
  };
7255
- /** Set when the scrape failed. `text`/`html` still carry the human-readable error so existing callers behave as before, but callers that care — billing, in particular — can tell a failure from real page content. */
7255
+ /** Set when the scrape failed. `text`/`html` still carry the human-readable error for callers that only read those, and callers that care — billing, in particular — can tell a failure from real page content. */
7256
7256
  error?: {
7257
7257
  code: string;
7258
7258
  message: string;
@@ -7283,7 +7283,7 @@ interface ScrapeUrlStepOutput {
7283
7283
  /** Open Graph image URL */
7284
7284
  image: string;
7285
7285
  };
7286
- /** Set when the scrape failed. `text`/`html` still carry the human-readable error so existing callers behave as before, but callers that care — billing, in particular — can tell a failure from real page content. */
7286
+ /** Set when the scrape failed. `text`/`html` still carry the human-readable error for callers that only read those, and callers that care — billing, in particular — can tell a failure from real page content. */
7287
7287
  error?: {
7288
7288
  code: string;
7289
7289
  message: string;
@@ -7324,7 +7324,7 @@ interface ScrapeXPostStepOutput {
7324
7324
  /** Open Graph image URL */
7325
7325
  image: string;
7326
7326
  };
7327
- /** Set when the scrape failed. `text`/`html` still carry the human-readable error so existing callers behave as before, but callers that care — billing, in particular — can tell a failure from real page content. */
7327
+ /** Set when the scrape failed. `text`/`html` still carry the human-readable error for callers that only read those, and callers that care — billing, in particular — can tell a failure from real page content. */
7328
7328
  error?: {
7329
7329
  code: string;
7330
7330
  message: string;
@@ -7363,7 +7363,7 @@ interface ScrapeXProfileStepOutput {
7363
7363
  /** Open Graph image URL */
7364
7364
  image: string;
7365
7365
  };
7366
- /** Set when the scrape failed. `text`/`html` still carry the human-readable error so existing callers behave as before, but callers that care — billing, in particular — can tell a failure from real page content. */
7366
+ /** Set when the scrape failed. `text`/`html` still carry the human-readable error for callers that only read those, and callers that care — billing, in particular — can tell a failure from real page content. */
7367
7367
  error?: {
7368
7368
  code: string;
7369
7369
  message: string;
package/dist/index.js CHANGED
@@ -6,6 +6,9 @@ var MindStudioError = class extends Error {
6
6
  this.status = status;
7
7
  this.details = details;
8
8
  }
9
+ code;
10
+ status;
11
+ details;
9
12
  name = "MindStudioError";
10
13
  toString() {
11
14
  return `MindStudioError [${this.code}] (${this.status}): ${this.message}`;
@@ -120,6 +123,7 @@ var DbWsTransportError = class extends Error {
120
123
  super(message);
121
124
  this.sent = sent;
122
125
  }
126
+ sent;
123
127
  name = "DbWsTransportError";
124
128
  };
125
129
  function isReadOnlySql(sql) {
@@ -399,6 +403,7 @@ var RateLimiter = class {
399
403
  this.concurrencyLimit = DEFAULTS[authType].concurrency;
400
404
  this.callCap = DEFAULTS[authType].callCap;
401
405
  }
406
+ authType;
402
407
  inflight = 0;
403
408
  concurrencyLimit;
404
409
  callCount = 0;
@@ -1006,6 +1011,11 @@ var Parser = class {
1006
1011
  this.bindingsValue = bindingsValue;
1007
1012
  this.originalFn = originalFn;
1008
1013
  }
1014
+ tokens;
1015
+ paramName;
1016
+ bindingsName;
1017
+ bindingsValue;
1018
+ originalFn;
1009
1019
  pos = 0;
1010
1020
  /** Peek at the current token without consuming it. */
1011
1021
  peek() {
@@ -2864,6 +2874,10 @@ function resolveTable(databases, tableName, databaseHint) {
2864
2874
 
2865
2875
  // src/files/store.ts
2866
2876
  import { createHash, randomUUID } from "crypto";
2877
+ function fileUrl(access, store, key) {
2878
+ const path = key.split("/").map(encodeURIComponent).join("/");
2879
+ return `/_/files/${access}/${store}/${path}`;
2880
+ }
2867
2881
  function toBase64(content) {
2868
2882
  return Buffer.from(
2869
2883
  typeof content === "string" ? Buffer.from(content) : content
@@ -2884,6 +2898,10 @@ var Store = class {
2884
2898
  this._call = _call;
2885
2899
  this._policy = _policy;
2886
2900
  }
2901
+ _store;
2902
+ _access;
2903
+ _call;
2904
+ _policy;
2887
2905
  /** The store's name. */
2888
2906
  get name() {
2889
2907
  return this._store;
@@ -3077,7 +3095,7 @@ var Store = class {
3077
3095
  });
3078
3096
  return {
3079
3097
  key,
3080
- url: `/_/files/${this._access}/${this._store}/${key}`,
3098
+ url: fileUrl(this._access, this._store, key),
3081
3099
  upload: { url: res.uploadUrl, fields: res.uploadFields }
3082
3100
  };
3083
3101
  }
@@ -3089,7 +3107,7 @@ var Store = class {
3089
3107
  store,
3090
3108
  key,
3091
3109
  access,
3092
- url: `/_/files/${access}/${store}/${key}`,
3110
+ url: fileUrl(access, store, key),
3093
3111
  ...typeof meta?.size === "number" ? { size: meta.size } : {},
3094
3112
  ...meta?.contentType ? { contentType: meta.contentType } : {},
3095
3113
  ...meta?.updatedAt ? { updatedAt: meta.updatedAt } : {},
@@ -3126,6 +3144,8 @@ var DataSource = class {
3126
3144
  this._slug = _slug;
3127
3145
  this._call = _call;
3128
3146
  }
3147
+ _slug;
3148
+ _call;
3129
3149
  get name() {
3130
3150
  return this._slug;
3131
3151
  }
@@ -4386,22 +4406,22 @@ var stepMetadata = {
4386
4406
  stepType: "scrapeUrl",
4387
4407
  description: "Extract text, HTML, or structured content from one or more web pages.",
4388
4408
  usageNotes: '- Accepts a single URL or multiple URLs (as a JSON array, comma-separated, or newline-separated).\n- Output format controls the result shape: "text" returns markdown, "html" returns raw HTML, "json" returns structured scraper data, "summary" returns a model-written summary and requires the "firecrawl" service.\n- Can optionally capture a screenshot of each page. Screenshots go to the public CDN by default, or into one of the app\'s own file stores when the call passes `store`.\n- Handles bot protection automatically; no proxy or rendering configuration is needed.',
4389
- inputSchema: { "type": "object", "properties": { "url": { "type": "string", "description": "URL(s) to scrape. Accepts a single URL, JSON array, or comma/newline-separated list" }, "service": { "enum": ["default", "firecrawl"], "type": "string", "description": "Scraping service to use" }, "autoEnhance": { "type": "boolean", "description": "No longer selects a provider \u2014 the default service's anti-bot engine decides per request how hard to work. Retained because existing workflows set it and the builder still renders it." }, "outputFormat": { "enum": ["text", "json", "html", "summary"], "type": "string", "description": "Output format: text returns markdown, html returns raw HTML, json returns structured scraper data, summary returns a model-written summary (Firecrawl only)" }, "pageOptions": { "type": "object", "properties": { "onlyMainContent": { "type": "boolean", "description": "Whether to extract only the main content of the page, excluding navigation, footers, etc." }, "screenshot": { "type": "boolean", "description": "Whether to capture a screenshot of the page" }, "waitFor": { "type": "number", "description": "Milliseconds to wait before scraping (0 for immediate)" }, "replaceAllPathsWithAbsolutePaths": { "type": "boolean", "description": "Whether to convert relative URLs to absolute URLs in the result" }, "headers": { "type": "object", "properties": {}, "required": [], "description": "Custom HTTP request headers as key-value pairs" }, "removeTags": { "type": "array", "items": { "type": "string" }, "description": "HTML tags to remove from the scraped result" }, "mobile": { "type": "boolean", "description": "Whether to scrape using a mobile user-agent" } }, "required": ["onlyMainContent", "screenshot", "waitFor", "replaceAllPathsWithAbsolutePaths", "headers", "removeTags", "mobile"], "description": "Page-level scraping options (content filtering, screenshots, headers, etc.)" } }, "required": ["url"] },
4390
- outputSchema: { "type": "object", "properties": { "content": { "anyOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }, { "type": "object", "properties": { "text": { "type": "string", "description": "Markdown/plain-text content of the scraped page" }, "html": { "type": "string", "description": "Raw HTML content of the scraped page" }, "json": { "type": "object", "properties": {}, "required": [], "description": "Structured data extracted from the page" }, "screenshotUrl": { "type": "string", "description": "Screenshot URL of the page (if requested)" }, "metadata": { "type": "object", "properties": { "title": { "type": "string", "description": "Page title" }, "description": { "type": "string", "description": "Page meta description" }, "url": { "type": "string", "description": "Canonical URL" }, "image": { "type": "string", "description": "Open Graph image URL" } }, "required": ["title", "description", "url", "image"], "description": "Page metadata (Open Graph / meta tags)" }, "error": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } }, "required": ["code", "message"], "description": "Set when the scrape failed. `text`/`html` still carry the human-readable error so existing callers behave as before, but callers that care \u2014 billing, in particular \u2014 can tell a failure from real page content." }, "costUnits": { "type": "number", "description": "What the provider actually charged, when it tells us. Scrapfly returns an exact per-request credit total that varies with how hard the target fought back (6 for an unprotected page, 80 for Glassdoor), so billing a flat rate would either overcharge the easy case or eat the hard one. Providers that report nothing leave this undefined and fall back to the route's estimate.\n\nIncludes every attempt made on the caller's behalf, not just the last one." } }, "required": ["text", "html"] }, { "type": "array", "items": { "type": "object", "properties": { "text": { "type": "string", "description": "Markdown/plain-text content of the scraped page" }, "html": { "type": "string", "description": "Raw HTML content of the scraped page" }, "json": { "type": "object", "properties": {}, "required": [], "description": "Structured data extracted from the page" }, "screenshotUrl": { "type": "string", "description": "Screenshot URL of the page (if requested)" }, "metadata": { "type": "object", "properties": { "title": { "type": "string", "description": "Page title" }, "description": { "type": "string", "description": "Page meta description" }, "url": { "type": "string", "description": "Canonical URL" }, "image": { "type": "string", "description": "Open Graph image URL" } }, "required": ["title", "description", "url", "image"], "description": "Page metadata (Open Graph / meta tags)" }, "error": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } }, "required": ["code", "message"], "description": "Set when the scrape failed. `text`/`html` still carry the human-readable error so existing callers behave as before, but callers that care \u2014 billing, in particular \u2014 can tell a failure from real page content." }, "costUnits": { "type": "number", "description": "What the provider actually charged, when it tells us. Scrapfly returns an exact per-request credit total that varies with how hard the target fought back (6 for an unprotected page, 80 for Glassdoor), so billing a flat rate would either overcharge the easy case or eat the hard one. Providers that report nothing leave this undefined and fall back to the route's estimate.\n\nIncludes every attempt made on the caller's behalf, not just the last one." } }, "required": ["text", "html"] } }] }, "screenshot": { "anyOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }] } }, "required": ["content"] }
4409
+ inputSchema: { "type": "object", "properties": { "url": { "type": "string", "description": "URL(s) to scrape. Accepts a single URL, JSON array, or comma/newline-separated list" }, "service": { "enum": ["default", "firecrawl"], "type": "string", "description": "Scraping service to use" }, "autoEnhance": { "type": "boolean", "description": "No longer selects a provider \u2014 the default service's anti-bot engine decides per request how hard to work. Retained because existing workflows set it and the builder still renders it." }, "outputFormat": { "enum": ["text", "json", "html", "summary"], "type": "string", "description": "Output format: text returns markdown, html returns raw HTML, json returns structured scraper data, summary returns a model-written summary (Firecrawl only)" }, "pageOptions": { "type": "object", "properties": { "onlyMainContent": { "type": "boolean", "description": "Whether to extract only the main content of the page, excluding navigation, footers, etc. Firecrawl only." }, "screenshot": { "type": "boolean", "description": "Whether to capture a screenshot of the page" }, "waitFor": { "type": "number", "description": "Milliseconds to wait before scraping (0 for immediate)" }, "replaceAllPathsWithAbsolutePaths": { "type": "boolean", "description": "Whether to convert relative URLs to absolute URLs in the result" }, "headers": { "type": "object", "properties": {}, "required": [], "description": "Custom HTTP request headers as key-value pairs" }, "removeTags": { "type": "array", "items": { "type": "string" }, "description": "HTML tags to remove from the scraped result. Firecrawl only." }, "mobile": { "type": "boolean", "description": "Whether to scrape using a mobile user-agent. Firecrawl only." } }, "required": ["onlyMainContent", "screenshot", "waitFor", "replaceAllPathsWithAbsolutePaths", "headers", "removeTags", "mobile"], "description": "Page-level scraping options (content filtering, screenshots, headers, etc.)" } }, "required": ["url"] },
4410
+ outputSchema: { "type": "object", "properties": { "content": { "anyOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }, { "type": "object", "properties": { "text": { "type": "string", "description": "Markdown/plain-text content of the scraped page" }, "html": { "type": "string", "description": "Raw HTML content of the scraped page" }, "json": { "type": "object", "properties": {}, "required": [], "description": "Structured data extracted from the page" }, "screenshotUrl": { "type": "string", "description": "Screenshot URL of the page (if requested)" }, "metadata": { "type": "object", "properties": { "title": { "type": "string", "description": "Page title" }, "description": { "type": "string", "description": "Page meta description" }, "url": { "type": "string", "description": "Canonical URL" }, "image": { "type": "string", "description": "Open Graph image URL" } }, "required": ["title", "description", "url", "image"], "description": "Page metadata (Open Graph / meta tags)" }, "error": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } }, "required": ["code", "message"], "description": "Set when the scrape failed. `text`/`html` still carry the human-readable error for callers that only read those, and callers that care \u2014 billing, in particular \u2014 can tell a failure from real page content." }, "costUnits": { "type": "number", "description": "What the provider actually charged, when it tells us. Scrapfly returns an exact per-request credit total that varies with how hard the target fought back (6 for an unprotected page, 80 for Glassdoor), so billing a flat rate would either overcharge the easy case or eat the hard one. Providers that report nothing leave this undefined and fall back to the route's estimate.\n\nIncludes every attempt made on the caller's behalf, not just the last one." } }, "required": ["text", "html"] }, { "type": "array", "items": { "type": "object", "properties": { "text": { "type": "string", "description": "Markdown/plain-text content of the scraped page" }, "html": { "type": "string", "description": "Raw HTML content of the scraped page" }, "json": { "type": "object", "properties": {}, "required": [], "description": "Structured data extracted from the page" }, "screenshotUrl": { "type": "string", "description": "Screenshot URL of the page (if requested)" }, "metadata": { "type": "object", "properties": { "title": { "type": "string", "description": "Page title" }, "description": { "type": "string", "description": "Page meta description" }, "url": { "type": "string", "description": "Canonical URL" }, "image": { "type": "string", "description": "Open Graph image URL" } }, "required": ["title", "description", "url", "image"], "description": "Page metadata (Open Graph / meta tags)" }, "error": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } }, "required": ["code", "message"], "description": "Set when the scrape failed. `text`/`html` still carry the human-readable error for callers that only read those, and callers that care \u2014 billing, in particular \u2014 can tell a failure from real page content." }, "costUnits": { "type": "number", "description": "What the provider actually charged, when it tells us. Scrapfly returns an exact per-request credit total that varies with how hard the target fought back (6 for an unprotected page, 80 for Glassdoor), so billing a flat rate would either overcharge the easy case or eat the hard one. Providers that report nothing leave this undefined and fall back to the route's estimate.\n\nIncludes every attempt made on the caller's behalf, not just the last one." } }, "required": ["text", "html"] } }] }, "screenshot": { "anyOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }] } }, "required": ["content"] }
4391
4411
  },
4392
4412
  "scrapeXPost": {
4393
4413
  stepType: "scrapeXPost",
4394
4414
  description: "Scrape data from a single X (Twitter) post by URL.",
4395
4415
  usageNotes: "- Returns structured post data (text, html, optional json/screenshot/metadata).\n- Optionally saves the text content to a variable.",
4396
4416
  inputSchema: { "type": "object", "properties": { "url": { "type": "string", "description": "Full URL to the X post (e.g. https://x.com/elonmusk/status/1655608985058267139)" } }, "required": ["url"] },
4397
- outputSchema: { "type": "object", "properties": { "post": { "type": "object", "properties": { "text": { "type": "string", "description": "Markdown/plain-text content of the scraped page" }, "html": { "type": "string", "description": "Raw HTML content of the scraped page" }, "json": { "type": "object", "properties": {}, "required": [], "description": "Structured data extracted from the page" }, "screenshotUrl": { "type": "string", "description": "Screenshot URL of the page (if requested)" }, "metadata": { "type": "object", "properties": { "title": { "type": "string", "description": "Page title" }, "description": { "type": "string", "description": "Page meta description" }, "url": { "type": "string", "description": "Canonical URL" }, "image": { "type": "string", "description": "Open Graph image URL" } }, "required": ["title", "description", "url", "image"], "description": "Page metadata (Open Graph / meta tags)" }, "error": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } }, "required": ["code", "message"], "description": "Set when the scrape failed. `text`/`html` still carry the human-readable error so existing callers behave as before, but callers that care \u2014 billing, in particular \u2014 can tell a failure from real page content." }, "costUnits": { "type": "number", "description": "What the provider actually charged, when it tells us. Scrapfly returns an exact per-request credit total that varies with how hard the target fought back (6 for an unprotected page, 80 for Glassdoor), so billing a flat rate would either overcharge the easy case or eat the hard one. Providers that report nothing leave this undefined and fall back to the route's estimate.\n\nIncludes every attempt made on the caller's behalf, not just the last one." } }, "required": ["text", "html"], "description": "Scraped post data including text, HTML, and optional structured JSON" } }, "required": ["post"] }
4417
+ outputSchema: { "type": "object", "properties": { "post": { "type": "object", "properties": { "text": { "type": "string", "description": "Markdown/plain-text content of the scraped page" }, "html": { "type": "string", "description": "Raw HTML content of the scraped page" }, "json": { "type": "object", "properties": {}, "required": [], "description": "Structured data extracted from the page" }, "screenshotUrl": { "type": "string", "description": "Screenshot URL of the page (if requested)" }, "metadata": { "type": "object", "properties": { "title": { "type": "string", "description": "Page title" }, "description": { "type": "string", "description": "Page meta description" }, "url": { "type": "string", "description": "Canonical URL" }, "image": { "type": "string", "description": "Open Graph image URL" } }, "required": ["title", "description", "url", "image"], "description": "Page metadata (Open Graph / meta tags)" }, "error": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } }, "required": ["code", "message"], "description": "Set when the scrape failed. `text`/`html` still carry the human-readable error for callers that only read those, and callers that care \u2014 billing, in particular \u2014 can tell a failure from real page content." }, "costUnits": { "type": "number", "description": "What the provider actually charged, when it tells us. Scrapfly returns an exact per-request credit total that varies with how hard the target fought back (6 for an unprotected page, 80 for Glassdoor), so billing a flat rate would either overcharge the easy case or eat the hard one. Providers that report nothing leave this undefined and fall back to the route's estimate.\n\nIncludes every attempt made on the caller's behalf, not just the last one." } }, "required": ["text", "html"], "description": "Scraped post data including text, HTML, and optional structured JSON" } }, "required": ["post"] }
4398
4418
  },
4399
4419
  "scrapeXProfile": {
4400
4420
  stepType: "scrapeXProfile",
4401
4421
  description: "Scrape public profile data from an X (Twitter) account by URL.",
4402
4422
  usageNotes: "- Returns structured profile data.\n- Optionally saves the result to a variable.",
4403
4423
  inputSchema: { "type": "object", "properties": { "url": { "type": "string", "description": "Full URL or username for the X profile (e.g. https://x.com/elonmusk)" } }, "required": ["url"] },
4404
- outputSchema: { "type": "object", "properties": { "profile": { "type": "object", "properties": { "text": { "type": "string", "description": "Markdown/plain-text content of the scraped page" }, "html": { "type": "string", "description": "Raw HTML content of the scraped page" }, "json": { "type": "object", "properties": {}, "required": [], "description": "Structured data extracted from the page" }, "screenshotUrl": { "type": "string", "description": "Screenshot URL of the page (if requested)" }, "metadata": { "type": "object", "properties": { "title": { "type": "string", "description": "Page title" }, "description": { "type": "string", "description": "Page meta description" }, "url": { "type": "string", "description": "Canonical URL" }, "image": { "type": "string", "description": "Open Graph image URL" } }, "required": ["title", "description", "url", "image"], "description": "Page metadata (Open Graph / meta tags)" }, "error": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } }, "required": ["code", "message"], "description": "Set when the scrape failed. `text`/`html` still carry the human-readable error so existing callers behave as before, but callers that care \u2014 billing, in particular \u2014 can tell a failure from real page content." }, "costUnits": { "type": "number", "description": "What the provider actually charged, when it tells us. Scrapfly returns an exact per-request credit total that varies with how hard the target fought back (6 for an unprotected page, 80 for Glassdoor), so billing a flat rate would either overcharge the easy case or eat the hard one. Providers that report nothing leave this undefined and fall back to the route's estimate.\n\nIncludes every attempt made on the caller's behalf, not just the last one." } }, "required": ["text", "html"], "description": "Scraped profile data including text, HTML, and optional structured JSON" } }, "required": ["profile"] }
4424
+ outputSchema: { "type": "object", "properties": { "profile": { "type": "object", "properties": { "text": { "type": "string", "description": "Markdown/plain-text content of the scraped page" }, "html": { "type": "string", "description": "Raw HTML content of the scraped page" }, "json": { "type": "object", "properties": {}, "required": [], "description": "Structured data extracted from the page" }, "screenshotUrl": { "type": "string", "description": "Screenshot URL of the page (if requested)" }, "metadata": { "type": "object", "properties": { "title": { "type": "string", "description": "Page title" }, "description": { "type": "string", "description": "Page meta description" }, "url": { "type": "string", "description": "Canonical URL" }, "image": { "type": "string", "description": "Open Graph image URL" } }, "required": ["title", "description", "url", "image"], "description": "Page metadata (Open Graph / meta tags)" }, "error": { "type": "object", "properties": { "code": { "type": "string" }, "message": { "type": "string" } }, "required": ["code", "message"], "description": "Set when the scrape failed. `text`/`html` still carry the human-readable error for callers that only read those, and callers that care \u2014 billing, in particular \u2014 can tell a failure from real page content." }, "costUnits": { "type": "number", "description": "What the provider actually charged, when it tells us. Scrapfly returns an exact per-request credit total that varies with how hard the target fought back (6 for an unprotected page, 80 for Glassdoor), so billing a flat rate would either overcharge the easy case or eat the hard one. Providers that report nothing leave this undefined and fall back to the route's estimate.\n\nIncludes every attempt made on the caller's behalf, not just the last one." } }, "required": ["text", "html"], "description": "Scraped profile data including text, HTML, and optional structured JSON" } }, "required": ["profile"] }
4405
4425
  },
4406
4426
  "screenshotUrl": {
4407
4427
  stepType: "screenshotUrl",
@@ -5204,6 +5224,10 @@ var TurnError = class extends Error {
5204
5224
  this.status = status;
5205
5225
  this.errorCode = errorCode;
5206
5226
  }
5227
+ retryable;
5228
+ phase;
5229
+ status;
5230
+ errorCode;
5207
5231
  };
5208
5232
  async function attemptTurn(httpConfig, body) {
5209
5233
  const url = `${httpConfig.baseUrl}/developer/v2/task/turn`;