@eyepop.ai/eyepop 3.25.2 → 3.26.0-rc.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 +43 -15
- package/dist/eyepop.index.d.ts +43 -15
- package/dist/eyepop.index.js +194 -62
- package/dist/eyepop.index.js.map +1 -1
- package/dist/eyepop.index.mjs +193 -62
- 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
|
@@ -1477,6 +1477,11 @@ interface WorkerOptions extends Options {
|
|
|
1477
1477
|
* Defaults to process.env['EYEPOP_PIPELINE_MODE'].
|
|
1478
1478
|
*/
|
|
1479
1479
|
isPipelineMode?: boolean;
|
|
1480
|
+
/**
|
|
1481
|
+
* In pipeline mode, the most sockets the endpoint opens. Each runs its own pipeline, which plays its
|
|
1482
|
+
* sources one after another; a new one opens only while every open one has a source. Defaults to 4.
|
|
1483
|
+
*/
|
|
1484
|
+
pipelineSockets?: number;
|
|
1480
1485
|
}
|
|
1481
1486
|
|
|
1482
1487
|
/**
|
|
@@ -1979,12 +1984,6 @@ declare class SessionBackend implements WorkerBackend {
|
|
|
1979
1984
|
session(): Promise<WorkerSession>;
|
|
1980
1985
|
popName(): string | null;
|
|
1981
1986
|
pop(): Pop | null;
|
|
1982
|
-
/**
|
|
1983
|
-
* A select forward's results come only at V3. Only a Pop that selects asks
|
|
1984
|
-
* for it, so a worker too old to know V3 - which also rejects that Pop - is
|
|
1985
|
-
* never sent a version it would not accept.
|
|
1986
|
-
*/
|
|
1987
|
-
private predictionVersion;
|
|
1988
1987
|
changePop(pop: Pop): Promise<void>;
|
|
1989
1988
|
private _authenticationHeaders;
|
|
1990
1989
|
submit(work: WorkerWork): Promise<ResultStream>;
|
|
@@ -2020,10 +2019,12 @@ declare const PIPELINE_PATH = "/api/v1/pipeline";
|
|
|
2020
2019
|
declare const SUBPROTOCOL = "eyepop.v1";
|
|
2021
2020
|
/** A socket may have this many open sources; one more is answered `queue_full`. */
|
|
2022
2021
|
declare const MAX_OPEN_SOURCES = 256;
|
|
2022
|
+
/** The most sockets an endpoint opens unless `pipelineSockets` says otherwise. */
|
|
2023
|
+
declare const PIPELINE_SOCKETS = 4;
|
|
2023
2024
|
/** Uploads up to this size go as one combined message, larger ones in chunks. */
|
|
2024
2025
|
declare const COMBINED_UPLOAD_MAX_BYTES: number;
|
|
2025
2026
|
/** Why pipeline mode refused its configuration. */
|
|
2026
|
-
type PipelineConfigurationProblem = 'session_options' | 'job_queue_length' | 'no_pipeline_api_url' | 'insecure_url';
|
|
2027
|
+
type PipelineConfigurationProblem = 'session_options' | 'job_queue_length' | 'pipeline_sockets' | 'no_pipeline_api_url' | 'insecure_url';
|
|
2027
2028
|
/** Pipeline mode cannot run as configured; `options` names the refused options for `session_options`. */
|
|
2028
2029
|
declare class PipelineConfigurationError extends Error {
|
|
2029
2030
|
readonly problem: PipelineConfigurationProblem;
|
|
@@ -2075,6 +2076,7 @@ declare class OpenSource {
|
|
|
2075
2076
|
readonly id: string;
|
|
2076
2077
|
readonly inbox: Inbox<InboxItem>;
|
|
2077
2078
|
readonly uploads: Map<number | null, Credit>;
|
|
2079
|
+
endedBefore: number;
|
|
2078
2080
|
constructor(id: string);
|
|
2079
2081
|
close(error: Error): void;
|
|
2080
2082
|
}
|
|
@@ -2083,6 +2085,7 @@ interface Media {
|
|
|
2083
2085
|
readonly open: () => Promise<UploadBody$1>;
|
|
2084
2086
|
readonly contentType: string;
|
|
2085
2087
|
readonly size: number | undefined;
|
|
2088
|
+
readonly once?: boolean;
|
|
2086
2089
|
}
|
|
2087
2090
|
/** A job: one source on the endpoint's socket, its predictions read as an async iterable. */
|
|
2088
2091
|
declare class PipelineJob implements ResultStream {
|
|
@@ -2094,6 +2097,8 @@ declare class PipelineJob implements ResultStream {
|
|
|
2094
2097
|
private readonly _results;
|
|
2095
2098
|
private _consumed;
|
|
2096
2099
|
private _cancelled;
|
|
2100
|
+
private _markCancelled;
|
|
2101
|
+
readonly whenCancelled: Promise<void>;
|
|
2097
2102
|
openSource: OpenSource | null;
|
|
2098
2103
|
stopOnPipeline: (() => void) | null;
|
|
2099
2104
|
constructor(source: Message, media: Media[], live: boolean, params: ProcessParams, mediaStream?: MediaStream | undefined);
|
|
@@ -2104,18 +2109,23 @@ declare class PipelineJob implements ResultStream {
|
|
|
2104
2109
|
cancel(): void;
|
|
2105
2110
|
[Symbol.asyncIterator](): AsyncIterator<Prediction>;
|
|
2106
2111
|
}
|
|
2107
|
-
/**
|
|
2112
|
+
/**
|
|
2113
|
+
* Runs jobs on up to `pipelineSockets` sockets to the pipeline API; connecting opens the first. A
|
|
2114
|
+
* socket's pipeline plays its sources one after another, so a batch on one socket leaves the GPU
|
|
2115
|
+
* mostly idle. While every open socket has a source and fewer than `pipelineSockets` are open, the next
|
|
2116
|
+
* job opens another; each job goes on the socket that has room and the fewest open sources.
|
|
2117
|
+
*/
|
|
2108
2118
|
declare class PipelineBackend implements WorkerBackend {
|
|
2109
2119
|
private readonly ctx;
|
|
2110
2120
|
private _pipelineApiUrl;
|
|
2111
|
-
private
|
|
2121
|
+
private _sockets;
|
|
2112
2122
|
private _connecting;
|
|
2113
2123
|
private _sendChain;
|
|
2114
2124
|
private _disconnecting;
|
|
2115
2125
|
private _nextId;
|
|
2116
2126
|
private _currentPop;
|
|
2117
2127
|
private readonly _warned;
|
|
2118
|
-
private
|
|
2128
|
+
private _noExtraSocketUntil;
|
|
2119
2129
|
private _reconnects;
|
|
2120
2130
|
constructor(ctx: WorkerContext);
|
|
2121
2131
|
reconnect(): Promise<void>;
|
|
@@ -2124,8 +2134,17 @@ declare class PipelineBackend implements WorkerBackend {
|
|
|
2124
2134
|
popName(): string | null;
|
|
2125
2135
|
authorizationHeader(): Promise<string>;
|
|
2126
2136
|
private inOrder;
|
|
2127
|
-
|
|
2137
|
+
private openSockets;
|
|
2138
|
+
/** An open socket, or a new one with the last pop set on it. */
|
|
2128
2139
|
private ensureSocket;
|
|
2140
|
+
/**
|
|
2141
|
+
* The socket for the next job; the caller runs it in submission order. A live job goes on a socket
|
|
2142
|
+
* of its own, an idle one or a new one, which `pipelineSockets` does not count. Any other job skips
|
|
2143
|
+
* the sockets with a live source: a new one while every other socket has a source and fewer than
|
|
2144
|
+
* `pipelineSockets` are open, else the one with room and the fewest sources.
|
|
2145
|
+
*/
|
|
2146
|
+
private socketForJob;
|
|
2147
|
+
/** A new socket with the last pop set on it; `patient` waits through 503 with Retry-After. */
|
|
2129
2148
|
private openSocket;
|
|
2130
2149
|
private startHeartbeat;
|
|
2131
2150
|
private socketUrl;
|
|
@@ -2139,7 +2158,11 @@ declare class PipelineBackend implements WorkerBackend {
|
|
|
2139
2158
|
/** Send a command that is answered by `result` or `error` under its id. */
|
|
2140
2159
|
private command;
|
|
2141
2160
|
pop(): Pop | null;
|
|
2142
|
-
/**
|
|
2161
|
+
/**
|
|
2162
|
+
* Set the pop on every open socket's pipeline; a pop the first refuses rejects, and the last pop it
|
|
2163
|
+
* took stays. shortcut: a refusal from a later socket, which the first took, leaves the earlier ones
|
|
2164
|
+
* on the new pop; a refusal is the pop's own fault, so every socket answers it alike.
|
|
2165
|
+
*/
|
|
2143
2166
|
changePop(pop: Pop): Promise<void>;
|
|
2144
2167
|
private setPopOn;
|
|
2145
2168
|
submit(work: WorkerWork): Promise<ResultStream>;
|
|
@@ -2147,11 +2170,16 @@ declare class PipelineBackend implements WorkerBackend {
|
|
|
2147
2170
|
private jobOf;
|
|
2148
2171
|
private sourceJob;
|
|
2149
2172
|
private pathMedia;
|
|
2150
|
-
/**
|
|
2173
|
+
/**
|
|
2174
|
+
* Run the job's source to its end. A live source refused overloaded goes once more on a new socket.
|
|
2175
|
+
* A source refused queue_full goes again once another source on the socket ended, so it may go after
|
|
2176
|
+
* jobs submitted later; with none of the endpoint's other sources open there, or with an upload from
|
|
2177
|
+
* the caller's own stream, which cannot be read twice, the refusal stands.
|
|
2178
|
+
*/
|
|
2151
2179
|
private run;
|
|
2152
2180
|
/** Send the job's setSource; the caller runs it in submission order. */
|
|
2153
2181
|
private setSource;
|
|
2154
|
-
/** Hand the source's predictions to the job until it ends;
|
|
2182
|
+
/** Hand the source's predictions to the job until it ends; the refusal to retry on, overloaded or queue_full. */
|
|
2155
2183
|
private follow;
|
|
2156
2184
|
/** Send each upload member's bytes in chunks within its credit, then its uploaded. */
|
|
2157
2185
|
private upload;
|
|
@@ -2287,4 +2315,4 @@ declare namespace EyePop {
|
|
|
2287
2315
|
function dataEndpoint(opts?: DataOptions): DataEndpoint;
|
|
2288
2316
|
}
|
|
2289
2317
|
|
|
2290
|
-
export { type AbilityAliasEntry, AbstractJob, type AccessTokenAuth, type AliasResolution, type Annotation, AnnotationInclusionMode, AnnotationType, type ApiKeyAuth, type Area, AreaType, ArtifactType, type Asset, type AssetImport, AssetInclusionMode, AssetStatus, AssetUrlType, type AssetUuidSource, type Auth0Options, type Authentication, type AutoAnnotate, type AutoAnnotateParams, type AutoAnnotatePrompt, AutoAnnotateStatus, AutoAnnotateTask, type AutoPromptConfig, type AutoTask, type BaseArea, type BaseComponent, type BaseTask, type Box, COMBINED_UPLOAD_MAX_BYTES, type Camera, type CameraDistortion, type CameraExtrinsics, type CameraIntrinsics, type ChangeEvent, ChangeType, type ClassificationTask, type CloudBounds, type CloudBox, type ComponentFinderComponent, type ComponentParams, ComputeAccountMismatchError, ComputeApiError, type Contour, type ContourArea, type ContourFinderComponent, ContourType, type CreateWorkflow, type CreateWorkflowConfig, DEFAULT_PREDICTION_VERSION, DataApiType, DataEndpoint, type DataOptions, type DataSession, type Dataset, type DatasetAutoAnnotate, type DatasetAutoAnnotateCreate, type DatasetAutoAnnotateUpdate, type DatasetCreate, type DatasetHeroAssetUpdate, type DatasetParent, type DatasetUpdate, type DatasetVersion, type DatasetVersionAssetStats, type Depth, DepthMap, type DepthSemantic, type DownloadResponse, Endpoint, EndpointState, type EvaluateConfig, type EvaluateFilter, type EvaluateRequest, type EvaluateResponse, type EvaluateRunInfo, EvaluationStatus, ExportedBy, EyePop, EyePopDataWebSocketError, EyepopLineDecoder, type FileSource, type ForwardComponent, ForwardOperatorType, type HttpClient, type InferRequest, type InferRunInfo, type InferRuntimeConfig, type InferenceComponent, InferenceType, type ListWorkFlowItem, type ListWorkFlowItemMetadata, type ListWorkflowItemMetadataLabels, LoadFromAssetUuidJob, LoadFromGroupJob, LoadFromJob, LoadMediaStreamJob, type LocalAuth, MAX_OPEN_SOURCES, 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 MotionDetectConfig, MotionModel, type MultipartContent, type MultipartPart, type OAuth2Auth, type OnChangeEvent, type Options, PIPELINE_PATH, type PathSource, PipelineBackend, PipelineCommandError, PipelineConfigurationError, type PipelineConfigurationProblem, PipelineJob, PipelineSocketClosedError, PipelineSourceError, type PlatformSupport, type Point2d, type Point3d, PointCloud, type Pop, type PopComponent, PopComponentType, type PopCrop, type PopDepthMap, type PopForward, type PopForwardOperator, type PopSelect, type PredictedClass, type PredictedEmbedding, type PredictedKeyPoint, type PredictedKeyPoints, type PredictedMesh, type PredictedMotion, type PredictedObject, type PredictedText, type Prediction, PredictionVersion, type ProcessParams, type ProcessRequest, QUATERNION_TOLERANCE, type QcAiHubExportParams, type Quaternion, type RectangleArea, type ResponseSchema, type ResultStream, type Roi, SUBPROTOCOL, SelectMode, Semaphore, type Session, type SessionAuth, SessionBackend, type Source, type SourceDefaults, Stream, type StreamEvent, type StreamSource, type StreamTime, TaskMode, TaskType, type TimeSpan, type TrackingComponent, TranscodeMode, type TransformInto, TransientPopId, UploadGroupJob, UploadJob, type UploadSource, type UrlSource, UserReview, type Vector3, type Vector3d, VideoMode, type VlmAbility, type VlmAbilityCreate, type VlmAbilityGroup, type VlmAbilityGroupCreate, type VlmAbilityGroupUpdate, VlmAbilityStatus, type VlmAbilityUpdate, WebrtcBase, WebrtcWhep, WebrtcWhip, type WorkerBackend, type WorkerContext, WorkerEndpoint, type WorkerOptions, type WorkerSession, type WorkerWork, type Workflow, WorkflowPhase, accessTokenCredential, apiKeyCredential, cloudOfDepth, cloudOfObject, cloudsOfPrediction, decodeDepthMap, decodePointCloud, EyePop as default, encodeMultipartFormData, getBaseUrl, isSelectOperator, popSelects, randomMultipartBoundary, readableStreamFromString, resolveAuth, validateCamera, validatePop };
|
|
2318
|
+
export { type AbilityAliasEntry, AbstractJob, type AccessTokenAuth, type AliasResolution, type Annotation, AnnotationInclusionMode, AnnotationType, type ApiKeyAuth, type Area, AreaType, ArtifactType, type Asset, type AssetImport, AssetInclusionMode, AssetStatus, AssetUrlType, type AssetUuidSource, type Auth0Options, type Authentication, type AutoAnnotate, type AutoAnnotateParams, type AutoAnnotatePrompt, AutoAnnotateStatus, AutoAnnotateTask, type AutoPromptConfig, type AutoTask, type BaseArea, type BaseComponent, type BaseTask, type Box, COMBINED_UPLOAD_MAX_BYTES, type Camera, type CameraDistortion, type CameraExtrinsics, type CameraIntrinsics, type ChangeEvent, ChangeType, type ClassificationTask, type CloudBounds, type CloudBox, type ComponentFinderComponent, type ComponentParams, ComputeAccountMismatchError, ComputeApiError, type Contour, type ContourArea, type ContourFinderComponent, ContourType, type CreateWorkflow, type CreateWorkflowConfig, DEFAULT_PREDICTION_VERSION, DataApiType, DataEndpoint, type DataOptions, type DataSession, type Dataset, type DatasetAutoAnnotate, type DatasetAutoAnnotateCreate, type DatasetAutoAnnotateUpdate, type DatasetCreate, type DatasetHeroAssetUpdate, type DatasetParent, type DatasetUpdate, type DatasetVersion, type DatasetVersionAssetStats, type Depth, DepthMap, type DepthSemantic, type DownloadResponse, Endpoint, EndpointState, type EvaluateConfig, type EvaluateFilter, type EvaluateRequest, type EvaluateResponse, type EvaluateRunInfo, EvaluationStatus, ExportedBy, EyePop, EyePopDataWebSocketError, EyepopLineDecoder, type FileSource, type ForwardComponent, ForwardOperatorType, type HttpClient, type InferRequest, type InferRunInfo, type InferRuntimeConfig, type InferenceComponent, InferenceType, type ListWorkFlowItem, type ListWorkFlowItemMetadata, type ListWorkflowItemMetadataLabels, LoadFromAssetUuidJob, LoadFromGroupJob, LoadFromJob, LoadMediaStreamJob, type LocalAuth, MAX_OPEN_SOURCES, 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 MotionDetectConfig, MotionModel, type MultipartContent, type MultipartPart, type OAuth2Auth, type OnChangeEvent, type Options, PIPELINE_PATH, PIPELINE_SOCKETS, type PathSource, PipelineBackend, PipelineCommandError, PipelineConfigurationError, type PipelineConfigurationProblem, PipelineJob, PipelineSocketClosedError, PipelineSourceError, type PlatformSupport, type Point2d, type Point3d, PointCloud, type Pop, type PopComponent, PopComponentType, type PopCrop, type PopDepthMap, type PopForward, type PopForwardOperator, type PopSelect, type PredictedClass, type PredictedEmbedding, type PredictedKeyPoint, type PredictedKeyPoints, type PredictedMesh, type PredictedMotion, type PredictedObject, type PredictedText, type Prediction, PredictionVersion, type ProcessParams, type ProcessRequest, QUATERNION_TOLERANCE, type QcAiHubExportParams, type Quaternion, type RectangleArea, type ResponseSchema, type ResultStream, type Roi, SUBPROTOCOL, SelectMode, Semaphore, type Session, type SessionAuth, SessionBackend, type Source, type SourceDefaults, Stream, type StreamEvent, type StreamSource, type StreamTime, TaskMode, TaskType, type TimeSpan, type TrackingComponent, TranscodeMode, type TransformInto, TransientPopId, UploadGroupJob, UploadJob, type UploadSource, type UrlSource, UserReview, type Vector3, type Vector3d, VideoMode, type VlmAbility, type VlmAbilityCreate, type VlmAbilityGroup, type VlmAbilityGroupCreate, type VlmAbilityGroupUpdate, VlmAbilityStatus, type VlmAbilityUpdate, WebrtcBase, WebrtcWhep, WebrtcWhip, type WorkerBackend, type WorkerContext, WorkerEndpoint, type WorkerOptions, type WorkerSession, type WorkerWork, type Workflow, WorkflowPhase, accessTokenCredential, apiKeyCredential, cloudOfDepth, cloudOfObject, cloudsOfPrediction, decodeDepthMap, decodePointCloud, EyePop as default, encodeMultipartFormData, getBaseUrl, isSelectOperator, popSelects, randomMultipartBoundary, readableStreamFromString, resolveAuth, validateCamera, validatePop };
|
package/dist/eyepop.index.d.ts
CHANGED
|
@@ -1477,6 +1477,11 @@ interface WorkerOptions extends Options {
|
|
|
1477
1477
|
* Defaults to process.env['EYEPOP_PIPELINE_MODE'].
|
|
1478
1478
|
*/
|
|
1479
1479
|
isPipelineMode?: boolean;
|
|
1480
|
+
/**
|
|
1481
|
+
* In pipeline mode, the most sockets the endpoint opens. Each runs its own pipeline, which plays its
|
|
1482
|
+
* sources one after another; a new one opens only while every open one has a source. Defaults to 4.
|
|
1483
|
+
*/
|
|
1484
|
+
pipelineSockets?: number;
|
|
1480
1485
|
}
|
|
1481
1486
|
|
|
1482
1487
|
/**
|
|
@@ -1979,12 +1984,6 @@ declare class SessionBackend implements WorkerBackend {
|
|
|
1979
1984
|
session(): Promise<WorkerSession>;
|
|
1980
1985
|
popName(): string | null;
|
|
1981
1986
|
pop(): Pop | null;
|
|
1982
|
-
/**
|
|
1983
|
-
* A select forward's results come only at V3. Only a Pop that selects asks
|
|
1984
|
-
* for it, so a worker too old to know V3 - which also rejects that Pop - is
|
|
1985
|
-
* never sent a version it would not accept.
|
|
1986
|
-
*/
|
|
1987
|
-
private predictionVersion;
|
|
1988
1987
|
changePop(pop: Pop): Promise<void>;
|
|
1989
1988
|
private _authenticationHeaders;
|
|
1990
1989
|
submit(work: WorkerWork): Promise<ResultStream>;
|
|
@@ -2020,10 +2019,12 @@ declare const PIPELINE_PATH = "/api/v1/pipeline";
|
|
|
2020
2019
|
declare const SUBPROTOCOL = "eyepop.v1";
|
|
2021
2020
|
/** A socket may have this many open sources; one more is answered `queue_full`. */
|
|
2022
2021
|
declare const MAX_OPEN_SOURCES = 256;
|
|
2022
|
+
/** The most sockets an endpoint opens unless `pipelineSockets` says otherwise. */
|
|
2023
|
+
declare const PIPELINE_SOCKETS = 4;
|
|
2023
2024
|
/** Uploads up to this size go as one combined message, larger ones in chunks. */
|
|
2024
2025
|
declare const COMBINED_UPLOAD_MAX_BYTES: number;
|
|
2025
2026
|
/** Why pipeline mode refused its configuration. */
|
|
2026
|
-
type PipelineConfigurationProblem = 'session_options' | 'job_queue_length' | 'no_pipeline_api_url' | 'insecure_url';
|
|
2027
|
+
type PipelineConfigurationProblem = 'session_options' | 'job_queue_length' | 'pipeline_sockets' | 'no_pipeline_api_url' | 'insecure_url';
|
|
2027
2028
|
/** Pipeline mode cannot run as configured; `options` names the refused options for `session_options`. */
|
|
2028
2029
|
declare class PipelineConfigurationError extends Error {
|
|
2029
2030
|
readonly problem: PipelineConfigurationProblem;
|
|
@@ -2075,6 +2076,7 @@ declare class OpenSource {
|
|
|
2075
2076
|
readonly id: string;
|
|
2076
2077
|
readonly inbox: Inbox<InboxItem>;
|
|
2077
2078
|
readonly uploads: Map<number | null, Credit>;
|
|
2079
|
+
endedBefore: number;
|
|
2078
2080
|
constructor(id: string);
|
|
2079
2081
|
close(error: Error): void;
|
|
2080
2082
|
}
|
|
@@ -2083,6 +2085,7 @@ interface Media {
|
|
|
2083
2085
|
readonly open: () => Promise<UploadBody$1>;
|
|
2084
2086
|
readonly contentType: string;
|
|
2085
2087
|
readonly size: number | undefined;
|
|
2088
|
+
readonly once?: boolean;
|
|
2086
2089
|
}
|
|
2087
2090
|
/** A job: one source on the endpoint's socket, its predictions read as an async iterable. */
|
|
2088
2091
|
declare class PipelineJob implements ResultStream {
|
|
@@ -2094,6 +2097,8 @@ declare class PipelineJob implements ResultStream {
|
|
|
2094
2097
|
private readonly _results;
|
|
2095
2098
|
private _consumed;
|
|
2096
2099
|
private _cancelled;
|
|
2100
|
+
private _markCancelled;
|
|
2101
|
+
readonly whenCancelled: Promise<void>;
|
|
2097
2102
|
openSource: OpenSource | null;
|
|
2098
2103
|
stopOnPipeline: (() => void) | null;
|
|
2099
2104
|
constructor(source: Message, media: Media[], live: boolean, params: ProcessParams, mediaStream?: MediaStream | undefined);
|
|
@@ -2104,18 +2109,23 @@ declare class PipelineJob implements ResultStream {
|
|
|
2104
2109
|
cancel(): void;
|
|
2105
2110
|
[Symbol.asyncIterator](): AsyncIterator<Prediction>;
|
|
2106
2111
|
}
|
|
2107
|
-
/**
|
|
2112
|
+
/**
|
|
2113
|
+
* Runs jobs on up to `pipelineSockets` sockets to the pipeline API; connecting opens the first. A
|
|
2114
|
+
* socket's pipeline plays its sources one after another, so a batch on one socket leaves the GPU
|
|
2115
|
+
* mostly idle. While every open socket has a source and fewer than `pipelineSockets` are open, the next
|
|
2116
|
+
* job opens another; each job goes on the socket that has room and the fewest open sources.
|
|
2117
|
+
*/
|
|
2108
2118
|
declare class PipelineBackend implements WorkerBackend {
|
|
2109
2119
|
private readonly ctx;
|
|
2110
2120
|
private _pipelineApiUrl;
|
|
2111
|
-
private
|
|
2121
|
+
private _sockets;
|
|
2112
2122
|
private _connecting;
|
|
2113
2123
|
private _sendChain;
|
|
2114
2124
|
private _disconnecting;
|
|
2115
2125
|
private _nextId;
|
|
2116
2126
|
private _currentPop;
|
|
2117
2127
|
private readonly _warned;
|
|
2118
|
-
private
|
|
2128
|
+
private _noExtraSocketUntil;
|
|
2119
2129
|
private _reconnects;
|
|
2120
2130
|
constructor(ctx: WorkerContext);
|
|
2121
2131
|
reconnect(): Promise<void>;
|
|
@@ -2124,8 +2134,17 @@ declare class PipelineBackend implements WorkerBackend {
|
|
|
2124
2134
|
popName(): string | null;
|
|
2125
2135
|
authorizationHeader(): Promise<string>;
|
|
2126
2136
|
private inOrder;
|
|
2127
|
-
|
|
2137
|
+
private openSockets;
|
|
2138
|
+
/** An open socket, or a new one with the last pop set on it. */
|
|
2128
2139
|
private ensureSocket;
|
|
2140
|
+
/**
|
|
2141
|
+
* The socket for the next job; the caller runs it in submission order. A live job goes on a socket
|
|
2142
|
+
* of its own, an idle one or a new one, which `pipelineSockets` does not count. Any other job skips
|
|
2143
|
+
* the sockets with a live source: a new one while every other socket has a source and fewer than
|
|
2144
|
+
* `pipelineSockets` are open, else the one with room and the fewest sources.
|
|
2145
|
+
*/
|
|
2146
|
+
private socketForJob;
|
|
2147
|
+
/** A new socket with the last pop set on it; `patient` waits through 503 with Retry-After. */
|
|
2129
2148
|
private openSocket;
|
|
2130
2149
|
private startHeartbeat;
|
|
2131
2150
|
private socketUrl;
|
|
@@ -2139,7 +2158,11 @@ declare class PipelineBackend implements WorkerBackend {
|
|
|
2139
2158
|
/** Send a command that is answered by `result` or `error` under its id. */
|
|
2140
2159
|
private command;
|
|
2141
2160
|
pop(): Pop | null;
|
|
2142
|
-
/**
|
|
2161
|
+
/**
|
|
2162
|
+
* Set the pop on every open socket's pipeline; a pop the first refuses rejects, and the last pop it
|
|
2163
|
+
* took stays. shortcut: a refusal from a later socket, which the first took, leaves the earlier ones
|
|
2164
|
+
* on the new pop; a refusal is the pop's own fault, so every socket answers it alike.
|
|
2165
|
+
*/
|
|
2143
2166
|
changePop(pop: Pop): Promise<void>;
|
|
2144
2167
|
private setPopOn;
|
|
2145
2168
|
submit(work: WorkerWork): Promise<ResultStream>;
|
|
@@ -2147,11 +2170,16 @@ declare class PipelineBackend implements WorkerBackend {
|
|
|
2147
2170
|
private jobOf;
|
|
2148
2171
|
private sourceJob;
|
|
2149
2172
|
private pathMedia;
|
|
2150
|
-
/**
|
|
2173
|
+
/**
|
|
2174
|
+
* Run the job's source to its end. A live source refused overloaded goes once more on a new socket.
|
|
2175
|
+
* A source refused queue_full goes again once another source on the socket ended, so it may go after
|
|
2176
|
+
* jobs submitted later; with none of the endpoint's other sources open there, or with an upload from
|
|
2177
|
+
* the caller's own stream, which cannot be read twice, the refusal stands.
|
|
2178
|
+
*/
|
|
2151
2179
|
private run;
|
|
2152
2180
|
/** Send the job's setSource; the caller runs it in submission order. */
|
|
2153
2181
|
private setSource;
|
|
2154
|
-
/** Hand the source's predictions to the job until it ends;
|
|
2182
|
+
/** Hand the source's predictions to the job until it ends; the refusal to retry on, overloaded or queue_full. */
|
|
2155
2183
|
private follow;
|
|
2156
2184
|
/** Send each upload member's bytes in chunks within its credit, then its uploaded. */
|
|
2157
2185
|
private upload;
|
|
@@ -2287,4 +2315,4 @@ declare namespace EyePop {
|
|
|
2287
2315
|
function dataEndpoint(opts?: DataOptions): DataEndpoint;
|
|
2288
2316
|
}
|
|
2289
2317
|
|
|
2290
|
-
export { type AbilityAliasEntry, AbstractJob, type AccessTokenAuth, type AliasResolution, type Annotation, AnnotationInclusionMode, AnnotationType, type ApiKeyAuth, type Area, AreaType, ArtifactType, type Asset, type AssetImport, AssetInclusionMode, AssetStatus, AssetUrlType, type AssetUuidSource, type Auth0Options, type Authentication, type AutoAnnotate, type AutoAnnotateParams, type AutoAnnotatePrompt, AutoAnnotateStatus, AutoAnnotateTask, type AutoPromptConfig, type AutoTask, type BaseArea, type BaseComponent, type BaseTask, type Box, COMBINED_UPLOAD_MAX_BYTES, type Camera, type CameraDistortion, type CameraExtrinsics, type CameraIntrinsics, type ChangeEvent, ChangeType, type ClassificationTask, type CloudBounds, type CloudBox, type ComponentFinderComponent, type ComponentParams, ComputeAccountMismatchError, ComputeApiError, type Contour, type ContourArea, type ContourFinderComponent, ContourType, type CreateWorkflow, type CreateWorkflowConfig, DEFAULT_PREDICTION_VERSION, DataApiType, DataEndpoint, type DataOptions, type DataSession, type Dataset, type DatasetAutoAnnotate, type DatasetAutoAnnotateCreate, type DatasetAutoAnnotateUpdate, type DatasetCreate, type DatasetHeroAssetUpdate, type DatasetParent, type DatasetUpdate, type DatasetVersion, type DatasetVersionAssetStats, type Depth, DepthMap, type DepthSemantic, type DownloadResponse, Endpoint, EndpointState, type EvaluateConfig, type EvaluateFilter, type EvaluateRequest, type EvaluateResponse, type EvaluateRunInfo, EvaluationStatus, ExportedBy, EyePop, EyePopDataWebSocketError, EyepopLineDecoder, type FileSource, type ForwardComponent, ForwardOperatorType, type HttpClient, type InferRequest, type InferRunInfo, type InferRuntimeConfig, type InferenceComponent, InferenceType, type ListWorkFlowItem, type ListWorkFlowItemMetadata, type ListWorkflowItemMetadataLabels, LoadFromAssetUuidJob, LoadFromGroupJob, LoadFromJob, LoadMediaStreamJob, type LocalAuth, MAX_OPEN_SOURCES, 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 MotionDetectConfig, MotionModel, type MultipartContent, type MultipartPart, type OAuth2Auth, type OnChangeEvent, type Options, PIPELINE_PATH, type PathSource, PipelineBackend, PipelineCommandError, PipelineConfigurationError, type PipelineConfigurationProblem, PipelineJob, PipelineSocketClosedError, PipelineSourceError, type PlatformSupport, type Point2d, type Point3d, PointCloud, type Pop, type PopComponent, PopComponentType, type PopCrop, type PopDepthMap, type PopForward, type PopForwardOperator, type PopSelect, type PredictedClass, type PredictedEmbedding, type PredictedKeyPoint, type PredictedKeyPoints, type PredictedMesh, type PredictedMotion, type PredictedObject, type PredictedText, type Prediction, PredictionVersion, type ProcessParams, type ProcessRequest, QUATERNION_TOLERANCE, type QcAiHubExportParams, type Quaternion, type RectangleArea, type ResponseSchema, type ResultStream, type Roi, SUBPROTOCOL, SelectMode, Semaphore, type Session, type SessionAuth, SessionBackend, type Source, type SourceDefaults, Stream, type StreamEvent, type StreamSource, type StreamTime, TaskMode, TaskType, type TimeSpan, type TrackingComponent, TranscodeMode, type TransformInto, TransientPopId, UploadGroupJob, UploadJob, type UploadSource, type UrlSource, UserReview, type Vector3, type Vector3d, VideoMode, type VlmAbility, type VlmAbilityCreate, type VlmAbilityGroup, type VlmAbilityGroupCreate, type VlmAbilityGroupUpdate, VlmAbilityStatus, type VlmAbilityUpdate, WebrtcBase, WebrtcWhep, WebrtcWhip, type WorkerBackend, type WorkerContext, WorkerEndpoint, type WorkerOptions, type WorkerSession, type WorkerWork, type Workflow, WorkflowPhase, accessTokenCredential, apiKeyCredential, cloudOfDepth, cloudOfObject, cloudsOfPrediction, decodeDepthMap, decodePointCloud, EyePop as default, encodeMultipartFormData, getBaseUrl, isSelectOperator, popSelects, randomMultipartBoundary, readableStreamFromString, resolveAuth, validateCamera, validatePop };
|
|
2318
|
+
export { type AbilityAliasEntry, AbstractJob, type AccessTokenAuth, type AliasResolution, type Annotation, AnnotationInclusionMode, AnnotationType, type ApiKeyAuth, type Area, AreaType, ArtifactType, type Asset, type AssetImport, AssetInclusionMode, AssetStatus, AssetUrlType, type AssetUuidSource, type Auth0Options, type Authentication, type AutoAnnotate, type AutoAnnotateParams, type AutoAnnotatePrompt, AutoAnnotateStatus, AutoAnnotateTask, type AutoPromptConfig, type AutoTask, type BaseArea, type BaseComponent, type BaseTask, type Box, COMBINED_UPLOAD_MAX_BYTES, type Camera, type CameraDistortion, type CameraExtrinsics, type CameraIntrinsics, type ChangeEvent, ChangeType, type ClassificationTask, type CloudBounds, type CloudBox, type ComponentFinderComponent, type ComponentParams, ComputeAccountMismatchError, ComputeApiError, type Contour, type ContourArea, type ContourFinderComponent, ContourType, type CreateWorkflow, type CreateWorkflowConfig, DEFAULT_PREDICTION_VERSION, DataApiType, DataEndpoint, type DataOptions, type DataSession, type Dataset, type DatasetAutoAnnotate, type DatasetAutoAnnotateCreate, type DatasetAutoAnnotateUpdate, type DatasetCreate, type DatasetHeroAssetUpdate, type DatasetParent, type DatasetUpdate, type DatasetVersion, type DatasetVersionAssetStats, type Depth, DepthMap, type DepthSemantic, type DownloadResponse, Endpoint, EndpointState, type EvaluateConfig, type EvaluateFilter, type EvaluateRequest, type EvaluateResponse, type EvaluateRunInfo, EvaluationStatus, ExportedBy, EyePop, EyePopDataWebSocketError, EyepopLineDecoder, type FileSource, type ForwardComponent, ForwardOperatorType, type HttpClient, type InferRequest, type InferRunInfo, type InferRuntimeConfig, type InferenceComponent, InferenceType, type ListWorkFlowItem, type ListWorkFlowItemMetadata, type ListWorkflowItemMetadataLabels, LoadFromAssetUuidJob, LoadFromGroupJob, LoadFromJob, LoadMediaStreamJob, type LocalAuth, MAX_OPEN_SOURCES, 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 MotionDetectConfig, MotionModel, type MultipartContent, type MultipartPart, type OAuth2Auth, type OnChangeEvent, type Options, PIPELINE_PATH, PIPELINE_SOCKETS, type PathSource, PipelineBackend, PipelineCommandError, PipelineConfigurationError, type PipelineConfigurationProblem, PipelineJob, PipelineSocketClosedError, PipelineSourceError, type PlatformSupport, type Point2d, type Point3d, PointCloud, type Pop, type PopComponent, PopComponentType, type PopCrop, type PopDepthMap, type PopForward, type PopForwardOperator, type PopSelect, type PredictedClass, type PredictedEmbedding, type PredictedKeyPoint, type PredictedKeyPoints, type PredictedMesh, type PredictedMotion, type PredictedObject, type PredictedText, type Prediction, PredictionVersion, type ProcessParams, type ProcessRequest, QUATERNION_TOLERANCE, type QcAiHubExportParams, type Quaternion, type RectangleArea, type ResponseSchema, type ResultStream, type Roi, SUBPROTOCOL, SelectMode, Semaphore, type Session, type SessionAuth, SessionBackend, type Source, type SourceDefaults, Stream, type StreamEvent, type StreamSource, type StreamTime, TaskMode, TaskType, type TimeSpan, type TrackingComponent, TranscodeMode, type TransformInto, TransientPopId, UploadGroupJob, UploadJob, type UploadSource, type UrlSource, UserReview, type Vector3, type Vector3d, VideoMode, type VlmAbility, type VlmAbilityCreate, type VlmAbilityGroup, type VlmAbilityGroupCreate, type VlmAbilityGroupUpdate, VlmAbilityStatus, type VlmAbilityUpdate, WebrtcBase, WebrtcWhep, WebrtcWhip, type WorkerBackend, type WorkerContext, WorkerEndpoint, type WorkerOptions, type WorkerSession, type WorkerWork, type Workflow, WorkflowPhase, accessTokenCredential, apiKeyCredential, cloudOfDepth, cloudOfObject, cloudsOfPrediction, decodeDepthMap, decodePointCloud, EyePop as default, encodeMultipartFormData, getBaseUrl, isSelectOperator, popSelects, randomMultipartBoundary, readableStreamFromString, resolveAuth, validateCamera, validatePop };
|