@b3os/sdk 0.2.1 → 0.2.3

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.
Files changed (146) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/core/util.d.ts +1 -1
  3. package/dist/cjs/core/util.js +1 -1
  4. package/dist/cjs/generated/client.d.ts +18 -0
  5. package/dist/cjs/generated/client.js +34 -0
  6. package/dist/cjs/generated/client.js.map +1 -1
  7. package/dist/cjs/generated/errors.d.ts +1 -1
  8. package/dist/cjs/generated/errors.js +120 -0
  9. package/dist/cjs/generated/errors.js.map +1 -1
  10. package/dist/cjs/generated/ids.d.ts +89 -0
  11. package/dist/cjs/generated/ids.js +22 -0
  12. package/dist/cjs/generated/ids.js.map +1 -1
  13. package/dist/cjs/generated/jobs.js +4 -0
  14. package/dist/cjs/generated/jobs.js.map +1 -1
  15. package/dist/cjs/generated/ns/actions.d.ts +267 -33
  16. package/dist/cjs/generated/ns/actions.js +375 -33
  17. package/dist/cjs/generated/ns/actions.js.map +1 -1
  18. package/dist/cjs/generated/ns/agents.d.ts +656 -0
  19. package/dist/cjs/generated/ns/agents.js +989 -0
  20. package/dist/cjs/generated/ns/agents.js.map +1 -0
  21. package/dist/cjs/generated/ns/images.d.ts +162 -0
  22. package/dist/cjs/generated/ns/images.js +246 -0
  23. package/dist/cjs/generated/ns/images.js.map +1 -0
  24. package/dist/cjs/generated/ns/infer.d.ts +71 -3
  25. package/dist/cjs/generated/ns/infer.js +98 -3
  26. package/dist/cjs/generated/ns/infer.js.map +1 -1
  27. package/dist/cjs/generated/ns/keys.d.ts +3 -1
  28. package/dist/cjs/generated/ns/keys.js +3 -1
  29. package/dist/cjs/generated/ns/keys.js.map +1 -1
  30. package/dist/cjs/generated/ns/listeners.d.ts +163 -0
  31. package/dist/cjs/generated/ns/listeners.js +268 -0
  32. package/dist/cjs/generated/ns/listeners.js.map +1 -0
  33. package/dist/cjs/generated/ns/orgs.d.ts +10 -0
  34. package/dist/cjs/generated/ns/orgs.js +26 -1
  35. package/dist/cjs/generated/ns/orgs.js.map +1 -1
  36. package/dist/cjs/generated/ns/projects.d.ts +32 -0
  37. package/dist/cjs/generated/ns/projects.js +66 -0
  38. package/dist/cjs/generated/ns/projects.js.map +1 -1
  39. package/dist/cjs/generated/ns/render.d.ts +192 -21
  40. package/dist/cjs/generated/ns/render.js +267 -24
  41. package/dist/cjs/generated/ns/render.js.map +1 -1
  42. package/dist/cjs/generated/ns/requests.d.ts +3 -1
  43. package/dist/cjs/generated/ns/requests.js +3 -1
  44. package/dist/cjs/generated/ns/requests.js.map +1 -1
  45. package/dist/cjs/generated/ns/routines.d.ts +22 -4
  46. package/dist/cjs/generated/ns/routines.js +22 -4
  47. package/dist/cjs/generated/ns/routines.js.map +1 -1
  48. package/dist/cjs/generated/ns/sandboxes.d.ts +431 -7
  49. package/dist/cjs/generated/ns/sandboxes.js +633 -6
  50. package/dist/cjs/generated/ns/sandboxes.js.map +1 -1
  51. package/dist/cjs/generated/ns/usage.d.ts +1 -1
  52. package/dist/cjs/generated/ns/usage.js +1 -1
  53. package/dist/cjs/generated/ns/vision.d.ts +113 -17
  54. package/dist/cjs/generated/ns/vision.js +152 -21
  55. package/dist/cjs/generated/ns/vision.js.map +1 -1
  56. package/dist/cjs/generated/ns/workspaces.d.ts +225 -0
  57. package/dist/cjs/generated/ns/workspaces.js +410 -0
  58. package/dist/cjs/generated/ns/workspaces.js.map +1 -0
  59. package/dist/cjs/generated/types.d.ts +5259 -605
  60. package/dist/cjs/helpers/sandboxes.d.ts +20 -1
  61. package/dist/cjs/helpers/sandboxes.js +13 -1
  62. package/dist/cjs/helpers/sandboxes.js.map +1 -1
  63. package/dist/esm/core/util.d.ts +1 -1
  64. package/dist/esm/core/util.js +1 -1
  65. package/dist/esm/generated/client.d.ts +18 -0
  66. package/dist/esm/generated/client.js +34 -0
  67. package/dist/esm/generated/client.js.map +1 -1
  68. package/dist/esm/generated/errors.d.ts +1 -1
  69. package/dist/esm/generated/errors.js +120 -0
  70. package/dist/esm/generated/errors.js.map +1 -1
  71. package/dist/esm/generated/ids.d.ts +89 -0
  72. package/dist/esm/generated/ids.js +22 -0
  73. package/dist/esm/generated/ids.js.map +1 -1
  74. package/dist/esm/generated/jobs.js +4 -0
  75. package/dist/esm/generated/jobs.js.map +1 -1
  76. package/dist/esm/generated/ns/actions.d.ts +267 -33
  77. package/dist/esm/generated/ns/actions.js +375 -33
  78. package/dist/esm/generated/ns/actions.js.map +1 -1
  79. package/dist/esm/generated/ns/agents.d.ts +656 -0
  80. package/dist/esm/generated/ns/agents.js +985 -0
  81. package/dist/esm/generated/ns/agents.js.map +1 -0
  82. package/dist/esm/generated/ns/images.d.ts +162 -0
  83. package/dist/esm/generated/ns/images.js +242 -0
  84. package/dist/esm/generated/ns/images.js.map +1 -0
  85. package/dist/esm/generated/ns/infer.d.ts +71 -3
  86. package/dist/esm/generated/ns/infer.js +98 -3
  87. package/dist/esm/generated/ns/infer.js.map +1 -1
  88. package/dist/esm/generated/ns/keys.d.ts +3 -1
  89. package/dist/esm/generated/ns/keys.js +3 -1
  90. package/dist/esm/generated/ns/keys.js.map +1 -1
  91. package/dist/esm/generated/ns/listeners.d.ts +163 -0
  92. package/dist/esm/generated/ns/listeners.js +264 -0
  93. package/dist/esm/generated/ns/listeners.js.map +1 -0
  94. package/dist/esm/generated/ns/orgs.d.ts +10 -0
  95. package/dist/esm/generated/ns/orgs.js +26 -1
  96. package/dist/esm/generated/ns/orgs.js.map +1 -1
  97. package/dist/esm/generated/ns/projects.d.ts +32 -0
  98. package/dist/esm/generated/ns/projects.js +66 -0
  99. package/dist/esm/generated/ns/projects.js.map +1 -1
  100. package/dist/esm/generated/ns/render.d.ts +192 -21
  101. package/dist/esm/generated/ns/render.js +267 -24
  102. package/dist/esm/generated/ns/render.js.map +1 -1
  103. package/dist/esm/generated/ns/requests.d.ts +3 -1
  104. package/dist/esm/generated/ns/requests.js +3 -1
  105. package/dist/esm/generated/ns/requests.js.map +1 -1
  106. package/dist/esm/generated/ns/routines.d.ts +22 -4
  107. package/dist/esm/generated/ns/routines.js +22 -4
  108. package/dist/esm/generated/ns/routines.js.map +1 -1
  109. package/dist/esm/generated/ns/sandboxes.d.ts +431 -7
  110. package/dist/esm/generated/ns/sandboxes.js +633 -6
  111. package/dist/esm/generated/ns/sandboxes.js.map +1 -1
  112. package/dist/esm/generated/ns/usage.d.ts +1 -1
  113. package/dist/esm/generated/ns/usage.js +1 -1
  114. package/dist/esm/generated/ns/vision.d.ts +113 -17
  115. package/dist/esm/generated/ns/vision.js +152 -21
  116. package/dist/esm/generated/ns/vision.js.map +1 -1
  117. package/dist/esm/generated/ns/workspaces.d.ts +225 -0
  118. package/dist/esm/generated/ns/workspaces.js +406 -0
  119. package/dist/esm/generated/ns/workspaces.js.map +1 -0
  120. package/dist/esm/generated/types.d.ts +5259 -605
  121. package/dist/esm/helpers/sandboxes.d.ts +20 -1
  122. package/dist/esm/helpers/sandboxes.js +13 -1
  123. package/dist/esm/helpers/sandboxes.js.map +1 -1
  124. package/package.json +1 -1
  125. package/src/core/util.ts +1 -1
  126. package/src/generated/client.ts +38 -0
  127. package/src/generated/errors.ts +240 -0
  128. package/src/generated/ids.ts +22 -0
  129. package/src/generated/jobs.ts +4 -0
  130. package/src/generated/ns/actions.ts +403 -33
  131. package/src/generated/ns/agents.ts +1102 -0
  132. package/src/generated/ns/images.ts +256 -0
  133. package/src/generated/ns/infer.ts +100 -3
  134. package/src/generated/ns/keys.ts +3 -1
  135. package/src/generated/ns/listeners.ts +300 -0
  136. package/src/generated/ns/orgs.ts +27 -1
  137. package/src/generated/ns/projects.ts +74 -0
  138. package/src/generated/ns/render.ts +277 -24
  139. package/src/generated/ns/requests.ts +3 -1
  140. package/src/generated/ns/routines.ts +22 -4
  141. package/src/generated/ns/sandboxes.ts +694 -7
  142. package/src/generated/ns/usage.ts +1 -1
  143. package/src/generated/ns/vision.ts +159 -21
  144. package/src/generated/ns/workspaces.ts +448 -0
  145. package/src/generated/types.ts +5684 -601
  146. package/src/helpers/sandboxes.ts +31 -2
