@eyepop.ai/eyepop 3.7.2 → 3.9.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.
@@ -8661,13 +8661,16 @@ __export(index_exports, {
8661
8661
  ArtifactType: () => ArtifactType,
8662
8662
  AssetStatus: () => AssetStatus,
8663
8663
  AssetUrlType: () => AssetUrlType,
8664
+ AutoAnnotateStatus: () => AutoAnnotateStatus,
8664
8665
  AutoAnnotateTask: () => AutoAnnotateTask,
8665
8666
  ChangeType: () => ChangeType,
8666
8667
  ContourType: () => ContourType,
8667
8668
  DEFAULT_PREDICTION_VERSION: () => DEFAULT_PREDICTION_VERSION,
8669
+ DataApiType: () => DataApiType,
8668
8670
  DataEndpoint: () => DataEndpoint,
8669
8671
  Endpoint: () => Endpoint,
8670
8672
  EndpointState: () => EndpointState,
8673
+ EvaluationStatus: () => EvaluationStatus,
8671
8674
  ExportedBy: () => ExportedBy,
8672
8675
  EyePop: () => EyePop,
8673
8676
  EyepopLineDecoder: () => EyepopLineDecoder,
@@ -8694,12 +8697,14 @@ __export(index_exports, {
8694
8697
  UploadJob: () => UploadJob,
8695
8698
  UserReview: () => UserReview,
8696
8699
  VideoMode: () => VideoMode,
8700
+ VlmAbilityStatus: () => VlmAbilityStatus,
8697
8701
  WebrtcBase: () => WebrtcBase,
8698
8702
  WebrtcWhep: () => WebrtcWhep,
8699
8703
  WebrtcWhip: () => WebrtcWhip,
8700
8704
  WorkerEndpoint: () => WorkerEndpoint,
8701
8705
  WorkflowPhase: () => WorkflowPhase,
8702
8706
  default: () => index_default,
8707
+ getBaseUrl: () => getBaseUrl,
8703
8708
  readableStreamFromString: () => readableStreamFromString
8704
8709
  });
8705
8710
  module.exports = __toCommonJS(index_exports);
@@ -10708,6 +10713,28 @@ function urlJoin() {
10708
10713
  }
10709
10714
 
10710
10715
  // data/data_types.ts
10716
+ var DataApiType = /* @__PURE__ */ ((DataApiType2) => {
10717
+ DataApiType2["dataset"] = "dataset";
10718
+ DataApiType2["vlm"] = "vlm";
10719
+ return DataApiType2;
10720
+ })(DataApiType || {});
10721
+ function getBaseUrl(session, dataApiType) {
10722
+ switch (dataApiType) {
10723
+ case "dataset" /* dataset */:
10724
+ return session.datasetApiUrl ?? "";
10725
+ case "vlm" /* vlm */:
10726
+ return session.vlmApiUrl ?? "";
10727
+ default:
10728
+ throw new Error(`unsupported type ${dataApiType}`);
10729
+ }
10730
+ }
10731
+ var AutoAnnotateStatus = /* @__PURE__ */ ((AutoAnnotateStatus2) => {
10732
+ AutoAnnotateStatus2["error"] = "error";
10733
+ AutoAnnotateStatus2["requested"] = "requested";
10734
+ AutoAnnotateStatus2["in_progress"] = "in_progress";
10735
+ AutoAnnotateStatus2["completed"] = "completed";
10736
+ return AutoAnnotateStatus2;
10737
+ })(AutoAnnotateStatus || {});
10711
10738
  var AssetStatus = /* @__PURE__ */ ((AssetStatus2) => {
10712
10739
  AssetStatus2["rejected"] = "rejected";
10713
10740
  AssetStatus2["upload_in_progress"] = "upload_in_progress";
@@ -10748,6 +10775,8 @@ var TranscodeMode = /* @__PURE__ */ ((TranscodeMode2) => {
10748
10775
  })(TranscodeMode || {});
10749
10776
  var ModelType = /* @__PURE__ */ ((ModelType2) => {
10750
10777
  ModelType2["epdet_b1"] = "epdet_b1";
10778
+ ModelType2["imported"] = "imported";
10779
+ ModelType2["vlm_ability"] = "vlm_ability";
10751
10780
  return ModelType2;
10752
10781
  })(ModelType || {});
10753
10782
  var ModelTask = /* @__PURE__ */ ((ModelTask2) => {
@@ -10846,6 +10875,161 @@ var AssetUrlType = /* @__PURE__ */ ((AssetUrlType3) => {
10846
10875
  AssetUrlType3["https_signed"] = "https_signed";
10847
10876
  return AssetUrlType3;
10848
10877
  })(AssetUrlType || {});
10878
+ var EvaluationStatus = /* @__PURE__ */ ((EvaluationStatus2) => {
10879
+ EvaluationStatus2["success"] = "success";
10880
+ EvaluationStatus2["failed"] = "failed";
10881
+ return EvaluationStatus2;
10882
+ })(EvaluationStatus || {});
10883
+ var VlmAbilityStatus = /* @__PURE__ */ ((VlmAbilityStatus2) => {
10884
+ VlmAbilityStatus2["draft"] = "draft";
10885
+ VlmAbilityStatus2["published"] = "published";
10886
+ return VlmAbilityStatus2;
10887
+ })(VlmAbilityStatus || {});
10888
+
10889
+ // data/jobs.ts
10890
+ var InferAssetJob = class {
10891
+ constructor(assetUrl, inferRequest, vlmFetch, requestLogger) {
10892
+ this._response = null;
10893
+ this._runInfo = null;
10894
+ this._controller = new AbortController();
10895
+ this._vlmFetch = vlmFetch;
10896
+ this._assetUrl = assetUrl;
10897
+ this._inferRequest = inferRequest;
10898
+ this._requestLogger = requestLogger;
10899
+ }
10900
+ [Symbol.asyncIterator]() {
10901
+ if (!this._response) {
10902
+ throw Error("logical bug");
10903
+ }
10904
+ let consumed = false;
10905
+ const response_promise = this._response;
10906
+ const controller = this._controller;
10907
+ async function* iterator() {
10908
+ if (consumed) {
10909
+ throw new Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");
10910
+ }
10911
+ consumed = true;
10912
+ let done = false;
10913
+ try {
10914
+ const predictions = await response_promise;
10915
+ if (predictions) {
10916
+ for (let prediction of predictions) {
10917
+ yield prediction;
10918
+ }
10919
+ }
10920
+ done = true;
10921
+ } catch (e) {
10922
+ if (e instanceof Error && e.name === "AbortError") return;
10923
+ throw e;
10924
+ } finally {
10925
+ if (!done) controller.abort();
10926
+ }
10927
+ }
10928
+ return iterator();
10929
+ }
10930
+ start(done) {
10931
+ this._response = new Promise(async (resolve, reject) => {
10932
+ try {
10933
+ let requestId = null;
10934
+ while (true) {
10935
+ let response = null;
10936
+ if (requestId) {
10937
+ response = await this._vlmFetch(`/api/v1/requests/${requestId}?timeout=20`, {
10938
+ method: "POST"
10939
+ });
10940
+ } else {
10941
+ const infer_request = new Map(Object.entries(this._inferRequest));
10942
+ infer_request.set("url", this._assetUrl);
10943
+ const body = new FormData();
10944
+ body.append("infer_request", JSON.stringify(Object.fromEntries(infer_request)));
10945
+ response = await this._vlmFetch(`/api/v1/infer?timeout=20`, {
10946
+ method: "POST",
10947
+ body
10948
+ });
10949
+ }
10950
+ const predictions = response["predictions"];
10951
+ const runInfo = response["run_info"];
10952
+ if (predictions) {
10953
+ this._runInfo = runInfo;
10954
+ resolve(predictions);
10955
+ break;
10956
+ } else {
10957
+ requestId = response["request_id"];
10958
+ if (!requestId) {
10959
+ reject(`missing request_id in response: ${JSON.stringify(response)}`);
10960
+ break;
10961
+ }
10962
+ }
10963
+ }
10964
+ } catch (reason) {
10965
+ reject(reason);
10966
+ } finally {
10967
+ done();
10968
+ }
10969
+ });
10970
+ return this;
10971
+ }
10972
+ cancel() {
10973
+ this._controller.abort("cancelled");
10974
+ }
10975
+ };
10976
+ var EvaluateDatasetJob = class {
10977
+ constructor(evaluateRequest, workerRelease, vlmFetch, requestLogger) {
10978
+ this._response = null;
10979
+ this._controller = new AbortController();
10980
+ this._vlmFetch = vlmFetch;
10981
+ this._evaluateRequest = evaluateRequest;
10982
+ this._workerRelease = workerRelease;
10983
+ this._requestLogger = requestLogger;
10984
+ }
10985
+ async response() {
10986
+ if (!this._response) {
10987
+ throw Error("logical bug");
10988
+ }
10989
+ return await this._response;
10990
+ }
10991
+ start(done) {
10992
+ this._response = new Promise(async (resolve, reject) => {
10993
+ try {
10994
+ let requestId = null;
10995
+ while (true) {
10996
+ let response = null;
10997
+ if (requestId) {
10998
+ response = await this._vlmFetch(`/api/v1/evaluations/${requestId}?timeout=20`, {
10999
+ method: "GET"
11000
+ });
11001
+ } else {
11002
+ const workerReleaseQuery = this._workerRelease ? `&worker_release=${this._workerRelease}` : "";
11003
+ response = await this._vlmFetch(`/api/v1/evaluations?timeout=20${workerReleaseQuery}`, {
11004
+ method: "POST",
11005
+ body: JSON.stringify(this._evaluateRequest),
11006
+ headers: { "Content-Type": "application/json" }
11007
+ });
11008
+ }
11009
+ const runInfo = response["run_info"];
11010
+ if (runInfo) {
11011
+ resolve(response);
11012
+ break;
11013
+ } else {
11014
+ requestId = response["request_id"];
11015
+ if (!requestId) {
11016
+ reject(`missing request_id in response: ${JSON.stringify(response)}`);
11017
+ break;
11018
+ }
11019
+ }
11020
+ }
11021
+ } catch (reason) {
11022
+ reject(reason);
11023
+ } finally {
11024
+ done();
11025
+ }
11026
+ });
11027
+ return this;
11028
+ }
11029
+ cancel() {
11030
+ this._controller.abort("cancelled");
11031
+ }
11032
+ };
10849
11033
 
10850
11034
  // data/data_endpoint.ts
10851
11035
  var WS_INITIAL_RECONNECT_DELAY = 1e3;
@@ -10853,7 +11037,8 @@ var WS_MAX_RECONNECT_DELAY = 6e4;
10853
11037
  var DataEndpoint = class extends Endpoint {
10854
11038
  constructor(options) {
10855
11039
  super(options);
10856
- this._baseUrl = null;
11040
+ this.datasetApiUrl = null;
11041
+ this.vlmApiUrl = null;
10857
11042
  this._ws = null;
10858
11043
  this._ws_current_reconnect_delay = null;
10859
11044
  this._accountId = options.accountId || null;
@@ -10874,11 +11059,13 @@ var DataEndpoint = class extends Endpoint {
10874
11059
  accessToken: session.accessToken,
10875
11060
  validUntil: session.validUntil,
10876
11061
  accountId: this.options().accountId,
10877
- baseUrl: this._baseUrl
11062
+ datasetApiUrl: this.datasetApiUrl,
11063
+ vlmApiUrl: this.vlmApiUrl
10878
11064
  };
10879
11065
  }
10880
11066
  async disconnect(wait = true) {
10881
- this._baseUrl = null;
11067
+ this.datasetApiUrl = null;
11068
+ this.vlmApiUrl = null;
10882
11069
  if (this._ws) {
10883
11070
  try {
10884
11071
  this._ws.close();
@@ -10893,7 +11080,8 @@ var DataEndpoint = class extends Endpoint {
10893
11080
  if (!this._client) {
10894
11081
  return Promise.reject("endpoint not initialized");
10895
11082
  }
10896
- const config_url = `${this.eyepopUrl()}/data/config?account_uuid=${this._accountId}`;
11083
+ const accountUuidQuery = this._accountId ? `?account_uuid=${this._accountId}` : "";
11084
+ const config_url = `${this.eyepopUrl()}/configs${accountUuidQuery}`;
10897
11085
  let headers = {
10898
11086
  Authorization: await this.authorizationHeader()
10899
11087
  };
@@ -10913,11 +11101,13 @@ var DataEndpoint = class extends Endpoint {
10913
11101
  if (response.status != 200) {
10914
11102
  this.updateState("Error" /* Error */);
10915
11103
  const message = await response.text();
10916
- return Promise.reject(`Unexpected status ${response.status}: ${message}`);
11104
+ return Promise.reject(`Unexpected status ${response.status} for ${config_url}: ${message}`);
10917
11105
  }
10918
11106
  let config = await response.json();
10919
- const baseUrl = new URL(config.base_url, this.eyepopUrl());
10920
- this._baseUrl = baseUrl.toString();
11107
+ const datasetApiUrl = new URL(config.dataset_api_url, this.eyepopUrl());
11108
+ this.datasetApiUrl = datasetApiUrl.toString();
11109
+ const vlmApiUrl = new URL(config.vlm_api_url, this.eyepopUrl());
11110
+ this.vlmApiUrl = vlmApiUrl.toString();
10921
11111
  if (this.options().disableWs) {
10922
11112
  this._logger.info("disabled ws connection");
10923
11113
  } else {
@@ -10925,7 +11115,7 @@ var DataEndpoint = class extends Endpoint {
10925
11115
  }
10926
11116
  if (this.options().useCookie) {
10927
11117
  const client = this._client;
10928
- const url = urlJoin(this._baseUrl, "security", "check?set_cookie=true");
11118
+ const url = urlJoin(this.datasetApiUrl, "security", "check?set_cookie=true");
10929
11119
  const headers2 = {
10930
11120
  Authorization: await this.authorizationHeader()
10931
11121
  };
@@ -10946,7 +11136,7 @@ var DataEndpoint = class extends Endpoint {
10946
11136
  this._ws.close();
10947
11137
  this._ws = null;
10948
11138
  }
10949
- const baseUrl = this._baseUrl?.replace("https://", "wss://").replace("http://", "ws://");
11139
+ const baseUrl = this.datasetApiUrl?.replace("https://", "wss://").replace("http://", "ws://");
10950
11140
  if (!baseUrl) {
10951
11141
  return;
10952
11142
  }
@@ -11004,16 +11194,15 @@ var DataEndpoint = class extends Endpoint {
11004
11194
  options() {
11005
11195
  return this._options;
11006
11196
  }
11007
- async request(path2, options = {}, disableAuth = false) {
11197
+ async request(path2, options = {}, disableAuth = false, dataApiType = "dataset" /* dataset */) {
11008
11198
  const client = this._client;
11009
- const baseUrl = this._baseUrl;
11010
- if (!baseUrl || !client) {
11199
+ if (!client) {
11011
11200
  return Promise.reject("endpoint not connected");
11012
11201
  }
11013
11202
  let response = await this.fetchWithRetry(async () => {
11014
11203
  const session = await this.session();
11204
+ const baseUrl = getBaseUrl(session, dataApiType);
11015
11205
  const headers = {
11016
- "Content-Type": "application/json",
11017
11206
  ...disableAuth ? {} : { Authorization: `Bearer ${session.accessToken}` },
11018
11207
  ...options.headers || {}
11019
11208
  };
@@ -11025,8 +11214,8 @@ var DataEndpoint = class extends Endpoint {
11025
11214
  method: options.method || "GET",
11026
11215
  body: options.body
11027
11216
  };
11028
- this._requestLogger.debug("Request - " + ri.method + path2 + " BODY: " + (ri.body ? ri.body : ""));
11029
- return await client.fetch(urlJoin(session.baseUrl ?? "", path2), ri);
11217
+ this._requestLogger.debug("Request - " + ri.method + " " + path2 + " BODY: " + (ri.body ? ri.body : ""));
11218
+ return await client.fetch(urlJoin(baseUrl ?? "", path2), ri);
11030
11219
  });
11031
11220
  if (response.status === 204) {
11032
11221
  return null;
@@ -11054,7 +11243,8 @@ var DataEndpoint = class extends Endpoint {
11054
11243
  async createDataset(data) {
11055
11244
  return this.request(`/datasets?account_uuid=${this._accountId}`, {
11056
11245
  method: "POST",
11057
- body: JSON.stringify(data)
11246
+ body: JSON.stringify(data),
11247
+ headers: { "Content-Type": "application/json" }
11058
11248
  });
11059
11249
  }
11060
11250
  async getDataset(dataset_uuid, include_stats = true, dataset_version, modifiable_version_only) {
@@ -11067,13 +11257,15 @@ var DataEndpoint = class extends Endpoint {
11067
11257
  async updateDataset(dataset_uuid, data, start_auto_annotate = true) {
11068
11258
  return this.request(`/datasets/${dataset_uuid}?start_auto_annotate=${start_auto_annotate}`, {
11069
11259
  method: "PATCH",
11070
- body: JSON.stringify(data)
11260
+ body: JSON.stringify(data),
11261
+ headers: { "Content-Type": "application/json" }
11071
11262
  });
11072
11263
  }
11073
11264
  async updateDatasetHeroAsset(dataset_uuid, update) {
11074
11265
  return this.request(`/datasets/${dataset_uuid}/hero_asset`, {
11075
11266
  method: "PATCH",
11076
- body: JSON.stringify(update)
11267
+ body: JSON.stringify(update),
11268
+ headers: { "Content-Type": "application/json" }
11077
11269
  });
11078
11270
  }
11079
11271
  async deleteDataset(dataset_uuid) {
@@ -11114,6 +11306,30 @@ var DataEndpoint = class extends Endpoint {
11114
11306
  method: "DELETE"
11115
11307
  });
11116
11308
  }
11309
+ async createDatasetAutoAnnotate(create, dataset_uuid, dataset_version) {
11310
+ const versionQuery = dataset_version ? `dataset_version=${dataset_version}&` : "";
11311
+ return this.request(`/datasets/${dataset_uuid}/auto_annotates?${versionQuery}`, {
11312
+ method: "POST",
11313
+ body: JSON.stringify(create),
11314
+ headers: { "Content-Type": "application/json" }
11315
+ });
11316
+ }
11317
+ async updateDatasetAutoAnnotate(update, dataset_uuid, auto_annotate, source, dataset_version) {
11318
+ const versionQuery = dataset_version ? `dataset_version=${dataset_version}&` : "";
11319
+ return this.request(`/datasets/${dataset_uuid}/auto_annotates?auto_annotate=${auto_annotate}&source=${encodeURIComponent(source)}&${versionQuery}`, {
11320
+ method: "PATCH",
11321
+ body: JSON.stringify(update),
11322
+ headers: { "Content-Type": "application/json" }
11323
+ });
11324
+ }
11325
+ async listDatasetAutoAnnotates(dataset_uuid, auto_annotate, source, dataset_version) {
11326
+ const versionQuery = dataset_version ? `dataset_version=${dataset_version}&` : "";
11327
+ const autoAnnotateQuery = auto_annotate ? `auto_annotate=${auto_annotate}&` : "";
11328
+ const sourceQuery = source ? `source=${source}&` : "";
11329
+ return this.request(`/datasets/${dataset_uuid}/auto_annotates?${versionQuery}&${autoAnnotateQuery}&${sourceQuery}`, {
11330
+ method: "GET"
11331
+ });
11332
+ }
11117
11333
  // Asset methods
11118
11334
  async uploadAsset(dataset_uuid, dataset_version, blob, external_id = void 0) {
11119
11335
  const versionQuery = dataset_version ? `&dataset_version=${dataset_version}` : "";
@@ -11182,7 +11398,8 @@ var DataEndpoint = class extends Endpoint {
11182
11398
  const datasetQuery = dataset_uuid ? `&dataset_uuid=${dataset_uuid}` : "";
11183
11399
  return this.request(`/assets/${asset_uuid}/ground_truth?${datasetQuery}${versionQuery}`, {
11184
11400
  method: "PATCH",
11185
- body: JSON.stringify(predictions)
11401
+ body: JSON.stringify(predictions),
11402
+ headers: { "Content-Type": "application/json" }
11186
11403
  });
11187
11404
  }
11188
11405
  async deleteAssetGroundTruth(asset_uuid, dataset_uuid, dataset_version) {
@@ -11202,23 +11419,45 @@ var DataEndpoint = class extends Endpoint {
11202
11419
  method: "PATCH"
11203
11420
  });
11204
11421
  }
11422
+ async addAssetAnnotation(asset_uuid, dataset_uuid, dataset_version, predictions, auto_annotate, source, user_review, approved_threshold) {
11423
+ const datasetQuery = dataset_uuid ? `dataset_uuid=${dataset_uuid}&` : "";
11424
+ const versionQuery = dataset_version ? `&dataset_version=${dataset_version}&` : "";
11425
+ const autoAnnotateQuery = auto_annotate ? `&auto_annotate=${auto_annotate}&` : "";
11426
+ const sourceQuery = source ? `&source=${encodeURIComponent(source)}&` : "";
11427
+ const userReviewQuery = user_review ? `&user_review=${user_review}&` : "";
11428
+ const approvedThresholdQuery = typeof approved_threshold !== "undefined" ? `&approved_threshold=${approved_threshold}&` : "";
11429
+ return this.request(`/assets/${asset_uuid}/annotations?${datasetQuery}${versionQuery}${autoAnnotateQuery}${sourceQuery}${userReviewQuery}${approvedThresholdQuery}`, {
11430
+ method: "POST",
11431
+ body: JSON.stringify(predictions),
11432
+ headers: { "Content-Type": "application/json" }
11433
+ });
11434
+ }
11435
+ async updateAssetAnnotationApproval(asset_uuid, dataset_uuid, dataset_version, auto_annotate, source, user_review, approved_threshold) {
11436
+ const datasetQuery = dataset_uuid ? `dataset_uuid=${dataset_uuid}&` : "";
11437
+ const versionQuery = dataset_version ? `&dataset_version=${dataset_version}&` : "";
11438
+ const autoAnnotateQuery = auto_annotate ? `&auto_annotate=${auto_annotate}&` : "";
11439
+ const sourceQuery = source ? `&source=${encodeURIComponent(source)}&` : "";
11440
+ const userReviewQuery = user_review ? `&user_review=${user_review}&` : "";
11441
+ const approvedThresholdQuery = approved_threshold ? `&approved_threshold=${approved_threshold}&` : "";
11442
+ return this.request(`/assets/${asset_uuid}/annotations?${datasetQuery}${versionQuery}${autoAnnotateQuery}${sourceQuery}${userReviewQuery}${approvedThresholdQuery}`, {
11443
+ method: "PATCH"
11444
+ });
11445
+ }
11205
11446
  async downloadAsset(asset_uuid, dataset_uuid, dataset_version, transcode_mode = "original" /* original */, start_timestamp, end_timestamp, url_type) {
11206
11447
  const versionQuery = dataset_version ? `&dataset_version=${dataset_version}` : "";
11207
11448
  const datasetQuery = dataset_uuid ? `&dataset_uuid=${dataset_uuid}` : "";
11208
11449
  const startTimestampQuery = start_timestamp ? `&start_timestamp=${start_timestamp}` : "";
11209
11450
  const endTimestampQuery = end_timestamp ? `&end_timestamp=${end_timestamp}` : "";
11210
11451
  const urlTypeQuery = url_type ? `&url_type=${url_type}` : "";
11211
- return this.request(
11212
- `/assets/${asset_uuid}/download?transcode_mode=${transcode_mode}${datasetQuery}${versionQuery}${startTimestampQuery}${endTimestampQuery}${urlTypeQuery}`,
11213
- {
11214
- method: "GET"
11215
- }
11216
- );
11452
+ return this.request(`/assets/${asset_uuid}/download?transcode_mode=${transcode_mode}${datasetQuery}${versionQuery}${startTimestampQuery}${endTimestampQuery}${urlTypeQuery}`, {
11453
+ method: "GET"
11454
+ });
11217
11455
  }
11218
11456
  async previewAutoAnnotateAsset(asset_uuid, auto_annotate, auto_annotate_params) {
11219
11457
  return this.request(`/assets/${asset_uuid}/preview_auto_annotate?auto_annotate=${auto_annotate}`, {
11220
11458
  method: "POST",
11221
- body: auto_annotate_params ? JSON.stringify(auto_annotate_params) : null
11459
+ body: auto_annotate_params ? JSON.stringify(auto_annotate_params) : null,
11460
+ headers: auto_annotate_params ? { "Content-Type": "application/json" } : {}
11222
11461
  });
11223
11462
  }
11224
11463
  // Model methods
@@ -11235,7 +11474,8 @@ var DataEndpoint = class extends Endpoint {
11235
11474
  async createModel(dataset_uuid, dataset_version, data, start_training = true) {
11236
11475
  return this.request(`/models?dataset_uuid=${dataset_uuid}&dataset_version=${dataset_version}&start_training=${start_training}`, {
11237
11476
  method: "POST",
11238
- body: JSON.stringify(data)
11477
+ body: JSON.stringify(data),
11478
+ headers: { "Content-Type": "application/json" }
11239
11479
  });
11240
11480
  }
11241
11481
  async getModel(model_uuid) {
@@ -11251,7 +11491,8 @@ var DataEndpoint = class extends Endpoint {
11251
11491
  async updateModel(model_uuid, data) {
11252
11492
  return this.request(`/models/${model_uuid}`, {
11253
11493
  method: "PATCH",
11254
- body: JSON.stringify(data)
11494
+ body: JSON.stringify(data),
11495
+ headers: { "Content-Type": "application/json" }
11255
11496
  });
11256
11497
  }
11257
11498
  async deleteModel(model_uuid) {
@@ -11275,7 +11516,8 @@ var DataEndpoint = class extends Endpoint {
11275
11516
  }
11276
11517
  await this.request(`/models/${model_uuid}/exports/qc_ai_hub`, {
11277
11518
  method: "POST",
11278
- body: JSON.stringify(params)
11519
+ body: JSON.stringify(params),
11520
+ headers: { "Content-Type": "application/json" }
11279
11521
  });
11280
11522
  }
11281
11523
  async downloadModelArtifacts(model_uuid, model_formats, device_name, artifact_type) {
@@ -11347,7 +11589,8 @@ var DataEndpoint = class extends Endpoint {
11347
11589
  async startWorkflow(account_uuid, template_name, workflow) {
11348
11590
  return this.request(`/workflows?account_uuid=${account_uuid}&template_name=${template_name}`, {
11349
11591
  method: "POST",
11350
- body: JSON.stringify(workflow)
11592
+ body: JSON.stringify(workflow),
11593
+ headers: { "Content-Type": "application/json" }
11351
11594
  });
11352
11595
  }
11353
11596
  async getWorkflow(workflow_id, account_uuid) {
@@ -11364,6 +11607,61 @@ var DataEndpoint = class extends Endpoint {
11364
11607
  method: "GET"
11365
11608
  });
11366
11609
  }
11610
+ async inferAsset(asset_uuid, infer_request, dataset_uuid, dataset_version, transcode_mode, start_timestamp, end_timestamp) {
11611
+ const datasetQuery = dataset_uuid ? `dataset_uuid=${dataset_uuid}&` : "";
11612
+ const versionQuery = dataset_version ? `dataset_version=${dataset_version}&` : "";
11613
+ const transcodeModeQuery = transcode_mode ? `transcode_mode=${transcode_mode}&` : "";
11614
+ const startTimestampQuery = start_timestamp ? `start_timestamp=${start_timestamp}&` : "";
11615
+ const endTimestampQuery = end_timestamp ? `end_timestamp=${end_timestamp}&` : "";
11616
+ const assetUrl = `ai.eyepop://data/assets/${asset_uuid}?${transcodeModeQuery}${datasetQuery}${versionQuery}${startTimestampQuery}${endTimestampQuery}`;
11617
+ if (!this.vlmApiUrl || !this._client || !this._limit) {
11618
+ throw new Error("endpoint not connected, use connect()");
11619
+ }
11620
+ await this._limit.acquire();
11621
+ try {
11622
+ this.updateState();
11623
+ const job = new InferAssetJob(
11624
+ assetUrl,
11625
+ infer_request,
11626
+ async (path2, options) => {
11627
+ return await this.request(path2, options, false, "vlm" /* vlm */);
11628
+ },
11629
+ this._requestLogger
11630
+ );
11631
+ return job.start(() => {
11632
+ this.jobDone(job);
11633
+ });
11634
+ } catch (e) {
11635
+ this._limit.release();
11636
+ throw e;
11637
+ }
11638
+ }
11639
+ async evaluateDataset(evaluate_request, worker_release) {
11640
+ if (!this.vlmApiUrl || !this._client || !this._limit) {
11641
+ throw new Error("endpoint not connected, use connect()");
11642
+ }
11643
+ await this._limit.acquire();
11644
+ try {
11645
+ this.updateState();
11646
+ const job = new EvaluateDatasetJob(
11647
+ evaluate_request,
11648
+ worker_release ?? null,
11649
+ async (path2, options) => {
11650
+ return await this.request(path2, options, false, "vlm" /* vlm */);
11651
+ },
11652
+ this._requestLogger
11653
+ );
11654
+ return job.start(() => {
11655
+ this.jobDone(job);
11656
+ });
11657
+ } catch (e) {
11658
+ this._limit.release();
11659
+ throw e;
11660
+ }
11661
+ }
11662
+ jobDone(job) {
11663
+ this._limit?.release();
11664
+ }
11367
11665
  async dispatchChangeEvent(change_event) {
11368
11666
  switch (change_event.change_type) {
11369
11667
  // account event types
@@ -11401,6 +11699,83 @@ var DataEndpoint = class extends Endpoint {
11401
11699
  break;
11402
11700
  }
11403
11701
  }
11702
+ // Vlm Ability Management
11703
+ async listVlmAbilityGroups() {
11704
+ return this.request(`/vlm_ability_groups?account_uuid=${this._accountId}`, {
11705
+ method: "GET"
11706
+ });
11707
+ }
11708
+ async createVlmAbilityGroup(create) {
11709
+ return this.request(`/vlm_ability_groups?account_uuid=${this._accountId}`, {
11710
+ method: "POST",
11711
+ body: JSON.stringify(create),
11712
+ headers: { "Content-Type": "application/json" }
11713
+ });
11714
+ }
11715
+ async getVlmAbilityGroup(vlm_ability_group_uuid) {
11716
+ return this.request(`/vlm_ability_groups/${vlm_ability_group_uuid}`, {
11717
+ method: "GET"
11718
+ });
11719
+ }
11720
+ async deleteVlmAbilityGroup(vlm_ability_group_uuid) {
11721
+ return this.request(`/vlm_ability_groups/${vlm_ability_group_uuid}`, {
11722
+ method: "DELETE"
11723
+ });
11724
+ }
11725
+ async updateVlmAbilityGroup(vlm_ability_group_uuid, update) {
11726
+ return this.request(`/vlm_ability_groups/${vlm_ability_group_uuid}`, {
11727
+ method: "PATCH",
11728
+ body: JSON.stringify(update),
11729
+ headers: { "Content-Type": "application/json" }
11730
+ });
11731
+ }
11732
+ async listVlmAbilities() {
11733
+ return this.request(`/vlm_abilities?account_uuid=${this._accountId}`, {
11734
+ method: "GET"
11735
+ });
11736
+ }
11737
+ async createVlmAbility(create, vlm_ability_group_uuid) {
11738
+ const groupQuery = vlm_ability_group_uuid ? `&vlm_ability_group_uuid=${vlm_ability_group_uuid}` : "";
11739
+ return this.request(`/vlm_abilities?account_uuid=${this._accountId}${groupQuery}`, {
11740
+ method: "POST",
11741
+ body: JSON.stringify(create),
11742
+ headers: { "Content-Type": "application/json" }
11743
+ });
11744
+ }
11745
+ async getVlmAbility(vlm_ability_uuid) {
11746
+ return this.request(`/vlm_abilities/${vlm_ability_uuid}`, {
11747
+ method: "GET"
11748
+ });
11749
+ }
11750
+ async deleteVlmAbility(vlm_ability_uuid) {
11751
+ return this.request(`/vlm_abilities/${vlm_ability_uuid}`, {
11752
+ method: "DELETE"
11753
+ });
11754
+ }
11755
+ async updateVlmAbility(vlm_ability_uuid, update) {
11756
+ return this.request(`/vlm_abilities/${vlm_ability_uuid}`, {
11757
+ method: "PATCH",
11758
+ body: JSON.stringify(update),
11759
+ headers: { "Content-Type": "application/json" }
11760
+ });
11761
+ }
11762
+ async publishVlmAbility(vlm_ability_uuid, alias_name, tag_name) {
11763
+ const alias_name_query = alias_name ? `alias_name=${encodeURIComponent(alias_name)}&` : "";
11764
+ const tag_name_query = tag_name ? `tag_name=${encodeURIComponent(tag_name)}&` : "";
11765
+ return this.request(`/vlm_abilities/${vlm_ability_uuid}/publish?${alias_name_query}${tag_name_query}`, {
11766
+ method: "POST"
11767
+ });
11768
+ }
11769
+ async addVlmAbilityAlias(vlm_ability_uuid, alias_name, tag_name) {
11770
+ return this.request(`/vlm_abilities/${vlm_ability_uuid}/alias/${encodeURIComponent(alias_name)}/tag/${tag_name ? encodeURIComponent(tag_name) : ""}`, {
11771
+ method: "POST"
11772
+ });
11773
+ }
11774
+ async removeVlmAbilityAlias(vlm_ability_uuid, alias_name, tag_name) {
11775
+ return this.request(`/vlm_abilities/${vlm_ability_uuid}/alias/${encodeURIComponent(alias_name)}/tag/${encodeURIComponent(tag_name)}`, {
11776
+ method: "DELETE"
11777
+ });
11778
+ }
11404
11779
  };
11405
11780
 
11406
11781
  // worker/webrtc_whep.ts
@@ -11607,13 +11982,16 @@ var index_default = EyePop;
11607
11982
  ArtifactType,
11608
11983
  AssetStatus,
11609
11984
  AssetUrlType,
11985
+ AutoAnnotateStatus,
11610
11986
  AutoAnnotateTask,
11611
11987
  ChangeType,
11612
11988
  ContourType,
11613
11989
  DEFAULT_PREDICTION_VERSION,
11990
+ DataApiType,
11614
11991
  DataEndpoint,
11615
11992
  Endpoint,
11616
11993
  EndpointState,
11994
+ EvaluationStatus,
11617
11995
  ExportedBy,
11618
11996
  EyePop,
11619
11997
  EyepopLineDecoder,
@@ -11640,11 +12018,13 @@ var index_default = EyePop;
11640
12018
  UploadJob,
11641
12019
  UserReview,
11642
12020
  VideoMode,
12021
+ VlmAbilityStatus,
11643
12022
  WebrtcBase,
11644
12023
  WebrtcWhep,
11645
12024
  WebrtcWhip,
11646
12025
  WorkerEndpoint,
11647
12026
  WorkflowPhase,
12027
+ getBaseUrl,
11648
12028
  readableStreamFromString
11649
12029
  });
11650
12030
  /*! Bundled license information: