@eyepop.ai/eyepop 3.26.0 → 3.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eyepop.index.d.mts +60 -2
- package/dist/eyepop.index.d.ts +60 -2
- package/dist/eyepop.index.js +114 -12
- package/dist/eyepop.index.js.map +1 -1
- package/dist/eyepop.index.mjs +107 -12
- package/dist/eyepop.index.mjs.map +1 -1
- package/dist/eyepop.min.js +1 -1
- package/package.json +1 -1
package/dist/eyepop.index.mjs
CHANGED
|
@@ -12882,6 +12882,11 @@ var VlmAbilityStatus = /* @__PURE__ */ ((VlmAbilityStatus2) => {
|
|
|
12882
12882
|
VlmAbilityStatus2["published"] = "published";
|
|
12883
12883
|
return VlmAbilityStatus2;
|
|
12884
12884
|
})(VlmAbilityStatus || {});
|
|
12885
|
+
var VLM_MODEL_WORKER_RELEASES = Object.freeze({
|
|
12886
|
+
qwen3: "qwen3_instruct",
|
|
12887
|
+
gpt_6_astra: "gpt-6-astra",
|
|
12888
|
+
gemini_4_argon: "gemini-4-argon"
|
|
12889
|
+
});
|
|
12885
12890
|
|
|
12886
12891
|
// data/jobs.ts
|
|
12887
12892
|
var InferAssetJob = class {
|
|
@@ -13138,6 +13143,87 @@ function validateVlmAbilityMode(ability, partial) {
|
|
|
13138
13143
|
throw new VlmAbilityModeError("missing_mode" /* missing_mode */, `${kind}: set either text_prompt (free-form) or task with non-empty prompts`, ["text_prompt", "task"]);
|
|
13139
13144
|
}
|
|
13140
13145
|
}
|
|
13146
|
+
var VlmAbilityModelErrorReason = /* @__PURE__ */ ((VlmAbilityModelErrorReason2) => {
|
|
13147
|
+
VlmAbilityModelErrorReason2["unknown_model"] = "unknown_model";
|
|
13148
|
+
VlmAbilityModelErrorReason2["unknown_worker_release"] = "unknown_worker_release";
|
|
13149
|
+
VlmAbilityModelErrorReason2["model_conflict"] = "model_conflict";
|
|
13150
|
+
return VlmAbilityModelErrorReason2;
|
|
13151
|
+
})(VlmAbilityModelErrorReason || {});
|
|
13152
|
+
var VlmAbilityModelError = class extends Error {
|
|
13153
|
+
constructor(reason, message, fields = []) {
|
|
13154
|
+
super(message);
|
|
13155
|
+
this.name = "VlmAbilityModelError";
|
|
13156
|
+
this.reason = reason;
|
|
13157
|
+
this.fields = fields;
|
|
13158
|
+
}
|
|
13159
|
+
};
|
|
13160
|
+
var VLM_MODELS = Object.keys(VLM_MODEL_WORKER_RELEASES);
|
|
13161
|
+
var DEFAULT_VLM_MODEL = "qwen3";
|
|
13162
|
+
function isVlmModel(value) {
|
|
13163
|
+
return typeof value === "string" && Object.prototype.hasOwnProperty.call(VLM_MODEL_WORKER_RELEASES, value);
|
|
13164
|
+
}
|
|
13165
|
+
function normalizeWorkerRelease(workerRelease) {
|
|
13166
|
+
return workerRelease.toLowerCase().replace(/_/g, "-");
|
|
13167
|
+
}
|
|
13168
|
+
function modelForWorkerRelease(workerRelease) {
|
|
13169
|
+
if (workerRelease === void 0 || workerRelease === null) {
|
|
13170
|
+
return DEFAULT_VLM_MODEL;
|
|
13171
|
+
}
|
|
13172
|
+
const normalized = normalizeWorkerRelease(workerRelease);
|
|
13173
|
+
return VLM_MODELS.find((model) => normalizeWorkerRelease(VLM_MODEL_WORKER_RELEASES[model]) === normalized) ?? null;
|
|
13174
|
+
}
|
|
13175
|
+
function checkModelAndWorkerRelease(model, workerRelease, prefix) {
|
|
13176
|
+
const modelSet = isSet(model);
|
|
13177
|
+
if (modelSet && !isVlmModel(model)) {
|
|
13178
|
+
throw new VlmAbilityModelError("unknown_model" /* unknown_model */, `${prefix}unknown model '${String(model)}'; set \`model\` to one of ${VLM_MODELS.join(", ")}`, ["model"]);
|
|
13179
|
+
}
|
|
13180
|
+
if (!isSet(workerRelease)) {
|
|
13181
|
+
return modelSet ? model : null;
|
|
13182
|
+
}
|
|
13183
|
+
const releaseModel = typeof workerRelease === "string" ? modelForWorkerRelease(workerRelease) : null;
|
|
13184
|
+
if (releaseModel === null) {
|
|
13185
|
+
throw new VlmAbilityModelError(
|
|
13186
|
+
"unknown_worker_release" /* unknown_worker_release */,
|
|
13187
|
+
`${prefix}unknown worker_release '${String(workerRelease)}'; worker_release is deprecated, set \`model\` to one of ${VLM_MODELS.join(", ")}`,
|
|
13188
|
+
["worker_release"]
|
|
13189
|
+
);
|
|
13190
|
+
}
|
|
13191
|
+
if (modelSet && releaseModel !== model) {
|
|
13192
|
+
throw new VlmAbilityModelError(
|
|
13193
|
+
"model_conflict" /* model_conflict */,
|
|
13194
|
+
`${prefix}worker_release '${String(workerRelease)}' runs model ${releaseModel}, not ${String(model)}; worker_release is deprecated, set only \`model\``,
|
|
13195
|
+
["model", "worker_release"]
|
|
13196
|
+
);
|
|
13197
|
+
}
|
|
13198
|
+
return releaseModel;
|
|
13199
|
+
}
|
|
13200
|
+
function resolveWorkerRelease(model, workerRelease) {
|
|
13201
|
+
return VLM_MODEL_WORKER_RELEASES[checkModelAndWorkerRelease(model, workerRelease, "") ?? DEFAULT_VLM_MODEL];
|
|
13202
|
+
}
|
|
13203
|
+
function withVlmModel(ability) {
|
|
13204
|
+
if (!ability || typeof ability !== "object") {
|
|
13205
|
+
return ability;
|
|
13206
|
+
}
|
|
13207
|
+
if (!("model" in ability)) {
|
|
13208
|
+
return { ...ability, model: modelForWorkerRelease(ability.worker_release) };
|
|
13209
|
+
}
|
|
13210
|
+
if (isSet(ability.model) && !isVlmModel(ability.model)) {
|
|
13211
|
+
return { ...ability, model: null };
|
|
13212
|
+
}
|
|
13213
|
+
return ability;
|
|
13214
|
+
}
|
|
13215
|
+
var warnedWorkerRelease = false;
|
|
13216
|
+
function prepareVlmAbilityModel(ability, partial) {
|
|
13217
|
+
if (isSet(ability.worker_release) && !warnedWorkerRelease) {
|
|
13218
|
+
warnedWorkerRelease = true;
|
|
13219
|
+
console.warn("worker_release is deprecated, set model to a VlmModel instead");
|
|
13220
|
+
}
|
|
13221
|
+
checkModelAndWorkerRelease(ability.model, ability.worker_release, partial ? "VLM ability update: " : "VLM ability: ");
|
|
13222
|
+
if (isSet(ability.model) && !isSet(ability.worker_release)) {
|
|
13223
|
+
return { ...ability, worker_release: VLM_MODEL_WORKER_RELEASES[ability.model] };
|
|
13224
|
+
}
|
|
13225
|
+
return ability;
|
|
13226
|
+
}
|
|
13141
13227
|
var DataEndpoint = class extends Endpoint {
|
|
13142
13228
|
constructor(options) {
|
|
13143
13229
|
super(options);
|
|
@@ -13926,21 +14012,22 @@ var DataEndpoint = class extends Endpoint {
|
|
|
13926
14012
|
async listVlmAbilities() {
|
|
13927
14013
|
return this.request(`/vlm_abilities?account_uuid=${this._accountId}`, {
|
|
13928
14014
|
method: "GET"
|
|
13929
|
-
});
|
|
14015
|
+
}).then((abilities) => Array.isArray(abilities) ? abilities.map(withVlmModel) : abilities);
|
|
13930
14016
|
}
|
|
13931
14017
|
async createVlmAbility(create, vlm_ability_group_uuid) {
|
|
13932
14018
|
validateVlmAbilityMode(create, false);
|
|
14019
|
+
const body = prepareVlmAbilityModel(create, false);
|
|
13933
14020
|
const groupQuery = vlm_ability_group_uuid ? `&vlm_ability_group_uuid=${vlm_ability_group_uuid}` : "";
|
|
13934
14021
|
return this.request(`/vlm_abilities?account_uuid=${this._accountId}${groupQuery}`, {
|
|
13935
14022
|
method: "POST",
|
|
13936
|
-
body: JSON.stringify(
|
|
14023
|
+
body: JSON.stringify(body, omit_nulls),
|
|
13937
14024
|
headers: { "Content-Type": "application/json" }
|
|
13938
|
-
});
|
|
14025
|
+
}).then(withVlmModel);
|
|
13939
14026
|
}
|
|
13940
14027
|
async getVlmAbility(vlm_ability_uuid) {
|
|
13941
14028
|
return this.request(`/vlm_abilities/${vlm_ability_uuid}`, {
|
|
13942
14029
|
method: "GET"
|
|
13943
|
-
});
|
|
14030
|
+
}).then(withVlmModel);
|
|
13944
14031
|
}
|
|
13945
14032
|
async deleteVlmAbility(vlm_ability_uuid) {
|
|
13946
14033
|
return this.request(`/vlm_abilities/${vlm_ability_uuid}`, {
|
|
@@ -13949,11 +14036,12 @@ var DataEndpoint = class extends Endpoint {
|
|
|
13949
14036
|
}
|
|
13950
14037
|
async updateVlmAbility(vlm_ability_uuid, update) {
|
|
13951
14038
|
validateVlmAbilityMode(update, true);
|
|
14039
|
+
const body = prepareVlmAbilityModel(update, true);
|
|
13952
14040
|
return this.request(`/vlm_abilities/${vlm_ability_uuid}`, {
|
|
13953
14041
|
method: "PATCH",
|
|
13954
|
-
body: JSON.stringify(
|
|
14042
|
+
body: JSON.stringify(body),
|
|
13955
14043
|
headers: { "Content-Type": "application/json" }
|
|
13956
|
-
});
|
|
14044
|
+
}).then(withVlmModel);
|
|
13957
14045
|
}
|
|
13958
14046
|
async refineVlmAbility(vlm_ability_uuid, auto_prompt, auto_task) {
|
|
13959
14047
|
if (auto_prompt !== void 0) {
|
|
@@ -13961,13 +14049,13 @@ var DataEndpoint = class extends Endpoint {
|
|
|
13961
14049
|
method: "POST",
|
|
13962
14050
|
body: JSON.stringify(auto_prompt, omit_nulls),
|
|
13963
14051
|
headers: { "Content-Type": "application/json" }
|
|
13964
|
-
});
|
|
14052
|
+
}).then(withVlmModel);
|
|
13965
14053
|
} else if (auto_task !== void 0) {
|
|
13966
14054
|
return this.request(`/vlm_abilities/${vlm_ability_uuid}/refine_task`, {
|
|
13967
14055
|
method: "POST",
|
|
13968
14056
|
body: JSON.stringify(auto_task, omit_nulls),
|
|
13969
14057
|
headers: { "Content-Type": "application/json" }
|
|
13970
|
-
});
|
|
14058
|
+
}).then(withVlmModel);
|
|
13971
14059
|
} else {
|
|
13972
14060
|
return Promise.reject("refine vlm ability requires auto_prompt or auto_config parameter");
|
|
13973
14061
|
}
|
|
@@ -13987,24 +14075,24 @@ var DataEndpoint = class extends Endpoint {
|
|
|
13987
14075
|
}
|
|
13988
14076
|
return this.request(`/vlm_abilities/${vlm_ability_uuid}/clone?${params.toString()}`, {
|
|
13989
14077
|
method: "POST"
|
|
13990
|
-
});
|
|
14078
|
+
}).then(withVlmModel);
|
|
13991
14079
|
}
|
|
13992
14080
|
async publishVlmAbility(vlm_ability_uuid, alias_name, tag_name) {
|
|
13993
14081
|
const alias_name_query = alias_name ? `alias_name=${encodeURIComponent(alias_name)}&` : "";
|
|
13994
14082
|
const tag_name_query = tag_name ? `tag_name=${encodeURIComponent(tag_name)}&` : "";
|
|
13995
14083
|
return this.request(`/vlm_abilities/${vlm_ability_uuid}/publish?${alias_name_query}${tag_name_query}`, {
|
|
13996
14084
|
method: "POST"
|
|
13997
|
-
});
|
|
14085
|
+
}).then(withVlmModel);
|
|
13998
14086
|
}
|
|
13999
14087
|
async addVlmAbilityAlias(vlm_ability_uuid, alias_name, tag_name) {
|
|
14000
14088
|
return this.request(`/vlm_abilities/${vlm_ability_uuid}/alias/${encodeURIComponent(alias_name)}/tag/${tag_name ? encodeURIComponent(tag_name) : ""}`, {
|
|
14001
14089
|
method: "POST"
|
|
14002
|
-
});
|
|
14090
|
+
}).then(withVlmModel);
|
|
14003
14091
|
}
|
|
14004
14092
|
async removeVlmAbilityAlias(vlm_ability_uuid, alias_name, tag_name) {
|
|
14005
14093
|
return this.request(`/vlm_abilities/${vlm_ability_uuid}/alias/${encodeURIComponent(alias_name)}/tag/${encodeURIComponent(tag_name)}`, {
|
|
14006
14094
|
method: "DELETE"
|
|
14007
|
-
});
|
|
14095
|
+
}).then(withVlmModel);
|
|
14008
14096
|
}
|
|
14009
14097
|
async listVlmAbilityEvaluations(vlm_ability_uuid) {
|
|
14010
14098
|
return this.request(`/vlm_abilities/${vlm_ability_uuid}/evaluations`, {
|
|
@@ -14591,6 +14679,7 @@ export {
|
|
|
14591
14679
|
ComputeApiError,
|
|
14592
14680
|
ContourType,
|
|
14593
14681
|
DEFAULT_PREDICTION_VERSION,
|
|
14682
|
+
DEFAULT_VLM_MODEL,
|
|
14594
14683
|
DataApiType,
|
|
14595
14684
|
DataEndpoint,
|
|
14596
14685
|
DepthMap,
|
|
@@ -14640,9 +14729,12 @@ export {
|
|
|
14640
14729
|
UploadGroupJob,
|
|
14641
14730
|
UploadJob,
|
|
14642
14731
|
UserReview,
|
|
14732
|
+
VLM_MODEL_WORKER_RELEASES,
|
|
14643
14733
|
VideoMode,
|
|
14644
14734
|
VlmAbilityModeError,
|
|
14645
14735
|
VlmAbilityModeErrorReason,
|
|
14736
|
+
VlmAbilityModelError,
|
|
14737
|
+
VlmAbilityModelErrorReason,
|
|
14646
14738
|
VlmAbilityStatus,
|
|
14647
14739
|
WebrtcBase,
|
|
14648
14740
|
WebrtcWhep,
|
|
@@ -14660,10 +14752,13 @@ export {
|
|
|
14660
14752
|
encodeMultipartFormData,
|
|
14661
14753
|
getBaseUrl,
|
|
14662
14754
|
isSelectOperator,
|
|
14755
|
+
modelForWorkerRelease,
|
|
14756
|
+
normalizeWorkerRelease,
|
|
14663
14757
|
popSelects,
|
|
14664
14758
|
randomMultipartBoundary,
|
|
14665
14759
|
readableStreamFromString,
|
|
14666
14760
|
resolveAuth,
|
|
14761
|
+
resolveWorkerRelease,
|
|
14667
14762
|
validateCamera,
|
|
14668
14763
|
validatePop
|
|
14669
14764
|
};
|