@@ -43,7 +43,7 @@ export class UsageAPI extends Namespace {
43
43
  /**
44
44
  * List usage records
45
45
  *
46
- * Lists individual usage records as nodes reported them, newest first, filterable by product, unit, key and request.
46
+ * Lists individual usage records as nodes reported them, newest first, filterable by product, unit, key, sandbox and request.
47
47
  *
48
48
  * `GET /v1/usage/records` · scope `platform:read` · served by beta-api.b3os.org
49
49
  */
@@ -95,7 +95,6 @@ const getExtractOp: Op = {
95
95
  path: "/v1/vision/extracts/{job_id}",
96
96
  params: ["job_id"],
97
97
  timeoutMs: 10000,
98
- stretch: true,
99
98
  scope: "vision:read",
100
99
  };
101
100
  const cancelExtractOp: Op = {
@@ -104,7 +103,6 @@ const cancelExtractOp: Op = {
104
103
  path: "/v1/vision/extracts/{job_id}/cancel",
105
104
  params: ["job_id"],
106
105
  timeoutMs: 10000,
107
- stretch: true,
108
106
  scope: "vision:run",
109
107
  };
110
108
  const extractEventsOp: Op = {
@@ -114,7 +112,29 @@ const extractEventsOp: Op = {
114
112
  params: ["job_id"],
115
113
  stream: "sse",
116
114
  timeoutMs: 3600000,
117
- stretch: true,
115
+ scope: "vision:read",
116
+ };
117
+ const listIdentitiesOp: Op = {
118
+ id: "visionListIdentities",
119
+ method: "GET",
120
+ path: "/v1/vision/identities",
121
+ timeoutMs: 10000,
122
+ scope: "vision:read",
123
+ };
124
+ const retireIdentityOp: Op = {
125
+ id: "visionRetireIdentity",
126
+ method: "DELETE",
127
+ path: "/v1/vision/identities/{identity_id}",
128
+ params: ["identity_id"],
129
+ timeoutMs: 10000,
130
+ scope: "vision:write",
131
+ };
132
+ const getIdentityOp: Op = {
133
+ id: "visionGetIdentity",
134
+ method: "GET",
135
+ path: "/v1/vision/identities/{identity_id}",
136
+ params: ["identity_id"],
137
+ timeoutMs: 10000,
118
138
  scope: "vision:read",
119
139
  };
120
140
  const mapOp: Op = {
@@ -258,6 +278,14 @@ const actOp: Op = {
258
278
  timeoutMs: 65000,
259
279
  scope: "vision:run",
260
280
  };
281
+ const getSessionAuditOp: Op = {
282
+ id: "visionGetSessionAudit",
283
+ method: "GET",
284
+ path: "/v1/vision/sessions/{session_id}/audit",
285
+ params: ["session_id"],
286
+ timeoutMs: 10000,
287
+ scope: "vision:read",
288
+ };
261
289
  const connectCdpOp: Op = {
262
290
  id: "visionConnectCdp",
263
291
  method: "GET",
@@ -322,7 +350,6 @@ const createExtractOp: Op = {
322
350
  idem: true,
323
351
  stream: "sse",
324
352
  timeoutMs: 3600000,
325
- stretch: true,
326
353
  scope: "vision:run",
327
354
  job: { get: getExtractOp, events: extractEventsOp, cancel: cancelExtractOp },
328
355
  };
@@ -345,6 +372,9 @@ export const visionOps = {
345
372
  getExtract: getExtractOp,
346
373
  cancelExtract: cancelExtractOp,
347
374
  extractEvents: extractEventsOp,
375
+ listIdentities: listIdentitiesOp,
376
+ retireIdentity: retireIdentityOp,
377
+ getIdentity: getIdentityOp,
348
378
  map: mapOp,
349
379
  prepare: prepareOp,
350
380
  listProfiles: listProfilesOp,
@@ -361,6 +391,7 @@ export const visionOps = {
361
391
  closeSession: closeSessionOp,
362
392
  getSession: getSessionOp,
363
393
  act: actOp,
394
+ getSessionAudit: getSessionAuditOp,
364
395
  connectCdp: connectCdpOp,
365
396
  saveSessionProfile: saveSessionProfileOp,
366
397
  createSessionTicket: createSessionTicketOp,
@@ -390,7 +421,9 @@ export class VisionAPI extends Namespace {
390
421
  *
391
422
  * Starts a job that scrapes up to 1,000 URLs with the same options. Each delivered page bills one
392
423
  * `vision.page`, except a wall, which is free and carries only its state, status and final URL
393
- * (`content_withheld`) unless the page options set `walls: "bill"`, as for a single scrape (visionScrape).
424
+ * (`content_withheld`) unless the page options set `walls: "bill"`, as for a single scrape (visionScrape). A
425
+ * URL that serves a PDF is read as a single scrape reads it and bills one `vision.page` per PDF page read; a
426
+ * PDF that cannot be opened fails its page with `pdf_unreadable` or `pdf_encrypted`.
394
427
  * Results are listed with `GET /v1/vision/batches/{batch_id}/pages`; `?wait=`, the events stream and
395
428
  * `webhook` report progress.
396
429
  *
@@ -480,7 +513,9 @@ export class VisionAPI extends Namespace {
480
513
  * sitemap discovery starts from `/sitemap.xml`. One crawl runs at a time per organization.
481
514
  * Each delivered page bills one `vision.page`, except a wall, which is free and carries only its state, status
482
515
  * and final URL (`content_withheld`; its links are not followed) unless the page options set
483
- * `walls: "bill"`, as for a single scrape (visionScrape).
516
+ * `walls: "bill"`, as for a single scrape (visionScrape). Links to PDFs (paths that end in `.pdf`) are
517
+ * followed unless the page options set `pdf.mode: "off"`: each PDF is one page of `limit` and bills one
518
+ * `vision.page` per PDF page read. A PDF's links are not followed.
484
519
  *
485
520
  * `POST /v1/vision/crawls` · scope `vision:run` · served by the node
486
521
  */
@@ -549,13 +584,32 @@ export class VisionAPI extends Namespace {
549
584
  /**
550
585
  * Extract structured data
551
586
  *
552
- * Starts a job that scrapes up to 10 URLs and asks the node's model to fill your JSON Schema from their
553
- * content (with `prompt` as guidance). The result is validated against the schema; an invalid result after
554
- * retries fails the job with `extraction_failed`. Bills `vision.page` per page plus the model's tokens.
587
+ * Starts a job that scrapes up to 10 URLs (PDFs included) and has the node's model fill your JSON Schema from
588
+ * their Markdown, with `prompt` as guidance. With `prompt` alone the model answers one JSON object, which is
589
+ * not validated. At least one of `schema` and `prompt` is required.
590
+ *
591
+ * The schema is checked when the job is created: one that does not compile, uses a remote `$ref`, is larger
592
+ * than 64 KiB or nests deeper than 32 levels answers 400 with a pointer under `/schema`, before anything runs
593
+ * or bills. `scrape` takes the page options of a batch, except that the only format is `markdown`.
594
+ *
595
+ * The pages go to the model together in one call when they fit its context window, else one call per page
596
+ * (or per piece of a long page) whose answers are merged: objects key by key, arrays concatenated without
597
+ * duplicates, and for a single value the first page's, with a warning when another page says otherwise. The
598
+ * model may answer null where the pages do not state a value. The answer is then validated against your
599
+ * schema: a required field no page states fails the job with `extract_fields_missing` (one `errors[]` item per
600
+ * pointer, the rest of the object in `partial_data`), and an answer that does not match is retried once with
601
+ * the errors, then fails with `extraction_failed` (`reason: invalid_answer`). URLs that fail to scrape are
602
+ * listed in `result.pages` and the job goes on with the rest; when every URL fails, the job fails with
603
+ * `extraction_failed` (`reason: no_pages`). `result.field_sources` names the pages each top-level field came
604
+ * from. The data is the model's reading of the pages, so check the values that matter.
605
+ *
606
+ * Needs `infer:run` as well as `vision:run`: the model is called as you, through
607
+ * `POST /v1/infer/chat/completions`, and a node with no model answers 503 `product_unavailable`
608
+ * (`reason: model`). Bills `vision.page` per page read (a PDF one per page read) and the model's tokens
609
+ * (`infer.input_tokens`, `infer.output_tokens`). A job that fails or is canceled after it read pages or called
610
+ * the model keeps those billed, `extract_fields_missing` included.
555
611
  *
556
612
  * `POST /v1/vision/extracts` · scope `vision:run` · served by the node
557
- *
558
- * Stretch: in the contract, but may answer `501 not_implemented` on this deployment.
559
613
  */
560
614
  createExtract(body: T.ExtractCreateRequest, options?: RequestOptions): JobPromise<T.ExtractJob, T.JobEvent> {
561
615
  return this._client._job<T.ExtractJob, T.JobEvent>(createExtractOp, { body }, options);
@@ -567,8 +621,6 @@ export class VisionAPI extends Namespace {
567
621
  * Returns the extraction job; `result.data` holds the extracted JSON once it succeeded.
568
622
  *
569
623
  * `GET /v1/vision/extracts/{job_id}` · scope `vision:read` · served by the node
570
- *
571
- * Stretch: in the contract, but may answer `501 not_implemented` on this deployment.
572
624
  */
573
625
  getExtract(jobId: string, options?: RequestOptions): APIPromise<T.ExtractJob> {
574
626
  return this._client._call<T.ExtractJob>(getExtractOp, { path: [jobId] }, options);
@@ -580,8 +632,6 @@ export class VisionAPI extends Namespace {
580
632
  * Stops the extraction. Pages already scraped and tokens already used stay billed.
581
633
  *
582
634
  * `POST /v1/vision/extracts/{job_id}/cancel` · scope `vision:run` · served by the node
583
- *
584
- * Stretch: in the contract, but may answer `501 not_implemented` on this deployment.
585
635
  */
586
636
  cancelExtract(jobId: string, options?: RequestOptions): APIPromise<T.ExtractJob> {
587
637
  return this._client._call<T.ExtractJob>(cancelExtractOp, { path: [jobId] }, options);
@@ -593,8 +643,6 @@ export class VisionAPI extends Namespace {
593
643
  * Server-sent lifecycle events for the extraction job. Ends after the terminal event.
594
644
  *
595
645
  * `GET /v1/vision/extracts/{job_id}/events` · scope `vision:read` · served by the node
596
- *
597
- * Stretch: in the contract, but may answer `501 not_implemented` on this deployment.
598
646
  */
599
647
  extractEvents(jobId: string, options?: StreamOptions): EventStream<T.JobEvent> {
600
648
  return this._client._stream<T.JobEvent>(extractEventsOp, { path: [jobId] }, options, {
@@ -603,6 +651,50 @@ export class VisionAPI extends Namespace {
603
651
  });
604
652
  }
605
653
 
654
+ /**
655
+ * List stealth identities
656
+ *
657
+ * Lists your organization's stealth identities, newest first, retired ones included. A stealth session
658
+ * (`stealth` on `POST /v1/vision/sessions`) makes a new identity when it names none and its profile has none;
659
+ * new identities per day and active identities in all are limits (`vision.stealth.identities.daily`,
660
+ * `vision.stealth.identities.max`). Behind the `vision.stealth` feature flag: until it is on for your
661
+ * organization the operation answers `404 feature_not_enabled`.
662
+ *
663
+ * `GET /v1/vision/identities` · scope `vision:read` · served by the node
664
+ */
665
+ listIdentities(
666
+ params?: T.VisionListIdentitiesParams,
667
+ options?: RequestOptions,
668
+ ): ListPromise<T.StealthIdentityList, T.StealthIdentity> {
669
+ return this._client._list<T.StealthIdentityList, T.StealthIdentity>(listIdentitiesOp, { query: params }, options);
670
+ }
671
+
672
+ /**
673
+ * Retire a stealth identity
674
+ *
675
+ * Retires the identity: no new session uses it (a create that names it answers `409 identity_retired`), and
676
+ * it no longer counts toward `vision.stealth.identities.max`. Its record stays, and it still counts toward the
677
+ * day's new identities. Sessions already using it are not closed. Retiring a retired identity changes nothing.
678
+ * Behind the `vision.stealth` feature flag.
679
+ *
680
+ * `DELETE /v1/vision/identities/{identity_id}` · scope `vision:write` · served by the node
681
+ */
682
+ retireIdentity(identityId: string, options?: RequestOptions): APIPromise<T.StealthIdentity> {
683
+ return this._client._call<T.StealthIdentity>(retireIdentityOp, { path: [identityId] }, options);
684
+ }
685
+
686
+ /**
687
+ * Get a stealth identity
688
+ *
689
+ * One stealth identity of your organization: what its browser presents (screen, window, fonts), its home
690
+ * region and how often it was used. Behind the `vision.stealth` feature flag.
691
+ *
692
+ * `GET /v1/vision/identities/{identity_id}` · scope `vision:read` · served by the node
693
+ */
694
+ getIdentity(identityId: string, options?: RequestOptions): APIPromise<T.StealthIdentity> {
695
+ return this._client._call<T.StealthIdentity>(getIdentityOp, { path: [identityId] }, options);
696
+ }
697
+
606
698
  /**
607
699
  * Map a site's URLs
608
700
  *
@@ -773,6 +865,17 @@ export class VisionAPI extends Namespace {
773
865
  * Synchronous: the response arrives when the page is done, within `timeout_ms` (at most 60 seconds). For
774
866
  * many pages use a batch scrape or a crawl.
775
867
  *
868
+ * PDFs: a URL that serves a PDF (an `application/pdf` type, or an octet-stream or untyped body that starts
869
+ * with `%PDF-`) is read from its text layer by the HTTP fetch tier, never by a browser, and returns Markdown:
870
+ * text in reading order, headings, lists, tables where the columns are clear, and the marker
871
+ * `<!-- page N -->` between pages (`pdf.page_markers`). `pdf` in the result carries the page counts, the
872
+ * document's own metadata and `truncated` when a cap stopped the read (`pdf.max_pages`, the node's
873
+ * `vision.pdf.pages_max`, about 2 million characters, or the time left). A PDF bills one `vision.page` per page
874
+ * read, not one per file, and is never served from the cache (`cache.state: bypass`). Scanned pages have no
875
+ * text layer and give a warning (OCR is not available yet). A PDF that cannot be opened answers `422
876
+ * pdf_unreadable` or `422 pdf_encrypted` and bills nothing; `pdf.mode: "off"` answers `422
877
+ * content_type_unsupported` for a PDF, as before PDFs were read.
878
+ *
776
879
  * Billing: one `vision.page` for a page that is returned, whichever tier served it. A free scrape never
777
880
  * carries page content. A scrape that returns no page (an error answer: upstream error, timeout, blocked
778
881
  * target, egress denial, extraction failure, a cache-only miss) bills nothing and does not count against the
@@ -792,6 +895,18 @@ export class VisionAPI extends Namespace {
792
895
  * A browser that goes away during the render (the node's Chrome launcher stopped or restarted) answers `503
793
896
  * product_unavailable` with `Retry-After`: retry, the node reconnects to the launcher by itself.
794
897
  *
898
+ * Where the request leaves from (`proxy`): the node's own address by default. Your own `http://` proxy, with
899
+ * its username and password in a `basic` vault connection (`proxy.connection`, which needs `vault:run`), on
900
+ * the fetch tier and the browser tier alike. With `auto`, vision asks once more from a residential address for
901
+ * a page the node's address got as a wall (`page_state` `blocked` or `captcha`), which gets around the site's
902
+ * IP-based block; where residential reads are off, `auto` is exactly `none`. `residential` reads the page from
903
+ * a residential address, every request of the scrape. A residential read takes public pages only (no profile,
904
+ * credential header or actions), always follows robots.txt and Content Signals, skips sites on the opt-out
905
+ * list and some categories, keeps one address per organization and host, and never retries a 429 or 503. A page read through a proxy is never read from or stored in the cache. `egress` says which exit served
906
+ * the page, `options` and `X-B3OS-Options` which values applied. A page bills one `vision.page` whichever
907
+ * address it was read from; bytes are never billed. The bytes of residential reads (walls and robots.txt
908
+ * included) count against the monthly safety limit `vision.proxy.bytes.monthly`. Batches, crawls, sessions (but stealth sessions, which may take your own proxy) and the Firecrawl surface leave from the node's address.
909
+ *
795
910
  * `POST /v1/vision/scrape` · scope `vision:run` · served by the node
796
911
  */
797
912
  scrape(body: T.ScrapeRequest, options?: RequestOptions): APIPromise<T.ScrapeResult> {
@@ -844,6 +959,10 @@ export class VisionAPI extends Namespace {
844
959
  * session closes after `timeout_s` (at most 1,800) or on `DELETE`. Bills `vision.browser_ms` from claim to
845
960
  * close. A node whose Chrome runs without its own sandbox (`chrome_sandbox: off` in `/readyz`) answers
846
961
  * `503 product_unavailable`: one browser per session, with a renderer sandbox.
962
+ * `stealth` (needs the `vision.stealth` flag, invited organizations only) gives a session whose browser keeps
963
+ * one consistent identity and leaves through your own proxy or the node's address (`proxy`); see
964
+ * `StealthOption`. A node that serves no stealth browser answers such a create with `503
965
+ * product_unavailable`.
847
966
  *
848
967
  * `POST /v1/vision/sessions` · scope `vision:write` · served by the node
849
968
  */
@@ -897,6 +1016,23 @@ export class VisionAPI extends Namespace {
897
1016
  return this._client._call<T.ActResult>(actOp, { path: [sessionId], body }, options);
898
1017
  }
899
1018
 
1019
+ /**
1020
+ * Get a stealth session's audit record
1021
+ *
1022
+ * The durable record of one stealth session, line by line, kept 400 days, also after the session itself is
1023
+ * no longer listed: who started it (organization, project, key, creator, the stealth terms version in force),
1024
+ * what it presented (identity, persona, stage, engine version, exit class and place), every connection its
1025
+ * browser opened (host, port, times, bytes), every main-frame navigation as origin and path (never the
1026
+ * query), challenges seen, refusals (the deny list, robots.txt), warnings, act step kinds and the close
1027
+ * reason. It never holds page content, form values, cookies, screenshots or CDP payloads. Behind the
1028
+ * `vision.stealth` feature flag; a session that was not a stealth session answers `404 session_not_found`.
1029
+ *
1030
+ * `GET /v1/vision/sessions/{session_id}/audit` · scope `vision:read` · served by the node
1031
+ */
1032
+ getSessionAudit(sessionId: string, options?: RequestOptions): APIPromise<T.StealthAudit> {
1033
+ return this._client._call<T.StealthAudit>(getSessionAuditOp, { path: [sessionId] }, options);
1034
+ }
1035
+
900
1036
  /**
901
1037
  * Connect over CDP
902
1038
  *
@@ -908,20 +1044,22 @@ export class VisionAPI extends Namespace {
908
1044
  * file access (`DOM.setFileInputFiles`, file drags); downloads to host paths (they land in the session's
909
1045
  * own directory, wiped with the browser); and navigation to anything but `http:`, `https:` and
910
1046
  * `about:blank` (`file:`, `chrome:`, `chrome-extension:`, `view-source:`, `devtools:`, `data:`). These
911
- * answer `cdp_method_blocked` in the CDP error (`error.data.code`). `Target.createBrowserContext` with
1047
+ * answer a CDP error whose `data` is `cdp_method_blocked` (a string, as Chrome's own errors carry it; `code`
1048
+ * and `status` are also in `error.b3os`). `Target.createBrowserContext` with
912
1049
  * `proxyServer`, `proxyBypassList` or `originsWithUniversalNetworkAccess` answers `forbidden` (403):
913
1050
  * every context of a session uses the session's egress. Reading the browser's cookies and storage, which
914
1051
  * hold any profile the session loaded, needs `vision:profiles:export`, as exporting a profile's state does
915
1052
  * (default keys, `*` and `vision:*` leave it out): without it, `Network.getAllCookies`,
916
1053
  * `Network.getCookies`, `Storage.getCookies`, `Storage.getSharedStorageEntries`, `DOMStorage.*`,
917
- * `IndexedDB.*` and `CacheStorage.*` answer `forbidden` (403) with `required_scope` in `error.data`, and
1054
+ * `IndexedDB.*` and `CacheStorage.*` answer `forbidden` (403) with `required_scope` in `error.b3os`, and
918
1055
  * network events reach the client without `Cookie` and `Set-Cookie` headers, raw header text or cookie
919
1056
  * lists. Until the profile scopes' kept window ends (2026-11-16) these reads still work. Scripts in the page
920
1057
  * are not filtered: `Runtime.evaluate` reads what the page's own scripts can, such as `document.cookie`
921
1058
  * (without HttpOnly cookies) and `localStorage`. Authenticate with the `Authorization` header or a
922
1059
  * ticket from `POST /v1/vision/sessions/{session_id}/ticket`. A client that falls more than a few MB
923
- * behind is disconnected, and so is one that sends a message over 32 MiB. A message with a repeated member
924
- * (two `method`s, say) answers the JSON-RPC parse error `-32700`.
1060
+ * behind is disconnected, and so is one that sends a message over 32 MiB. A session takes at most 4 CDP
1061
+ * clients at once; the next answers `429 concurrency_limited` until one disconnects. A message with a
1062
+ * repeated member (two `method`s, say) answers the JSON-RPC parse error `-32700`.
925
1063
  *
926
1064
  * `GET /v1/vision/sessions/{session_id}/cdp` · scope `vision:run` · served by the node
927
1065
  */