@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.
@@ -10636,6 +10636,28 @@ function urlJoin() {
10636
10636
  }
10637
10637
 
10638
10638
  // data/data_types.ts
10639
+ var DataApiType = /* @__PURE__ */ ((DataApiType2) => {
10640
+ DataApiType2["dataset"] = "dataset";
10641
+ DataApiType2["vlm"] = "vlm";
10642
+ return DataApiType2;
10643
+ })(DataApiType || {});
10644
+ function getBaseUrl(session, dataApiType) {
10645
+ switch (dataApiType) {
10646
+ case "dataset" /* dataset */:
10647
+ return session.datasetApiUrl ?? "";
10648
+ case "vlm" /* vlm */:
10649
+ return session.vlmApiUrl ?? "";
10650
+ default:
10651
+ throw new Error(`unsupported type ${dataApiType}`);
10652
+ }
10653
+ }
10654
+ var AutoAnnotateStatus = /* @__PURE__ */ ((AutoAnnotateStatus2) => {
10655
+ AutoAnnotateStatus2["error"] = "error";
10656
+ AutoAnnotateStatus2["requested"] = "requested";
10657
+ AutoAnnotateStatus2["in_progress"] = "in_progress";
10658
+ AutoAnnotateStatus2["completed"] = "completed";
10659
+ return AutoAnnotateStatus2;
10660
+ })(AutoAnnotateStatus || {});
10639
10661
  var AssetStatus = /* @__PURE__ */ ((AssetStatus2) => {
10640
10662
  AssetStatus2["rejected"] = "rejected";
10641
10663
  AssetStatus2["upload_in_progress"] = "upload_in_progress";
@@ -10676,6 +10698,8 @@ var TranscodeMode = /* @__PURE__ */ ((TranscodeMode2) => {
10676
10698
  })(TranscodeMode || {});
10677
10699
  var ModelType = /* @__PURE__ */ ((ModelType2) => {
10678
10700
  ModelType2["epdet_b1"] = "epdet_b1";
10701
+ ModelType2["imported"] = "imported";
10702
+ ModelType2["vlm_ability"] = "vlm_ability";
10679
10703
  return ModelType2;
10680
10704
  })(ModelType || {});
10681
10705
  var ModelTask = /* @__PURE__ */ ((ModelTask2) => {
@@ -10774,6 +10798,161 @@ var AssetUrlType = /* @__PURE__ */ ((AssetUrlType3) => {
10774
10798
  AssetUrlType3["https_signed"] = "https_signed";
10775
10799
  return AssetUrlType3;
10776
10800
  })(AssetUrlType || {});
10801
+ var EvaluationStatus = /* @__PURE__ */ ((EvaluationStatus2) => {
10802
+ EvaluationStatus2["success"] = "success";
10803
+ EvaluationStatus2["failed"] = "failed";
10804
+ return EvaluationStatus2;
10805
+ })(EvaluationStatus || {});
10806
+ var VlmAbilityStatus = /* @__PURE__ */ ((VlmAbilityStatus2) => {
10807
+ VlmAbilityStatus2["draft"] = "draft";
10808
+ VlmAbilityStatus2["published"] = "published";
10809
+ return VlmAbilityStatus2;
10810
+ })(VlmAbilityStatus || {});
10811
+
10812
+ // data/jobs.ts
10813
+ var InferAssetJob = class {
10814
+ constructor(assetUrl, inferRequest, vlmFetch, requestLogger) {
10815
+ this._response = null;
10816
+ this._runInfo = null;
10817
+ this._controller = new AbortController();
10818
+ this._vlmFetch = vlmFetch;
10819
+ this._assetUrl = assetUrl;
10820
+ this._inferRequest = inferRequest;
10821
+ this._requestLogger = requestLogger;
10822
+ }
10823
+ [Symbol.asyncIterator]() {
10824
+ if (!this._response) {
10825
+ throw Error("logical bug");
10826
+ }
10827
+ let consumed = false;
10828
+ const response_promise = this._response;
10829
+ const controller = this._controller;
10830
+ async function* iterator() {
10831
+ if (consumed) {
10832
+ throw new Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");
10833
+ }
10834
+ consumed = true;
10835
+ let done = false;
10836
+ try {
10837
+ const predictions = await response_promise;
10838
+ if (predictions) {
10839
+ for (let prediction of predictions) {
10840
+ yield prediction;
10841
+ }
10842
+ }
10843
+ done = true;
10844
+ } catch (e) {
10845
+ if (e instanceof Error && e.name === "AbortError") return;
10846
+ throw e;
10847
+ } finally {
10848
+ if (!done) controller.abort();
10849
+ }
10850
+ }
10851
+ return iterator();
10852
+ }
10853
+ start(done) {
10854
+ this._response = new Promise(async (resolve, reject) => {
10855
+ try {
10856
+ let requestId = null;
10857
+ while (true) {
10858
+ let response = null;
10859
+ if (requestId) {
10860
+ response = await this._vlmFetch(`/api/v1/requests/${requestId}?timeout=20`, {
10861
+ method: "POST"
10862
+ });
10863
+ } else {
10864
+ const infer_request = new Map(Object.entries(this._inferRequest));
10865
+ infer_request.set("url", this._assetUrl);
10866
+ const body = new FormData();
10867
+ body.append("infer_request", JSON.stringify(Object.fromEntries(infer_request)));
10868
+ response = await this._vlmFetch(`/api/v1/infer?timeout=20`, {
10869
+ method: "POST",
10870
+ body
10871
+ });
10872
+ }
10873
+ const predictions = response["predictions"];
10874
+ const runInfo = response["run_info"];
10875
+ if (predictions) {
10876
+ this._runInfo = runInfo;
10877
+ resolve(predictions);
10878
+ break;
10879
+ } else {
10880
+ requestId = response["request_id"];
10881
+ if (!requestId) {
10882
+ reject(`missing request_id in response: ${JSON.stringify(response)}`);
10883
+ break;
10884
+ }
10885
+ }
10886
+ }
10887
+ } catch (reason) {
10888
+ reject(reason);
10889
+ } finally {
10890
+ done();
10891
+ }
10892
+ });
10893
+ return this;
10894
+ }
10895
+ cancel() {
10896
+ this._controller.abort("cancelled");
10897
+ }
10898
+ };
10899
+ var EvaluateDatasetJob = class {
10900
+ constructor(evaluateRequest, workerRelease, vlmFetch, requestLogger) {
10901
+ this._response = null;
10902
+ this._controller = new AbortController();
10903
+ this._vlmFetch = vlmFetch;
10904
+ this._evaluateRequest = evaluateRequest;
10905
+ this._workerRelease = workerRelease;
10906
+ this._requestLogger = requestLogger;
10907
+ }
10908
+ async response() {
10909
+ if (!this._response) {
10910
+ throw Error("logical bug");
10911
+ }
10912
+ return await this._response;
10913
+ }
10914
+ start(done) {
10915
+ this._response = new Promise(async (resolve, reject) => {
10916
+ try {
10917
+ let requestId = null;
10918
+ while (true) {
10919
+ let response = null;
10920
+ if (requestId) {
10921
+ response = await this._vlmFetch(`/api/v1/evaluations/${requestId}?timeout=20`, {
10922
+ method: "GET"
10923
+ });
10924
+ } else {
10925
+ const workerReleaseQuery = this._workerRelease ? `&worker_release=${this._workerRelease}` : "";
10926
+ response = await this._vlmFetch(`/api/v1/evaluations?timeout=20${workerReleaseQuery}`, {
10927
+ method: "POST",
10928
+ body: JSON.stringify(this._evaluateRequest),
10929
+ headers: { "Content-Type": "application/json" }
10930
+ });
10931
+ }
10932
+ const runInfo = response["run_info"];
10933
+ if (runInfo) {
10934
+ resolve(response);
10935
+ break;
10936
+ } else {
10937
+ requestId = response["request_id"];
10938
+ if (!requestId) {
10939
+ reject(`missing request_id in response: ${JSON.stringify(response)}`);
10940
+ break;
10941
+ }
10942
+ }
10943
+ }
10944
+ } catch (reason) {
10945
+ reject(reason);
10946
+ } finally {
10947
+ done();
10948
+ }
10949
+ });
10950
+ return this;
10951
+ }
10952
+ cancel() {
10953
+ this._controller.abort("cancelled");
10954
+ }
10955
+ };
10777
10956
 
10778
10957
  // data/data_endpoint.ts
10779
10958
  var WS_INITIAL_RECONNECT_DELAY = 1e3;
@@ -10781,7 +10960,8 @@ var WS_MAX_RECONNECT_DELAY = 6e4;
10781
10960
  var DataEndpoint = class extends Endpoint {
10782
10961
  constructor(options) {
10783
10962
  super(options);
10784
- this._baseUrl = null;
10963
+ this.datasetApiUrl = null;
10964
+ this.vlmApiUrl = null;
10785
10965
  this._ws = null;
10786
10966
  this._ws_current_reconnect_delay = null;
10787
10967
  this._accountId = options.accountId || null;
@@ -10802,11 +10982,13 @@ var DataEndpoint = class extends Endpoint {
10802
10982
  accessToken: session.accessToken,
10803
10983
  validUntil: session.validUntil,
10804
10984
  accountId: this.options().accountId,
10805
- baseUrl: this._baseUrl
10985
+ datasetApiUrl: this.datasetApiUrl,
10986
+ vlmApiUrl: this.vlmApiUrl
10806
10987
  };
10807
10988
  }
10808
10989
  async disconnect(wait = true) {
10809
- this._baseUrl = null;
10990
+ this.datasetApiUrl = null;
10991
+ this.vlmApiUrl = null;
10810
10992
  if (this._ws) {
10811
10993
  try {
10812
10994
  this._ws.close();
@@ -10821,7 +11003,8 @@ var DataEndpoint = class extends Endpoint {
10821
11003
  if (!this._client) {
10822
11004
  return Promise.reject("endpoint not initialized");
10823
11005
  }
10824
- const config_url = `${this.eyepopUrl()}/data/config?account_uuid=${this._accountId}`;
11006
+ const accountUuidQuery = this._accountId ? `?account_uuid=${this._accountId}` : "";
11007
+ const config_url = `${this.eyepopUrl()}/configs${accountUuidQuery}`;
10825
11008
  let headers = {
10826
11009
  Authorization: await this.authorizationHeader()
10827
11010
  };
@@ -10841,11 +11024,13 @@ var DataEndpoint = class extends Endpoint {
10841
11024
  if (response.status != 200) {
10842
11025
  this.updateState("Error" /* Error */);
10843
11026
  const message = await response.text();
10844
- return Promise.reject(`Unexpected status ${response.status}: ${message}`);
11027
+ return Promise.reject(`Unexpected status ${response.status} for ${config_url}: ${message}`);
10845
11028
  }
10846
11029
  let config = await response.json();
10847
- const baseUrl = new URL(config.base_url, this.eyepopUrl());
10848
- this._baseUrl = baseUrl.toString();
11030
+ const datasetApiUrl = new URL(config.dataset_api_url, this.eyepopUrl());
11031
+ this.datasetApiUrl = datasetApiUrl.toString();
11032
+ const vlmApiUrl = new URL(config.vlm_api_url, this.eyepopUrl());
11033
+ this.vlmApiUrl = vlmApiUrl.toString();
10849
11034
  if (this.options().disableWs) {
10850
11035
  this._logger.info("disabled ws connection");
10851
11036
  } else {
@@ -10853,7 +11038,7 @@ var DataEndpoint = class extends Endpoint {
10853
11038
  }
10854
11039
  if (this.options().useCookie) {
10855
11040
  const client = this._client;
10856
- const url = urlJoin(this._baseUrl, "security", "check?set_cookie=true");
11041
+ const url = urlJoin(this.datasetApiUrl, "security", "check?set_cookie=true");
10857
11042
  const headers2 = {
10858
11043
  Authorization: await this.authorizationHeader()
10859
11044
  };
@@ -10874,7 +11059,7 @@ var DataEndpoint = class extends Endpoint {
10874
11059
  this._ws.close();
10875
11060
  this._ws = null;
10876
11061
  }
10877
- const baseUrl = this._baseUrl?.replace("https://", "wss://").replace("http://", "ws://");
11062
+ const baseUrl = this.datasetApiUrl?.replace("https://", "wss://").replace("http://", "ws://");
10878
11063
  if (!baseUrl) {
10879
11064
  return;
10880
11065
  }
@@ -10932,16 +11117,15 @@ var DataEndpoint = class extends Endpoint {
10932
11117
  options() {
10933
11118
  return this._options;
10934
11119
  }
10935
- async request(path2, options = {}, disableAuth = false) {
11120
+ async request(path2, options = {}, disableAuth = false, dataApiType = "dataset" /* dataset */) {
10936
11121
  const client = this._client;
10937
- const baseUrl = this._baseUrl;
10938
- if (!baseUrl || !client) {
11122
+ if (!client) {
10939
11123
  return Promise.reject("endpoint not connected");
10940
11124
  }
10941
11125
  let response = await this.fetchWithRetry(async () => {
10942
11126
  const session = await this.session();
11127
+ const baseUrl = getBaseUrl(session, dataApiType);
10943
11128
  const headers = {
10944
- "Content-Type": "application/json",
10945
11129
  ...disableAuth ? {} : { Authorization: `Bearer ${session.accessToken}` },
10946
11130
  ...options.headers || {}
10947
11131
  };
@@ -10953,8 +11137,8 @@ var DataEndpoint = class extends Endpoint {
10953
11137
  method: options.method || "GET",
10954
11138
  body: options.body
10955
11139
  };
10956
- this._requestLogger.debug("Request - " + ri.method + path2 + " BODY: " + (ri.body ? ri.body : ""));
10957
- return await client.fetch(urlJoin(session.baseUrl ?? "", path2), ri);
11140
+ this._requestLogger.debug("Request - " + ri.method + " " + path2 + " BODY: " + (ri.body ? ri.body : ""));
11141
+ return await client.fetch(urlJoin(baseUrl ?? "", path2), ri);
10958
11142
  });
10959
11143
  if (response.status === 204) {
10960
11144
  return null;
@@ -10982,7 +11166,8 @@ var DataEndpoint = class extends Endpoint {
10982
11166
  async createDataset(data) {
10983
11167
  return this.request(`/datasets?account_uuid=${this._accountId}`, {
10984
11168
  method: "POST",
10985
- body: JSON.stringify(data)
11169
+ body: JSON.stringify(data),
11170
+ headers: { "Content-Type": "application/json" }
10986
11171
  });
10987
11172
  }
10988
11173
  async getDataset(dataset_uuid, include_stats = true, dataset_version, modifiable_version_only) {
@@ -10995,13 +11180,15 @@ var DataEndpoint = class extends Endpoint {
10995
11180
  async updateDataset(dataset_uuid, data, start_auto_annotate = true) {
10996
11181
  return this.request(`/datasets/${dataset_uuid}?start_auto_annotate=${start_auto_annotate}`, {
10997
11182
  method: "PATCH",
10998
- body: JSON.stringify(data)
11183
+ body: JSON.stringify(data),
11184
+ headers: { "Content-Type": "application/json" }
10999
11185
  });
11000
11186
  }
11001
11187
  async updateDatasetHeroAsset(dataset_uuid, update) {
11002
11188
  return this.request(`/datasets/${dataset_uuid}/hero_asset`, {
11003
11189
  method: "PATCH",
11004
- body: JSON.stringify(update)
11190
+ body: JSON.stringify(update),
11191
+ headers: { "Content-Type": "application/json" }
11005
11192
  });
11006
11193
  }
11007
11194
  async deleteDataset(dataset_uuid) {
@@ -11042,6 +11229,30 @@ var DataEndpoint = class extends Endpoint {
11042
11229
  method: "DELETE"
11043
11230
  });
11044
11231
  }
11232
+ async createDatasetAutoAnnotate(create, dataset_uuid, dataset_version) {
11233
+ const versionQuery = dataset_version ? `dataset_version=${dataset_version}&` : "";
11234
+ return this.request(`/datasets/${dataset_uuid}/auto_annotates?${versionQuery}`, {
11235
+ method: "POST",
11236
+ body: JSON.stringify(create),
11237
+ headers: { "Content-Type": "application/json" }
11238
+ });
11239
+ }
11240
+ async updateDatasetAutoAnnotate(update, dataset_uuid, auto_annotate, source, dataset_version) {
11241
+ const versionQuery = dataset_version ? `dataset_version=${dataset_version}&` : "";
11242
+ return this.request(`/datasets/${dataset_uuid}/auto_annotates?auto_annotate=${auto_annotate}&source=${encodeURIComponent(source)}&${versionQuery}`, {
11243
+ method: "PATCH",
11244
+ body: JSON.stringify(update),
11245
+ headers: { "Content-Type": "application/json" }
11246
+ });
11247
+ }
11248
+ async listDatasetAutoAnnotates(dataset_uuid, auto_annotate, source, dataset_version) {
11249
+ const versionQuery = dataset_version ? `dataset_version=${dataset_version}&` : "";
11250
+ const autoAnnotateQuery = auto_annotate ? `auto_annotate=${auto_annotate}&` : "";
11251
+ const sourceQuery = source ? `source=${source}&` : "";
11252
+ return this.request(`/datasets/${dataset_uuid}/auto_annotates?${versionQuery}&${autoAnnotateQuery}&${sourceQuery}`, {
11253
+ method: "GET"
11254
+ });
11255
+ }
11045
11256
  // Asset methods
11046
11257
  async uploadAsset(dataset_uuid, dataset_version, blob, external_id = void 0) {
11047
11258
  const versionQuery = dataset_version ? `&dataset_version=${dataset_version}` : "";
@@ -11110,7 +11321,8 @@ var DataEndpoint = class extends Endpoint {
11110
11321
  const datasetQuery = dataset_uuid ? `&dataset_uuid=${dataset_uuid}` : "";
11111
11322
  return this.request(`/assets/${asset_uuid}/ground_truth?${datasetQuery}${versionQuery}`, {
11112
11323
  method: "PATCH",
11113
- body: JSON.stringify(predictions)
11324
+ body: JSON.stringify(predictions),
11325
+ headers: { "Content-Type": "application/json" }
11114
11326
  });
11115
11327
  }
11116
11328
  async deleteAssetGroundTruth(asset_uuid, dataset_uuid, dataset_version) {
@@ -11130,23 +11342,45 @@ var DataEndpoint = class extends Endpoint {
11130
11342
  method: "PATCH"
11131
11343
  });
11132
11344
  }
11345
+ async addAssetAnnotation(asset_uuid, dataset_uuid, dataset_version, predictions, auto_annotate, source, user_review, approved_threshold) {
11346
+ const datasetQuery = dataset_uuid ? `dataset_uuid=${dataset_uuid}&` : "";
11347
+ const versionQuery = dataset_version ? `&dataset_version=${dataset_version}&` : "";
11348
+ const autoAnnotateQuery = auto_annotate ? `&auto_annotate=${auto_annotate}&` : "";
11349
+ const sourceQuery = source ? `&source=${encodeURIComponent(source)}&` : "";
11350
+ const userReviewQuery = user_review ? `&user_review=${user_review}&` : "";
11351
+ const approvedThresholdQuery = typeof approved_threshold !== "undefined" ? `&approved_threshold=${approved_threshold}&` : "";
11352
+ return this.request(`/assets/${asset_uuid}/annotations?${datasetQuery}${versionQuery}${autoAnnotateQuery}${sourceQuery}${userReviewQuery}${approvedThresholdQuery}`, {
11353
+ method: "POST",
11354
+ body: JSON.stringify(predictions),
11355
+ headers: { "Content-Type": "application/json" }
11356
+ });
11357
+ }
11358
+ async updateAssetAnnotationApproval(asset_uuid, dataset_uuid, dataset_version, auto_annotate, source, user_review, approved_threshold) {
11359
+ const datasetQuery = dataset_uuid ? `dataset_uuid=${dataset_uuid}&` : "";
11360
+ const versionQuery = dataset_version ? `&dataset_version=${dataset_version}&` : "";
11361
+ const autoAnnotateQuery = auto_annotate ? `&auto_annotate=${auto_annotate}&` : "";
11362
+ const sourceQuery = source ? `&source=${encodeURIComponent(source)}&` : "";
11363
+ const userReviewQuery = user_review ? `&user_review=${user_review}&` : "";
11364
+ const approvedThresholdQuery = approved_threshold ? `&approved_threshold=${approved_threshold}&` : "";
11365
+ return this.request(`/assets/${asset_uuid}/annotations?${datasetQuery}${versionQuery}${autoAnnotateQuery}${sourceQuery}${userReviewQuery}${approvedThresholdQuery}`, {
11366
+ method: "PATCH"
11367
+ });
11368
+ }
11133
11369
  async downloadAsset(asset_uuid, dataset_uuid, dataset_version, transcode_mode = "original" /* original */, start_timestamp, end_timestamp, url_type) {
11134
11370
  const versionQuery = dataset_version ? `&dataset_version=${dataset_version}` : "";
11135
11371
  const datasetQuery = dataset_uuid ? `&dataset_uuid=${dataset_uuid}` : "";
11136
11372
  const startTimestampQuery = start_timestamp ? `&start_timestamp=${start_timestamp}` : "";
11137
11373
  const endTimestampQuery = end_timestamp ? `&end_timestamp=${end_timestamp}` : "";
11138
11374
  const urlTypeQuery = url_type ? `&url_type=${url_type}` : "";
11139
- return this.request(
11140
- `/assets/${asset_uuid}/download?transcode_mode=${transcode_mode}${datasetQuery}${versionQuery}${startTimestampQuery}${endTimestampQuery}${urlTypeQuery}`,
11141
- {
11142
- method: "GET"
11143
- }
11144
- );
11375
+ return this.request(`/assets/${asset_uuid}/download?transcode_mode=${transcode_mode}${datasetQuery}${versionQuery}${startTimestampQuery}${endTimestampQuery}${urlTypeQuery}`, {
11376
+ method: "GET"
11377
+ });
11145
11378
  }
11146
11379
  async previewAutoAnnotateAsset(asset_uuid, auto_annotate, auto_annotate_params) {
11147
11380
  return this.request(`/assets/${asset_uuid}/preview_auto_annotate?auto_annotate=${auto_annotate}`, {
11148
11381
  method: "POST",
11149
- body: auto_annotate_params ? JSON.stringify(auto_annotate_params) : null
11382
+ body: auto_annotate_params ? JSON.stringify(auto_annotate_params) : null,
11383
+ headers: auto_annotate_params ? { "Content-Type": "application/json" } : {}
11150
11384
  });
11151
11385
  }
11152
11386
  // Model methods
@@ -11163,7 +11397,8 @@ var DataEndpoint = class extends Endpoint {
11163
11397
  async createModel(dataset_uuid, dataset_version, data, start_training = true) {
11164
11398
  return this.request(`/models?dataset_uuid=${dataset_uuid}&dataset_version=${dataset_version}&start_training=${start_training}`, {
11165
11399
  method: "POST",
11166
- body: JSON.stringify(data)
11400
+ body: JSON.stringify(data),
11401
+ headers: { "Content-Type": "application/json" }
11167
11402
  });
11168
11403
  }
11169
11404
  async getModel(model_uuid) {
@@ -11179,7 +11414,8 @@ var DataEndpoint = class extends Endpoint {
11179
11414
  async updateModel(model_uuid, data) {
11180
11415
  return this.request(`/models/${model_uuid}`, {
11181
11416
  method: "PATCH",
11182
- body: JSON.stringify(data)
11417
+ body: JSON.stringify(data),
11418
+ headers: { "Content-Type": "application/json" }
11183
11419
  });
11184
11420
  }
11185
11421
  async deleteModel(model_uuid) {
@@ -11203,7 +11439,8 @@ var DataEndpoint = class extends Endpoint {
11203
11439
  }
11204
11440
  await this.request(`/models/${model_uuid}/exports/qc_ai_hub`, {
11205
11441
  method: "POST",
11206
- body: JSON.stringify(params)
11442
+ body: JSON.stringify(params),
11443
+ headers: { "Content-Type": "application/json" }
11207
11444
  });
11208
11445
  }
11209
11446
  async downloadModelArtifacts(model_uuid, model_formats, device_name, artifact_type) {
@@ -11275,7 +11512,8 @@ var DataEndpoint = class extends Endpoint {
11275
11512
  async startWorkflow(account_uuid, template_name, workflow) {
11276
11513
  return this.request(`/workflows?account_uuid=${account_uuid}&template_name=${template_name}`, {
11277
11514
  method: "POST",
11278
- body: JSON.stringify(workflow)
11515
+ body: JSON.stringify(workflow),
11516
+ headers: { "Content-Type": "application/json" }
11279
11517
  });
11280
11518
  }
11281
11519
  async getWorkflow(workflow_id, account_uuid) {
@@ -11292,6 +11530,61 @@ var DataEndpoint = class extends Endpoint {
11292
11530
  method: "GET"
11293
11531
  });
11294
11532
  }
11533
+ async inferAsset(asset_uuid, infer_request, dataset_uuid, dataset_version, transcode_mode, start_timestamp, end_timestamp) {
11534
+ const datasetQuery = dataset_uuid ? `dataset_uuid=${dataset_uuid}&` : "";
11535
+ const versionQuery = dataset_version ? `dataset_version=${dataset_version}&` : "";
11536
+ const transcodeModeQuery = transcode_mode ? `transcode_mode=${transcode_mode}&` : "";
11537
+ const startTimestampQuery = start_timestamp ? `start_timestamp=${start_timestamp}&` : "";
11538
+ const endTimestampQuery = end_timestamp ? `end_timestamp=${end_timestamp}&` : "";
11539
+ const assetUrl = `ai.eyepop://data/assets/${asset_uuid}?${transcodeModeQuery}${datasetQuery}${versionQuery}${startTimestampQuery}${endTimestampQuery}`;
11540
+ if (!this.vlmApiUrl || !this._client || !this._limit) {
11541
+ throw new Error("endpoint not connected, use connect()");
11542
+ }
11543
+ await this._limit.acquire();
11544
+ try {
11545
+ this.updateState();
11546
+ const job = new InferAssetJob(
11547
+ assetUrl,
11548
+ infer_request,
11549
+ async (path2, options) => {
11550
+ return await this.request(path2, options, false, "vlm" /* vlm */);
11551
+ },
11552
+ this._requestLogger
11553
+ );
11554
+ return job.start(() => {
11555
+ this.jobDone(job);
11556
+ });
11557
+ } catch (e) {
11558
+ this._limit.release();
11559
+ throw e;
11560
+ }
11561
+ }
11562
+ async evaluateDataset(evaluate_request, worker_release) {
11563
+ if (!this.vlmApiUrl || !this._client || !this._limit) {
11564
+ throw new Error("endpoint not connected, use connect()");
11565
+ }
11566
+ await this._limit.acquire();
11567
+ try {
11568
+ this.updateState();
11569
+ const job = new EvaluateDatasetJob(
11570
+ evaluate_request,
11571
+ worker_release ?? null,
11572
+ async (path2, options) => {
11573
+ return await this.request(path2, options, false, "vlm" /* vlm */);
11574
+ },
11575
+ this._requestLogger
11576
+ );
11577
+ return job.start(() => {
11578
+ this.jobDone(job);
11579
+ });
11580
+ } catch (e) {
11581
+ this._limit.release();
11582
+ throw e;
11583
+ }
11584
+ }
11585
+ jobDone(job) {
11586
+ this._limit?.release();
11587
+ }
11295
11588
  async dispatchChangeEvent(change_event) {
11296
11589
  switch (change_event.change_type) {
11297
11590
  // account event types
@@ -11329,6 +11622,83 @@ var DataEndpoint = class extends Endpoint {
11329
11622
  break;
11330
11623
  }
11331
11624
  }
11625
+ // Vlm Ability Management
11626
+ async listVlmAbilityGroups() {
11627
+ return this.request(`/vlm_ability_groups?account_uuid=${this._accountId}`, {
11628
+ method: "GET"
11629
+ });
11630
+ }
11631
+ async createVlmAbilityGroup(create) {
11632
+ return this.request(`/vlm_ability_groups?account_uuid=${this._accountId}`, {
11633
+ method: "POST",
11634
+ body: JSON.stringify(create),
11635
+ headers: { "Content-Type": "application/json" }
11636
+ });
11637
+ }
11638
+ async getVlmAbilityGroup(vlm_ability_group_uuid) {
11639
+ return this.request(`/vlm_ability_groups/${vlm_ability_group_uuid}`, {
11640
+ method: "GET"
11641
+ });
11642
+ }
11643
+ async deleteVlmAbilityGroup(vlm_ability_group_uuid) {
11644
+ return this.request(`/vlm_ability_groups/${vlm_ability_group_uuid}`, {
11645
+ method: "DELETE"
11646
+ });
11647
+ }
11648
+ async updateVlmAbilityGroup(vlm_ability_group_uuid, update) {
11649
+ return this.request(`/vlm_ability_groups/${vlm_ability_group_uuid}`, {
11650
+ method: "PATCH",
11651
+ body: JSON.stringify(update),
11652
+ headers: { "Content-Type": "application/json" }
11653
+ });
11654
+ }
11655
+ async listVlmAbilities() {
11656
+ return this.request(`/vlm_abilities?account_uuid=${this._accountId}`, {
11657
+ method: "GET"
11658
+ });
11659
+ }
11660
+ async createVlmAbility(create, vlm_ability_group_uuid) {
11661
+ const groupQuery = vlm_ability_group_uuid ? `&vlm_ability_group_uuid=${vlm_ability_group_uuid}` : "";
11662
+ return this.request(`/vlm_abilities?account_uuid=${this._accountId}${groupQuery}`, {
11663
+ method: "POST",
11664
+ body: JSON.stringify(create),
11665
+ headers: { "Content-Type": "application/json" }
11666
+ });
11667
+ }
11668
+ async getVlmAbility(vlm_ability_uuid) {
11669
+ return this.request(`/vlm_abilities/${vlm_ability_uuid}`, {
11670
+ method: "GET"
11671
+ });
11672
+ }
11673
+ async deleteVlmAbility(vlm_ability_uuid) {
11674
+ return this.request(`/vlm_abilities/${vlm_ability_uuid}`, {
11675
+ method: "DELETE"
11676
+ });
11677
+ }
11678
+ async updateVlmAbility(vlm_ability_uuid, update) {
11679
+ return this.request(`/vlm_abilities/${vlm_ability_uuid}`, {
11680
+ method: "PATCH",
11681
+ body: JSON.stringify(update),
11682
+ headers: { "Content-Type": "application/json" }
11683
+ });
11684
+ }
11685
+ async publishVlmAbility(vlm_ability_uuid, alias_name, tag_name) {
11686
+ const alias_name_query = alias_name ? `alias_name=${encodeURIComponent(alias_name)}&` : "";
11687
+ const tag_name_query = tag_name ? `tag_name=${encodeURIComponent(tag_name)}&` : "";
11688
+ return this.request(`/vlm_abilities/${vlm_ability_uuid}/publish?${alias_name_query}${tag_name_query}`, {
11689
+ method: "POST"
11690
+ });
11691
+ }
11692
+ async addVlmAbilityAlias(vlm_ability_uuid, alias_name, tag_name) {
11693
+ return this.request(`/vlm_abilities/${vlm_ability_uuid}/alias/${encodeURIComponent(alias_name)}/tag/${tag_name ? encodeURIComponent(tag_name) : ""}`, {
11694
+ method: "POST"
11695
+ });
11696
+ }
11697
+ async removeVlmAbilityAlias(vlm_ability_uuid, alias_name, tag_name) {
11698
+ return this.request(`/vlm_abilities/${vlm_ability_uuid}/alias/${encodeURIComponent(alias_name)}/tag/${encodeURIComponent(tag_name)}`, {
11699
+ method: "DELETE"
11700
+ });
11701
+ }
11332
11702
  };
11333
11703
 
11334
11704
  // worker/webrtc_whep.ts
@@ -11534,13 +11904,16 @@ export {
11534
11904
  ArtifactType,
11535
11905
  AssetStatus,
11536
11906
  AssetUrlType,
11907
+ AutoAnnotateStatus,
11537
11908
  AutoAnnotateTask,
11538
11909
  ChangeType,
11539
11910
  ContourType,
11540
11911
  DEFAULT_PREDICTION_VERSION,
11912
+ DataApiType,
11541
11913
  DataEndpoint,
11542
11914
  Endpoint,
11543
11915
  EndpointState,
11916
+ EvaluationStatus,
11544
11917
  ExportedBy,
11545
11918
  EyePop,
11546
11919
  EyepopLineDecoder,
@@ -11567,12 +11940,14 @@ export {
11567
11940
  UploadJob,
11568
11941
  UserReview,
11569
11942
  VideoMode,
11943
+ VlmAbilityStatus,
11570
11944
  WebrtcBase,
11571
11945
  WebrtcWhep,
11572
11946
  WebrtcWhip,
11573
11947
  WorkerEndpoint,
11574
11948
  WorkflowPhase,
11575
11949
  index_default as default,
11950
+ getBaseUrl,
11576
11951
  readableStreamFromString
11577
11952
  };
11578
11953
  /*! Bundled license information: