@eyepop.ai/eyepop 1.18.0 → 2.0.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 +18 -59
- package/dist/eyepop.index.d.ts +18 -59
- package/dist/eyepop.index.js +20 -300
- package/dist/eyepop.index.js.map +1 -1
- package/dist/eyepop.index.mjs +20 -300
- package/dist/eyepop.index.mjs.map +1 -1
- package/dist/eyepop.min.js +1 -1
- package/package.json +1 -1
package/dist/eyepop.index.d.mts
CHANGED
|
@@ -96,7 +96,6 @@ interface WorkerSession extends Session {
|
|
|
96
96
|
readonly popId: string;
|
|
97
97
|
readonly baseUrl: string | undefined;
|
|
98
98
|
readonly pipelineId: string | undefined;
|
|
99
|
-
readonly sandboxId: string | undefined;
|
|
100
99
|
authenticationHeaders(): any;
|
|
101
100
|
}
|
|
102
101
|
declare enum VideoMode {
|
|
@@ -131,36 +130,6 @@ type Source = FileSource | StreamSource | PathSource | UrlSource | AssetUuidSour
|
|
|
131
130
|
interface ResultStream extends AsyncIterable<Prediction> {
|
|
132
131
|
cancel(): void;
|
|
133
132
|
}
|
|
134
|
-
type SourcesEntry = {
|
|
135
|
-
readonly authority: string;
|
|
136
|
-
readonly manifest: string;
|
|
137
|
-
};
|
|
138
|
-
declare enum ModelFormat {
|
|
139
|
-
TensorFlowLite = "TensorFlowLite",
|
|
140
|
-
TensorFlowGraphDef = "TensorFlowGraphDef",
|
|
141
|
-
ONNX = "ONNX",
|
|
142
|
-
TorchScript = "TorchScript",
|
|
143
|
-
TorchScriptCpu = "TorchScriptCpu",
|
|
144
|
-
TorchScriptCuda = "TorchScriptCuda",
|
|
145
|
-
PyTorch = "PyTorch",
|
|
146
|
-
ModelLess = "ModelLess"
|
|
147
|
-
}
|
|
148
|
-
declare enum ModelPrecisionType {
|
|
149
|
-
float32 = "float32",
|
|
150
|
-
float16 = "float16",
|
|
151
|
-
int32 = "int32",
|
|
152
|
-
int8 = "int8",
|
|
153
|
-
uint8 = "uint8"
|
|
154
|
-
}
|
|
155
|
-
interface ModelInstanceDef {
|
|
156
|
-
id?: string;
|
|
157
|
-
model_folder_url?: string;
|
|
158
|
-
model_id?: string;
|
|
159
|
-
dataset?: string;
|
|
160
|
-
version?: string;
|
|
161
|
-
format?: ModelFormat;
|
|
162
|
-
type?: ModelPrecisionType;
|
|
163
|
-
}
|
|
164
133
|
declare enum PopComponentType {
|
|
165
134
|
FORWARD = "forward",
|
|
166
135
|
INFERENCE = "inference",
|
|
@@ -424,20 +393,14 @@ interface WorkerOptions extends Options {
|
|
|
424
393
|
* Defaults to process.env['EYEPOP_POP_ID'].
|
|
425
394
|
*/
|
|
426
395
|
popId?: string | TransientPopId | undefined;
|
|
427
|
-
isSandbox?: boolean;
|
|
428
396
|
autoStart?: boolean;
|
|
429
397
|
stopJobs?: boolean;
|
|
430
398
|
isLocalMode?: boolean;
|
|
431
399
|
}
|
|
432
400
|
|
|
433
|
-
interface ModelRef {
|
|
434
|
-
id: string;
|
|
435
|
-
folderUrl: string;
|
|
436
|
-
}
|
|
437
401
|
declare class WorkerEndpoint extends Endpoint<WorkerEndpoint> {
|
|
438
402
|
private _baseUrl;
|
|
439
403
|
private _pipelineId;
|
|
440
|
-
private _sandboxId;
|
|
441
404
|
private _popName;
|
|
442
405
|
private _pipeline;
|
|
443
406
|
constructor(options: WorkerOptions);
|
|
@@ -449,22 +412,6 @@ declare class WorkerEndpoint extends Endpoint<WorkerEndpoint> {
|
|
|
449
412
|
pop(): Pop | null;
|
|
450
413
|
changePop(pop: Pop): Promise<void>;
|
|
451
414
|
private _authenticationHeaders;
|
|
452
|
-
/**
|
|
453
|
-
* @deprecated use pop() instead
|
|
454
|
-
*/
|
|
455
|
-
popComp(): string | null;
|
|
456
|
-
/**
|
|
457
|
-
* @deprecated use changePop() instead
|
|
458
|
-
*/
|
|
459
|
-
changePopComp(popComp: string, modelRefs?: ModelRef[]): Promise<void>;
|
|
460
|
-
/**
|
|
461
|
-
* @deprecated use pop() instead
|
|
462
|
-
*/
|
|
463
|
-
postTransform(): string | null;
|
|
464
|
-
/**
|
|
465
|
-
* @deprecated use changePop() instead
|
|
466
|
-
*/
|
|
467
|
-
changePostTransform(postTransform: string | null): Promise<void>;
|
|
468
415
|
popId(): string | null;
|
|
469
416
|
process(source: Source, params?: ComponentParams[]): Promise<ResultStream>;
|
|
470
417
|
private uploadFile;
|
|
@@ -477,11 +424,6 @@ declare class WorkerEndpoint extends Endpoint<WorkerEndpoint> {
|
|
|
477
424
|
private jobStatus;
|
|
478
425
|
protected reconnect(): Promise<WorkerEndpoint>;
|
|
479
426
|
private startTransientPipeline;
|
|
480
|
-
manifest(): Promise<SourcesEntry[]>;
|
|
481
|
-
models(): Promise<ModelInstanceDef[]>;
|
|
482
|
-
changeManifest(manifests: SourcesEntry[]): Promise<void>;
|
|
483
|
-
loadModel(model: ModelInstanceDef): Promise<ModelInstanceDef>;
|
|
484
|
-
unloadModel(modelId: string): Promise<void>;
|
|
485
427
|
}
|
|
486
428
|
|
|
487
429
|
interface DataOptions extends Options {
|
|
@@ -781,6 +723,23 @@ declare enum WorkflowPhase {
|
|
|
781
723
|
failed = "Failed",
|
|
782
724
|
error = "Error"
|
|
783
725
|
}
|
|
726
|
+
declare enum ModelFormat {
|
|
727
|
+
TensorFlowLite = "TensorFlowLite",
|
|
728
|
+
TensorFlowGraphDef = "TensorFlowGraphDef",
|
|
729
|
+
ONNX = "ONNX",
|
|
730
|
+
TorchScript = "TorchScript",
|
|
731
|
+
TorchScriptCpu = "TorchScriptCpu",
|
|
732
|
+
TorchScriptCuda = "TorchScriptCuda",
|
|
733
|
+
PyTorch = "PyTorch",
|
|
734
|
+
ModelLess = "ModelLess"
|
|
735
|
+
}
|
|
736
|
+
declare enum ModelPrecisionType {
|
|
737
|
+
float32 = "float32",
|
|
738
|
+
float16 = "float16",
|
|
739
|
+
int32 = "int32",
|
|
740
|
+
int8 = "int8",
|
|
741
|
+
uint8 = "uint8"
|
|
742
|
+
}
|
|
784
743
|
|
|
785
744
|
declare class DataEndpoint extends Endpoint<DataEndpoint> {
|
|
786
745
|
private _baseUrl;
|
|
@@ -992,4 +951,4 @@ declare namespace EyePop {
|
|
|
992
951
|
function dataEndpoint(opts?: DataOptions): DataEndpoint;
|
|
993
952
|
}
|
|
994
953
|
|
|
995
|
-
export { AbstractJob, type Annotation, AnnotationType, ArtifactType, type Asset, type AssetImport, AssetStatus, type AssetUuidSource, type Auth0Options, type Authentication, type AutoAnnotateParams, type AutoAnnotatePrompt, AutoAnnotateTask, type BaseComponent, type Box, type ChangeEvent, ChangeType, type ComponentFinderComponent, type ComponentParams, type Contour, type ContourFinderComponent, ContourType, type CreateWorkflow, type CreateWorkflowConfig, DataEndpoint, type DataOptions, type DataSession, type Dataset, type DatasetCreate, type DatasetHeroAssetUpdate, type DatasetParent, type DatasetUpdate, type DatasetVersion, type DatasetVersionAssetStats, Endpoint, EndpointState, ExportedBy, EyePop, EyepopLineDecoder, type FileSource, type ForwardComponent, ForwardOperatorType, type HttpClient, type InferenceComponent, InferenceType, type ListWorkFlowItem, type ListWorkFlowItemMetadata, type ListWorkflowItemMetadataLabels, LoadFromAssetUuidJob, LoadFromJob, LoadLiveIngressJob, LoadMediaStreamJob, type LocalAuth, type Mask, type MediaStreamSource, type Model, type ModelCreate, type ModelExport, ModelExportStatus, ModelFormat, type
|
|
954
|
+
export { AbstractJob, type Annotation, AnnotationType, ArtifactType, type Asset, type AssetImport, AssetStatus, type AssetUuidSource, type Auth0Options, type Authentication, type AutoAnnotateParams, type AutoAnnotatePrompt, AutoAnnotateTask, type BaseComponent, type Box, type ChangeEvent, ChangeType, type ComponentFinderComponent, type ComponentParams, type Contour, type ContourFinderComponent, ContourType, type CreateWorkflow, type CreateWorkflowConfig, DataEndpoint, type DataOptions, type DataSession, type Dataset, type DatasetCreate, type DatasetHeroAssetUpdate, type DatasetParent, type DatasetUpdate, type DatasetVersion, type DatasetVersionAssetStats, Endpoint, EndpointState, ExportedBy, EyePop, EyepopLineDecoder, type FileSource, type ForwardComponent, ForwardOperatorType, type HttpClient, type InferenceComponent, InferenceType, type ListWorkFlowItem, type ListWorkFlowItemMetadata, type ListWorkflowItemMetadataLabels, LoadFromAssetUuidJob, LoadFromJob, LoadLiveIngressJob, LoadMediaStreamJob, type LocalAuth, type Mask, type MediaStreamSource, type Model, type ModelCreate, type ModelExport, ModelExportStatus, ModelFormat, type ModelMetrics, ModelPrecisionType, type ModelSample, ModelStatus, ModelTask, type ModelTrainingProgress, ModelTrainingStage, ModelType, type ModelUpdate, type OAuth2Auth, type OnChangeEvent, type Options, type PathSource, type PlatformSupport, type Point2d, type Point3d, type Pop, type PopComponent, PopComponentType, type PopCrop, type PopForward, type PopForwardOperator, type PredictedClass, type PredictedKeyPoint, type PredictedKeyPoints, type PredictedMesh, type PredictedObject, type PredictedText, type Prediction, type QcAiHubExportParams, type ResultStream, type SecretKeyAuth, Semaphore, type Session, type SessionAuth, type Source, Stream, type StreamEvent, type StreamSource, type StreamTime, type TracingComponent, TranscodeMode, TransientPopId, UploadJob, type UrlSource, UserReview, VideoMode, WebrtcBase, WebrtcWhep, WebrtcWhip, WorkerEndpoint, type WorkerOptions, type WorkerSession, type Workflow, WorkflowPhase, EyePop as default, readableStreamFromString };
|
package/dist/eyepop.index.d.ts
CHANGED
|
@@ -96,7 +96,6 @@ interface WorkerSession extends Session {
|
|
|
96
96
|
readonly popId: string;
|
|
97
97
|
readonly baseUrl: string | undefined;
|
|
98
98
|
readonly pipelineId: string | undefined;
|
|
99
|
-
readonly sandboxId: string | undefined;
|
|
100
99
|
authenticationHeaders(): any;
|
|
101
100
|
}
|
|
102
101
|
declare enum VideoMode {
|
|
@@ -131,36 +130,6 @@ type Source = FileSource | StreamSource | PathSource | UrlSource | AssetUuidSour
|
|
|
131
130
|
interface ResultStream extends AsyncIterable<Prediction> {
|
|
132
131
|
cancel(): void;
|
|
133
132
|
}
|
|
134
|
-
type SourcesEntry = {
|
|
135
|
-
readonly authority: string;
|
|
136
|
-
readonly manifest: string;
|
|
137
|
-
};
|
|
138
|
-
declare enum ModelFormat {
|
|
139
|
-
TensorFlowLite = "TensorFlowLite",
|
|
140
|
-
TensorFlowGraphDef = "TensorFlowGraphDef",
|
|
141
|
-
ONNX = "ONNX",
|
|
142
|
-
TorchScript = "TorchScript",
|
|
143
|
-
TorchScriptCpu = "TorchScriptCpu",
|
|
144
|
-
TorchScriptCuda = "TorchScriptCuda",
|
|
145
|
-
PyTorch = "PyTorch",
|
|
146
|
-
ModelLess = "ModelLess"
|
|
147
|
-
}
|
|
148
|
-
declare enum ModelPrecisionType {
|
|
149
|
-
float32 = "float32",
|
|
150
|
-
float16 = "float16",
|
|
151
|
-
int32 = "int32",
|
|
152
|
-
int8 = "int8",
|
|
153
|
-
uint8 = "uint8"
|
|
154
|
-
}
|
|
155
|
-
interface ModelInstanceDef {
|
|
156
|
-
id?: string;
|
|
157
|
-
model_folder_url?: string;
|
|
158
|
-
model_id?: string;
|
|
159
|
-
dataset?: string;
|
|
160
|
-
version?: string;
|
|
161
|
-
format?: ModelFormat;
|
|
162
|
-
type?: ModelPrecisionType;
|
|
163
|
-
}
|
|
164
133
|
declare enum PopComponentType {
|
|
165
134
|
FORWARD = "forward",
|
|
166
135
|
INFERENCE = "inference",
|
|
@@ -424,20 +393,14 @@ interface WorkerOptions extends Options {
|
|
|
424
393
|
* Defaults to process.env['EYEPOP_POP_ID'].
|
|
425
394
|
*/
|
|
426
395
|
popId?: string | TransientPopId | undefined;
|
|
427
|
-
isSandbox?: boolean;
|
|
428
396
|
autoStart?: boolean;
|
|
429
397
|
stopJobs?: boolean;
|
|
430
398
|
isLocalMode?: boolean;
|
|
431
399
|
}
|
|
432
400
|
|
|
433
|
-
interface ModelRef {
|
|
434
|
-
id: string;
|
|
435
|
-
folderUrl: string;
|
|
436
|
-
}
|
|
437
401
|
declare class WorkerEndpoint extends Endpoint<WorkerEndpoint> {
|
|
438
402
|
private _baseUrl;
|
|
439
403
|
private _pipelineId;
|
|
440
|
-
private _sandboxId;
|
|
441
404
|
private _popName;
|
|
442
405
|
private _pipeline;
|
|
443
406
|
constructor(options: WorkerOptions);
|
|
@@ -449,22 +412,6 @@ declare class WorkerEndpoint extends Endpoint<WorkerEndpoint> {
|
|
|
449
412
|
pop(): Pop | null;
|
|
450
413
|
changePop(pop: Pop): Promise<void>;
|
|
451
414
|
private _authenticationHeaders;
|
|
452
|
-
/**
|
|
453
|
-
* @deprecated use pop() instead
|
|
454
|
-
*/
|
|
455
|
-
popComp(): string | null;
|
|
456
|
-
/**
|
|
457
|
-
* @deprecated use changePop() instead
|
|
458
|
-
*/
|
|
459
|
-
changePopComp(popComp: string, modelRefs?: ModelRef[]): Promise<void>;
|
|
460
|
-
/**
|
|
461
|
-
* @deprecated use pop() instead
|
|
462
|
-
*/
|
|
463
|
-
postTransform(): string | null;
|
|
464
|
-
/**
|
|
465
|
-
* @deprecated use changePop() instead
|
|
466
|
-
*/
|
|
467
|
-
changePostTransform(postTransform: string | null): Promise<void>;
|
|
468
415
|
popId(): string | null;
|
|
469
416
|
process(source: Source, params?: ComponentParams[]): Promise<ResultStream>;
|
|
470
417
|
private uploadFile;
|
|
@@ -477,11 +424,6 @@ declare class WorkerEndpoint extends Endpoint<WorkerEndpoint> {
|
|
|
477
424
|
private jobStatus;
|
|
478
425
|
protected reconnect(): Promise<WorkerEndpoint>;
|
|
479
426
|
private startTransientPipeline;
|
|
480
|
-
manifest(): Promise<SourcesEntry[]>;
|
|
481
|
-
models(): Promise<ModelInstanceDef[]>;
|
|
482
|
-
changeManifest(manifests: SourcesEntry[]): Promise<void>;
|
|
483
|
-
loadModel(model: ModelInstanceDef): Promise<ModelInstanceDef>;
|
|
484
|
-
unloadModel(modelId: string): Promise<void>;
|
|
485
427
|
}
|
|
486
428
|
|
|
487
429
|
interface DataOptions extends Options {
|
|
@@ -781,6 +723,23 @@ declare enum WorkflowPhase {
|
|
|
781
723
|
failed = "Failed",
|
|
782
724
|
error = "Error"
|
|
783
725
|
}
|
|
726
|
+
declare enum ModelFormat {
|
|
727
|
+
TensorFlowLite = "TensorFlowLite",
|
|
728
|
+
TensorFlowGraphDef = "TensorFlowGraphDef",
|
|
729
|
+
ONNX = "ONNX",
|
|
730
|
+
TorchScript = "TorchScript",
|
|
731
|
+
TorchScriptCpu = "TorchScriptCpu",
|
|
732
|
+
TorchScriptCuda = "TorchScriptCuda",
|
|
733
|
+
PyTorch = "PyTorch",
|
|
734
|
+
ModelLess = "ModelLess"
|
|
735
|
+
}
|
|
736
|
+
declare enum ModelPrecisionType {
|
|
737
|
+
float32 = "float32",
|
|
738
|
+
float16 = "float16",
|
|
739
|
+
int32 = "int32",
|
|
740
|
+
int8 = "int8",
|
|
741
|
+
uint8 = "uint8"
|
|
742
|
+
}
|
|
784
743
|
|
|
785
744
|
declare class DataEndpoint extends Endpoint<DataEndpoint> {
|
|
786
745
|
private _baseUrl;
|
|
@@ -992,4 +951,4 @@ declare namespace EyePop {
|
|
|
992
951
|
function dataEndpoint(opts?: DataOptions): DataEndpoint;
|
|
993
952
|
}
|
|
994
953
|
|
|
995
|
-
export { AbstractJob, type Annotation, AnnotationType, ArtifactType, type Asset, type AssetImport, AssetStatus, type AssetUuidSource, type Auth0Options, type Authentication, type AutoAnnotateParams, type AutoAnnotatePrompt, AutoAnnotateTask, type BaseComponent, type Box, type ChangeEvent, ChangeType, type ComponentFinderComponent, type ComponentParams, type Contour, type ContourFinderComponent, ContourType, type CreateWorkflow, type CreateWorkflowConfig, DataEndpoint, type DataOptions, type DataSession, type Dataset, type DatasetCreate, type DatasetHeroAssetUpdate, type DatasetParent, type DatasetUpdate, type DatasetVersion, type DatasetVersionAssetStats, Endpoint, EndpointState, ExportedBy, EyePop, EyepopLineDecoder, type FileSource, type ForwardComponent, ForwardOperatorType, type HttpClient, type InferenceComponent, InferenceType, type ListWorkFlowItem, type ListWorkFlowItemMetadata, type ListWorkflowItemMetadataLabels, LoadFromAssetUuidJob, LoadFromJob, LoadLiveIngressJob, LoadMediaStreamJob, type LocalAuth, type Mask, type MediaStreamSource, type Model, type ModelCreate, type ModelExport, ModelExportStatus, ModelFormat, type
|
|
954
|
+
export { AbstractJob, type Annotation, AnnotationType, ArtifactType, type Asset, type AssetImport, AssetStatus, type AssetUuidSource, type Auth0Options, type Authentication, type AutoAnnotateParams, type AutoAnnotatePrompt, AutoAnnotateTask, type BaseComponent, type Box, type ChangeEvent, ChangeType, type ComponentFinderComponent, type ComponentParams, type Contour, type ContourFinderComponent, ContourType, type CreateWorkflow, type CreateWorkflowConfig, DataEndpoint, type DataOptions, type DataSession, type Dataset, type DatasetCreate, type DatasetHeroAssetUpdate, type DatasetParent, type DatasetUpdate, type DatasetVersion, type DatasetVersionAssetStats, Endpoint, EndpointState, ExportedBy, EyePop, EyepopLineDecoder, type FileSource, type ForwardComponent, ForwardOperatorType, type HttpClient, type InferenceComponent, InferenceType, type ListWorkFlowItem, type ListWorkFlowItemMetadata, type ListWorkflowItemMetadataLabels, LoadFromAssetUuidJob, LoadFromJob, LoadLiveIngressJob, LoadMediaStreamJob, type LocalAuth, type Mask, type MediaStreamSource, type Model, type ModelCreate, type ModelExport, ModelExportStatus, ModelFormat, type ModelMetrics, ModelPrecisionType, type ModelSample, ModelStatus, ModelTask, type ModelTrainingProgress, ModelTrainingStage, ModelType, type ModelUpdate, type OAuth2Auth, type OnChangeEvent, type Options, type PathSource, type PlatformSupport, type Point2d, type Point3d, type Pop, type PopComponent, PopComponentType, type PopCrop, type PopForward, type PopForwardOperator, type PredictedClass, type PredictedKeyPoint, type PredictedKeyPoints, type PredictedMesh, type PredictedObject, type PredictedText, type Prediction, type QcAiHubExportParams, type ResultStream, type SecretKeyAuth, Semaphore, type Session, type SessionAuth, type Source, Stream, type StreamEvent, type StreamSource, type StreamTime, type TracingComponent, TranscodeMode, TransientPopId, UploadJob, type UrlSource, UserReview, VideoMode, WebrtcBase, WebrtcWhep, WebrtcWhip, WorkerEndpoint, type WorkerOptions, type WorkerSession, type Workflow, WorkflowPhase, EyePop as default, readableStreamFromString };
|
package/dist/eyepop.index.js
CHANGED
|
@@ -8899,25 +8899,6 @@ var VideoMode = /* @__PURE__ */ ((VideoMode2) => {
|
|
|
8899
8899
|
VideoMode2["BUFFER"] = "buffer";
|
|
8900
8900
|
return VideoMode2;
|
|
8901
8901
|
})(VideoMode || {});
|
|
8902
|
-
var ModelFormat = /* @__PURE__ */ ((ModelFormat2) => {
|
|
8903
|
-
ModelFormat2["TensorFlowLite"] = "TensorFlowLite";
|
|
8904
|
-
ModelFormat2["TensorFlowGraphDef"] = "TensorFlowGraphDef";
|
|
8905
|
-
ModelFormat2["ONNX"] = "ONNX";
|
|
8906
|
-
ModelFormat2["TorchScript"] = "TorchScript";
|
|
8907
|
-
ModelFormat2["TorchScriptCpu"] = "TorchScriptCpu";
|
|
8908
|
-
ModelFormat2["TorchScriptCuda"] = "TorchScriptCuda";
|
|
8909
|
-
ModelFormat2["PyTorch"] = "PyTorch";
|
|
8910
|
-
ModelFormat2["ModelLess"] = "ModelLess";
|
|
8911
|
-
return ModelFormat2;
|
|
8912
|
-
})(ModelFormat || {});
|
|
8913
|
-
var ModelPrecisionType = /* @__PURE__ */ ((ModelPrecisionType2) => {
|
|
8914
|
-
ModelPrecisionType2["float32"] = "float32";
|
|
8915
|
-
ModelPrecisionType2["float16"] = "float16";
|
|
8916
|
-
ModelPrecisionType2["int32"] = "int32";
|
|
8917
|
-
ModelPrecisionType2["int8"] = "int8";
|
|
8918
|
-
ModelPrecisionType2["uint8"] = "uint8";
|
|
8919
|
-
return ModelPrecisionType2;
|
|
8920
|
-
})(ModelPrecisionType || {});
|
|
8921
8902
|
var PopComponentType = /* @__PURE__ */ ((PopComponentType2) => {
|
|
8922
8903
|
PopComponentType2["FORWARD"] = "forward";
|
|
8923
8904
|
PopComponentType2["INFERENCE"] = "inference";
|
|
@@ -9945,7 +9926,6 @@ if ("document" in globalThis && "implementation" in globalThis.document) {
|
|
|
9945
9926
|
popId: workerOptions.popId,
|
|
9946
9927
|
baseUrl: void 0,
|
|
9947
9928
|
pipelineId: void 0,
|
|
9948
|
-
sandboxId: void 0,
|
|
9949
9929
|
authenticationHeaders: () => {
|
|
9950
9930
|
return { Authorization: `Bearer ${accessToken}` };
|
|
9951
9931
|
}
|
|
@@ -10185,15 +10165,6 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10185
10165
|
this._pipelineId = null;
|
|
10186
10166
|
this._popName = null;
|
|
10187
10167
|
this._pipeline = null;
|
|
10188
|
-
this._sandboxId = null;
|
|
10189
|
-
const sessionAuth = options.auth;
|
|
10190
|
-
if (sessionAuth !== void 0 && sessionAuth.session !== void 0) {
|
|
10191
|
-
const workerSession = sessionAuth.session;
|
|
10192
|
-
if (workerSession.sandboxId) {
|
|
10193
|
-
this._sandboxId = workerSession.sandboxId;
|
|
10194
|
-
this.options().isSandbox = true;
|
|
10195
|
-
}
|
|
10196
|
-
}
|
|
10197
10168
|
}
|
|
10198
10169
|
options() {
|
|
10199
10170
|
return this._options;
|
|
@@ -10213,21 +10184,6 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10213
10184
|
this._logger.info(`stopping pipeline failed, status ${response?.status}: ${message}`);
|
|
10214
10185
|
}
|
|
10215
10186
|
}
|
|
10216
|
-
if (this._sandboxId && this._baseUrl) {
|
|
10217
|
-
const sandboxUrl = `${this._baseUrl}/sandboxes/${this._sandboxId}`;
|
|
10218
|
-
const headers = {
|
|
10219
|
-
Authorization: await this.authorizationHeader()
|
|
10220
|
-
};
|
|
10221
|
-
let response = await this._client?.fetch(sandboxUrl, {
|
|
10222
|
-
method: "DELETE",
|
|
10223
|
-
headers
|
|
10224
|
-
});
|
|
10225
|
-
if (response?.status != 204) {
|
|
10226
|
-
const message = await response?.text();
|
|
10227
|
-
this._logger.info(`disconnecting sandbox failed, status ${response?.status}: ${message}`);
|
|
10228
|
-
}
|
|
10229
|
-
this._sandboxId = null;
|
|
10230
|
-
}
|
|
10231
10187
|
return super.disconnect(wait);
|
|
10232
10188
|
}
|
|
10233
10189
|
statusHandler404(statusCode) {
|
|
@@ -10249,7 +10205,6 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10249
10205
|
popId: this.options().popId,
|
|
10250
10206
|
baseUrl: this._baseUrl,
|
|
10251
10207
|
pipelineId: this._pipelineId,
|
|
10252
|
-
sandboxId: this._sandboxId ?? void 0,
|
|
10253
10208
|
authenticationHeaders: () => this._authenticationHeaders(session)
|
|
10254
10209
|
};
|
|
10255
10210
|
}
|
|
@@ -10293,94 +10248,6 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10293
10248
|
_authenticationHeaders(session) {
|
|
10294
10249
|
return this._options.auth.isLocal !== void 0 ? {} : { Authorization: `Bearer ${session.accessToken}` };
|
|
10295
10250
|
}
|
|
10296
|
-
/**
|
|
10297
|
-
* @deprecated use pop() instead
|
|
10298
|
-
*/
|
|
10299
|
-
popComp() {
|
|
10300
|
-
if (this._pipeline) {
|
|
10301
|
-
return this._pipeline.inferPipeline ?? null;
|
|
10302
|
-
} else {
|
|
10303
|
-
return null;
|
|
10304
|
-
}
|
|
10305
|
-
}
|
|
10306
|
-
/**
|
|
10307
|
-
* @deprecated use changePop() instead
|
|
10308
|
-
*/
|
|
10309
|
-
async changePopComp(popComp, modelRefs = []) {
|
|
10310
|
-
const client = this._client;
|
|
10311
|
-
const baseUrl = this._baseUrl;
|
|
10312
|
-
if (!baseUrl || !client) {
|
|
10313
|
-
return Promise.reject("endpoint not connected, use connect()");
|
|
10314
|
-
}
|
|
10315
|
-
const body = {
|
|
10316
|
-
pipeline: popComp,
|
|
10317
|
-
modelRefs
|
|
10318
|
-
};
|
|
10319
|
-
let response = await this.fetchWithRetry(async () => {
|
|
10320
|
-
const session = await this.session();
|
|
10321
|
-
let headers = {
|
|
10322
|
-
...this._authenticationHeaders(session),
|
|
10323
|
-
"Content-Type": "application/json"
|
|
10324
|
-
};
|
|
10325
|
-
const patch_url = `${session.baseUrl}/pipelines/${session.pipelineId}/inferencePipeline`;
|
|
10326
|
-
return client.fetch(patch_url, {
|
|
10327
|
-
method: "PATCH",
|
|
10328
|
-
body: JSON.stringify(body),
|
|
10329
|
-
headers
|
|
10330
|
-
});
|
|
10331
|
-
});
|
|
10332
|
-
if (response.status != 204) {
|
|
10333
|
-
const message = await response.text();
|
|
10334
|
-
return Promise.reject(`Unexpected status ${response.status}: ${message}`);
|
|
10335
|
-
}
|
|
10336
|
-
if (this._pipeline) {
|
|
10337
|
-
this._pipeline.inferPipeline = popComp;
|
|
10338
|
-
this._pipeline.modelRefs = modelRefs;
|
|
10339
|
-
}
|
|
10340
|
-
}
|
|
10341
|
-
/**
|
|
10342
|
-
* @deprecated use pop() instead
|
|
10343
|
-
*/
|
|
10344
|
-
postTransform() {
|
|
10345
|
-
if (this._pipeline) {
|
|
10346
|
-
return this._pipeline.postTransform;
|
|
10347
|
-
} else {
|
|
10348
|
-
return null;
|
|
10349
|
-
}
|
|
10350
|
-
}
|
|
10351
|
-
/**
|
|
10352
|
-
* @deprecated use changePop() instead
|
|
10353
|
-
*/
|
|
10354
|
-
async changePostTransform(postTransform) {
|
|
10355
|
-
const client = this._client;
|
|
10356
|
-
const baseUrl = this._baseUrl;
|
|
10357
|
-
if (!baseUrl || !client) {
|
|
10358
|
-
return Promise.reject("endpoint not connected, use connect()");
|
|
10359
|
-
}
|
|
10360
|
-
const body = {
|
|
10361
|
-
transform: postTransform
|
|
10362
|
-
};
|
|
10363
|
-
let response = await this.fetchWithRetry(async () => {
|
|
10364
|
-
const session = await this.session();
|
|
10365
|
-
let headers = {
|
|
10366
|
-
...this._authenticationHeaders(session),
|
|
10367
|
-
"Content-Type": "application/json"
|
|
10368
|
-
};
|
|
10369
|
-
const patch_url = `${session.baseUrl}/pipelines/${session.pipelineId}/postTransform`;
|
|
10370
|
-
return client.fetch(patch_url, {
|
|
10371
|
-
method: "PATCH",
|
|
10372
|
-
body: JSON.stringify(body),
|
|
10373
|
-
headers
|
|
10374
|
-
});
|
|
10375
|
-
});
|
|
10376
|
-
if (response.status != 204) {
|
|
10377
|
-
const message = await response.text();
|
|
10378
|
-
return Promise.reject(`Unexpected status ${response.status}: ${message}`);
|
|
10379
|
-
}
|
|
10380
|
-
if (this._pipeline) {
|
|
10381
|
-
this._pipeline.postTransform = postTransform;
|
|
10382
|
-
}
|
|
10383
|
-
}
|
|
10384
10251
|
popId() {
|
|
10385
10252
|
return this.options().popId || null;
|
|
10386
10253
|
}
|
|
@@ -10662,24 +10529,6 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10662
10529
|
this._baseUrl = baseUrl.toString();
|
|
10663
10530
|
if (this._baseUrl) {
|
|
10664
10531
|
this._baseUrl = this._baseUrl.replace(/\/+$/, "");
|
|
10665
|
-
if (this.options().isSandbox && this._sandboxId === null) {
|
|
10666
|
-
const headers3 = {
|
|
10667
|
-
Authorization: await this.authorizationHeader()
|
|
10668
|
-
};
|
|
10669
|
-
const createSandboxUrl = `${this._baseUrl}/sandboxes`;
|
|
10670
|
-
const response3 = await this._client.fetch(createSandboxUrl, {
|
|
10671
|
-
method: "POST",
|
|
10672
|
-
headers: headers3
|
|
10673
|
-
});
|
|
10674
|
-
if (!response3.ok) {
|
|
10675
|
-
const message = await response3.text();
|
|
10676
|
-
return Promise.reject(`Unexpected status ${response3.status}: ${message}`);
|
|
10677
|
-
}
|
|
10678
|
-
const responseJson = await response3.json();
|
|
10679
|
-
if (responseJson) {
|
|
10680
|
-
this._sandboxId = responseJson;
|
|
10681
|
-
}
|
|
10682
|
-
}
|
|
10683
10532
|
if (this.options().popId == "transient" /* Transient */) {
|
|
10684
10533
|
this._pipelineId = await this.startTransientPipeline();
|
|
10685
10534
|
this._popName = this.options().popId || null;
|
|
@@ -10728,7 +10577,6 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10728
10577
|
async startTransientPipeline() {
|
|
10729
10578
|
const client = this._client;
|
|
10730
10579
|
const baseUrl = this._baseUrl;
|
|
10731
|
-
const sandboxId = this._sandboxId;
|
|
10732
10580
|
if (client == null || baseUrl == null) {
|
|
10733
10581
|
return Promise.reject("endpoint not initialized");
|
|
10734
10582
|
}
|
|
@@ -10749,12 +10597,7 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10749
10597
|
logging: ["out_meta"],
|
|
10750
10598
|
videoOutput: "no_output"
|
|
10751
10599
|
};
|
|
10752
|
-
|
|
10753
|
-
if (sandboxId) {
|
|
10754
|
-
post_url = `${baseUrl.replace(/\/+$/, "")}/pipelines?sandboxId=${sandboxId}`;
|
|
10755
|
-
} else {
|
|
10756
|
-
post_url = `${baseUrl.replace(/\/+$/, "")}/pipelines`;
|
|
10757
|
-
}
|
|
10600
|
+
const post_url = `${baseUrl.replace(/\/+$/, "")}/pipelines`;
|
|
10758
10601
|
let response = await this.fetchWithRetry(async () => {
|
|
10759
10602
|
let headers = {
|
|
10760
10603
|
"Content-Type": "application/json",
|
|
@@ -10773,148 +10616,6 @@ var WorkerEndpoint = class extends Endpoint {
|
|
|
10773
10616
|
const result = await response.json();
|
|
10774
10617
|
return result["id"];
|
|
10775
10618
|
}
|
|
10776
|
-
async manifest() {
|
|
10777
|
-
this._logger.warn("getManifest for development use only");
|
|
10778
|
-
const client = this._client;
|
|
10779
|
-
const baseUrl = this._baseUrl;
|
|
10780
|
-
if (!baseUrl || !client) {
|
|
10781
|
-
return Promise.reject("endpoint not connected, use connect()");
|
|
10782
|
-
}
|
|
10783
|
-
let get_path;
|
|
10784
|
-
if (this._sandboxId === null) {
|
|
10785
|
-
get_path = `${baseUrl}/models/sources`;
|
|
10786
|
-
} else {
|
|
10787
|
-
get_path = `${baseUrl}/models/sources?sandboxId=${this._sandboxId}`;
|
|
10788
|
-
}
|
|
10789
|
-
let response = await this.fetchWithRetry(async () => {
|
|
10790
|
-
const session = await this.session();
|
|
10791
|
-
let headers = {
|
|
10792
|
-
...this._authenticationHeaders(session),
|
|
10793
|
-
"Content-Type": "application/json"
|
|
10794
|
-
};
|
|
10795
|
-
return client.fetch(get_path, { headers });
|
|
10796
|
-
});
|
|
10797
|
-
if (!response.ok) {
|
|
10798
|
-
const message = await response.text();
|
|
10799
|
-
return Promise.reject(`Unexpected status ${response.status}: ${message}`);
|
|
10800
|
-
}
|
|
10801
|
-
return await response.json();
|
|
10802
|
-
}
|
|
10803
|
-
async models() {
|
|
10804
|
-
this._logger.warn("listModels for development use only");
|
|
10805
|
-
const client = this._client;
|
|
10806
|
-
const baseUrl = this._baseUrl;
|
|
10807
|
-
if (!baseUrl || !client) {
|
|
10808
|
-
return Promise.reject("endpoint not connected, use connect()");
|
|
10809
|
-
}
|
|
10810
|
-
let get_path;
|
|
10811
|
-
if (this._sandboxId === null) {
|
|
10812
|
-
get_path = `${baseUrl}/models/instances`;
|
|
10813
|
-
} else {
|
|
10814
|
-
get_path = `${baseUrl}/models/instances?sandboxId=${this._sandboxId}`;
|
|
10815
|
-
}
|
|
10816
|
-
let response = await this.fetchWithRetry(async () => {
|
|
10817
|
-
const session = await this.session();
|
|
10818
|
-
let headers = {
|
|
10819
|
-
...this._authenticationHeaders(session),
|
|
10820
|
-
"Content-Type": "application/json"
|
|
10821
|
-
};
|
|
10822
|
-
return client.fetch(get_path, { headers });
|
|
10823
|
-
});
|
|
10824
|
-
if (!response.ok) {
|
|
10825
|
-
const message = await response.text();
|
|
10826
|
-
return Promise.reject(`Unexpected status ${response.status}: ${message}`);
|
|
10827
|
-
}
|
|
10828
|
-
const result = await response.json();
|
|
10829
|
-
return result;
|
|
10830
|
-
}
|
|
10831
|
-
async changeManifest(manifests) {
|
|
10832
|
-
this._logger.warn("setManifest for development use only");
|
|
10833
|
-
const client = this._client;
|
|
10834
|
-
const baseUrl = this._baseUrl;
|
|
10835
|
-
if (!baseUrl || !client) {
|
|
10836
|
-
return Promise.reject("endpoint not connected, use connect()");
|
|
10837
|
-
}
|
|
10838
|
-
let put_url;
|
|
10839
|
-
if (this._sandboxId === null) {
|
|
10840
|
-
put_url = `${baseUrl}/models/sources`;
|
|
10841
|
-
} else {
|
|
10842
|
-
put_url = `${baseUrl}/models/sources?sandboxId=${this._sandboxId}`;
|
|
10843
|
-
}
|
|
10844
|
-
let response = await this.fetchWithRetry(async () => {
|
|
10845
|
-
const session = await this.session();
|
|
10846
|
-
let headers = {
|
|
10847
|
-
...this._authenticationHeaders(session),
|
|
10848
|
-
"Content-Type": "application/json"
|
|
10849
|
-
};
|
|
10850
|
-
return client.fetch(put_url, {
|
|
10851
|
-
method: "PUT",
|
|
10852
|
-
body: JSON.stringify(manifests),
|
|
10853
|
-
headers
|
|
10854
|
-
});
|
|
10855
|
-
});
|
|
10856
|
-
if (!response.ok) {
|
|
10857
|
-
const message = await response.text();
|
|
10858
|
-
return Promise.reject(`Unexpected status ${response.status}: ${message}`);
|
|
10859
|
-
}
|
|
10860
|
-
}
|
|
10861
|
-
async loadModel(model) {
|
|
10862
|
-
this._logger.warn("loadModel for development use only");
|
|
10863
|
-
const client = this._client;
|
|
10864
|
-
const baseUrl = this._baseUrl;
|
|
10865
|
-
if (!baseUrl || !client) {
|
|
10866
|
-
return Promise.reject("endpoint not connected, use connect()");
|
|
10867
|
-
}
|
|
10868
|
-
let post_url;
|
|
10869
|
-
if (this._sandboxId === null) {
|
|
10870
|
-
post_url = `${baseUrl}/models/instances`;
|
|
10871
|
-
} else {
|
|
10872
|
-
post_url = `${baseUrl}/models/instances?sandboxId=${this._sandboxId}`;
|
|
10873
|
-
}
|
|
10874
|
-
let response = await this.fetchWithRetry(async () => {
|
|
10875
|
-
const session = await this.session();
|
|
10876
|
-
let headers = {
|
|
10877
|
-
...this._authenticationHeaders(session),
|
|
10878
|
-
"Content-Type": "application/json"
|
|
10879
|
-
};
|
|
10880
|
-
return client.fetch(post_url, {
|
|
10881
|
-
method: "POST",
|
|
10882
|
-
body: JSON.stringify(model),
|
|
10883
|
-
headers
|
|
10884
|
-
});
|
|
10885
|
-
});
|
|
10886
|
-
if (!response.ok) {
|
|
10887
|
-
const message = await response.text();
|
|
10888
|
-
return Promise.reject(`Unexpected status ${response.status}: ${message}`);
|
|
10889
|
-
}
|
|
10890
|
-
return await response.json();
|
|
10891
|
-
}
|
|
10892
|
-
async unloadModel(modelId) {
|
|
10893
|
-
this._logger.warn("purgeModel for development use only");
|
|
10894
|
-
const client = this._client;
|
|
10895
|
-
const baseUrl = this._baseUrl;
|
|
10896
|
-
if (!baseUrl || !client) {
|
|
10897
|
-
return Promise.reject("endpoint not connected, use connect()");
|
|
10898
|
-
}
|
|
10899
|
-
let delete_url;
|
|
10900
|
-
if (this._sandboxId === null) {
|
|
10901
|
-
delete_url = `${baseUrl}/models/instances/${modelId}`;
|
|
10902
|
-
} else {
|
|
10903
|
-
delete_url = `${baseUrl}/models/instances/${modelId}?sandboxId=${this._sandboxId}`;
|
|
10904
|
-
}
|
|
10905
|
-
let response = await this.fetchWithRetry(async () => {
|
|
10906
|
-
const session = await this.session();
|
|
10907
|
-
let headers = {
|
|
10908
|
-
...this._authenticationHeaders(session),
|
|
10909
|
-
"Content-Type": "application/json"
|
|
10910
|
-
};
|
|
10911
|
-
return client.fetch(delete_url, { method: "DELETE", headers });
|
|
10912
|
-
});
|
|
10913
|
-
if (!response.ok) {
|
|
10914
|
-
const message = await response.text();
|
|
10915
|
-
return Promise.reject(`Unexpected status ${response.status}: ${message}`);
|
|
10916
|
-
}
|
|
10917
|
-
}
|
|
10918
10619
|
};
|
|
10919
10620
|
|
|
10920
10621
|
// shims/websockets.ts
|
|
@@ -11088,6 +10789,25 @@ var WorkflowPhase = /* @__PURE__ */ ((WorkflowPhase3) => {
|
|
|
11088
10789
|
WorkflowPhase3["error"] = "Error";
|
|
11089
10790
|
return WorkflowPhase3;
|
|
11090
10791
|
})(WorkflowPhase || {});
|
|
10792
|
+
var ModelFormat = /* @__PURE__ */ ((ModelFormat3) => {
|
|
10793
|
+
ModelFormat3["TensorFlowLite"] = "TensorFlowLite";
|
|
10794
|
+
ModelFormat3["TensorFlowGraphDef"] = "TensorFlowGraphDef";
|
|
10795
|
+
ModelFormat3["ONNX"] = "ONNX";
|
|
10796
|
+
ModelFormat3["TorchScript"] = "TorchScript";
|
|
10797
|
+
ModelFormat3["TorchScriptCpu"] = "TorchScriptCpu";
|
|
10798
|
+
ModelFormat3["TorchScriptCuda"] = "TorchScriptCuda";
|
|
10799
|
+
ModelFormat3["PyTorch"] = "PyTorch";
|
|
10800
|
+
ModelFormat3["ModelLess"] = "ModelLess";
|
|
10801
|
+
return ModelFormat3;
|
|
10802
|
+
})(ModelFormat || {});
|
|
10803
|
+
var ModelPrecisionType = /* @__PURE__ */ ((ModelPrecisionType2) => {
|
|
10804
|
+
ModelPrecisionType2["float32"] = "float32";
|
|
10805
|
+
ModelPrecisionType2["float16"] = "float16";
|
|
10806
|
+
ModelPrecisionType2["int32"] = "int32";
|
|
10807
|
+
ModelPrecisionType2["int8"] = "int8";
|
|
10808
|
+
ModelPrecisionType2["uint8"] = "uint8";
|
|
10809
|
+
return ModelPrecisionType2;
|
|
10810
|
+
})(ModelPrecisionType || {});
|
|
11091
10811
|
|
|
11092
10812
|
// data/data_endpoint.ts
|
|
11093
10813
|
var WS_INITIAL_RECONNECT_DELAY = 1e3;
|