@eyepop.ai/eyepop 3.25.2 → 3.25.4
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 +53 -15
- package/dist/eyepop.index.d.ts +53 -15
- package/dist/eyepop.index.js +200 -64
- package/dist/eyepop.index.js.map +1 -1
- package/dist/eyepop.index.mjs +199 -64
- 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
|
@@ -665,6 +665,16 @@ interface InferRequest {
|
|
|
665
665
|
refresh?: boolean;
|
|
666
666
|
transform_into?: TransformInto;
|
|
667
667
|
response_schema?: ResponseSchema;
|
|
668
|
+
/**
|
|
669
|
+
* Auto-label task. The worker derives the prompt and output schema from the task and
|
|
670
|
+
* `prompts`, so `text_prompt`, `transform_into` and `response_schema` must be unset.
|
|
671
|
+
* Object detection returns `objects`, image classification `classes`, each labeled with a
|
|
672
|
+
* prompt's label. A task takes one image. Leave `config.max_new_tokens` unset to use the
|
|
673
|
+
* worker's default, which leaves room for a detection answer.
|
|
674
|
+
*/
|
|
675
|
+
task?: AutoAnnotateTask;
|
|
676
|
+
/** Labels and what each one means, for `task`; required with a task. */
|
|
677
|
+
prompts?: AutoAnnotatePrompt[];
|
|
668
678
|
}
|
|
669
679
|
interface EvaluateFilter {
|
|
670
680
|
partitions?: string[];
|
|
@@ -1477,6 +1487,11 @@ interface WorkerOptions extends Options {
|
|
|
1477
1487
|
* Defaults to process.env['EYEPOP_PIPELINE_MODE'].
|
|
1478
1488
|
*/
|
|
1479
1489
|
isPipelineMode?: boolean;
|
|
1490
|
+
/**
|
|
1491
|
+
* In pipeline mode, the most sockets the endpoint opens. Each runs its own pipeline, which plays its
|
|
1492
|
+
* sources one after another; a new one opens only while every open one has a source. Defaults to 4.
|
|
1493
|
+
*/
|
|
1494
|
+
pipelineSockets?: number;
|
|
1480
1495
|
}
|
|
1481
1496
|
|
|
1482
1497
|
/**
|
|
@@ -1979,12 +1994,6 @@ declare class SessionBackend implements WorkerBackend {
|
|
|
1979
1994
|
session(): Promise<WorkerSession>;
|
|
1980
1995
|
popName(): string | null;
|
|
1981
1996
|
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
1997
|
changePop(pop: Pop): Promise<void>;
|
|
1989
1998
|
private _authenticationHeaders;
|
|
1990
1999
|
submit(work: WorkerWork): Promise<ResultStream>;
|
|
@@ -2020,10 +2029,12 @@ declare const PIPELINE_PATH = "/api/v1/pipeline";
|
|
|
2020
2029
|
declare const SUBPROTOCOL = "eyepop.v1";
|
|
2021
2030
|
/** A socket may have this many open sources; one more is answered `queue_full`. */
|
|
2022
2031
|
declare const MAX_OPEN_SOURCES = 256;
|
|
2032
|
+
/** The most sockets an endpoint opens unless `pipelineSockets` says otherwise. */
|
|
2033
|
+
declare const PIPELINE_SOCKETS = 4;
|
|
2023
2034
|
/** Uploads up to this size go as one combined message, larger ones in chunks. */
|
|
2024
2035
|
declare const COMBINED_UPLOAD_MAX_BYTES: number;
|
|
2025
2036
|
/** Why pipeline mode refused its configuration. */
|
|
2026
|
-
type PipelineConfigurationProblem = 'session_options' | 'job_queue_length' | 'no_pipeline_api_url' | 'insecure_url';
|
|
2037
|
+
type PipelineConfigurationProblem = 'session_options' | 'job_queue_length' | 'pipeline_sockets' | 'no_pipeline_api_url' | 'insecure_url';
|
|
2027
2038
|
/** Pipeline mode cannot run as configured; `options` names the refused options for `session_options`. */
|
|
2028
2039
|
declare class PipelineConfigurationError extends Error {
|
|
2029
2040
|
readonly problem: PipelineConfigurationProblem;
|
|
@@ -2075,6 +2086,7 @@ declare class OpenSource {
|
|
|
2075
2086
|
readonly id: string;
|
|
2076
2087
|
readonly inbox: Inbox<InboxItem>;
|
|
2077
2088
|
readonly uploads: Map<number | null, Credit>;
|
|
2089
|
+
endedBefore: number;
|
|
2078
2090
|
constructor(id: string);
|
|
2079
2091
|
close(error: Error): void;
|
|
2080
2092
|
}
|
|
@@ -2083,6 +2095,7 @@ interface Media {
|
|
|
2083
2095
|
readonly open: () => Promise<UploadBody$1>;
|
|
2084
2096
|
readonly contentType: string;
|
|
2085
2097
|
readonly size: number | undefined;
|
|
2098
|
+
readonly once?: boolean;
|
|
2086
2099
|
}
|
|
2087
2100
|
/** A job: one source on the endpoint's socket, its predictions read as an async iterable. */
|
|
2088
2101
|
declare class PipelineJob implements ResultStream {
|
|
@@ -2094,6 +2107,8 @@ declare class PipelineJob implements ResultStream {
|
|
|
2094
2107
|
private readonly _results;
|
|
2095
2108
|
private _consumed;
|
|
2096
2109
|
private _cancelled;
|
|
2110
|
+
private _markCancelled;
|
|
2111
|
+
readonly whenCancelled: Promise<void>;
|
|
2097
2112
|
openSource: OpenSource | null;
|
|
2098
2113
|
stopOnPipeline: (() => void) | null;
|
|
2099
2114
|
constructor(source: Message, media: Media[], live: boolean, params: ProcessParams, mediaStream?: MediaStream | undefined);
|
|
@@ -2104,18 +2119,23 @@ declare class PipelineJob implements ResultStream {
|
|
|
2104
2119
|
cancel(): void;
|
|
2105
2120
|
[Symbol.asyncIterator](): AsyncIterator<Prediction>;
|
|
2106
2121
|
}
|
|
2107
|
-
/**
|
|
2122
|
+
/**
|
|
2123
|
+
* Runs jobs on up to `pipelineSockets` sockets to the pipeline API; connecting opens the first. A
|
|
2124
|
+
* socket's pipeline plays its sources one after another, so a batch on one socket leaves the GPU
|
|
2125
|
+
* mostly idle. While every open socket has a source and fewer than `pipelineSockets` are open, the next
|
|
2126
|
+
* job opens another; each job goes on the socket that has room and the fewest open sources.
|
|
2127
|
+
*/
|
|
2108
2128
|
declare class PipelineBackend implements WorkerBackend {
|
|
2109
2129
|
private readonly ctx;
|
|
2110
2130
|
private _pipelineApiUrl;
|
|
2111
|
-
private
|
|
2131
|
+
private _sockets;
|
|
2112
2132
|
private _connecting;
|
|
2113
2133
|
private _sendChain;
|
|
2114
2134
|
private _disconnecting;
|
|
2115
2135
|
private _nextId;
|
|
2116
2136
|
private _currentPop;
|
|
2117
2137
|
private readonly _warned;
|
|
2118
|
-
private
|
|
2138
|
+
private _noExtraSocketUntil;
|
|
2119
2139
|
private _reconnects;
|
|
2120
2140
|
constructor(ctx: WorkerContext);
|
|
2121
2141
|
reconnect(): Promise<void>;
|
|
@@ -2124,8 +2144,17 @@ declare class PipelineBackend implements WorkerBackend {
|
|
|
2124
2144
|
popName(): string | null;
|
|
2125
2145
|
authorizationHeader(): Promise<string>;
|
|
2126
2146
|
private inOrder;
|
|
2127
|
-
|
|
2147
|
+
private openSockets;
|
|
2148
|
+
/** An open socket, or a new one with the last pop set on it. */
|
|
2128
2149
|
private ensureSocket;
|
|
2150
|
+
/**
|
|
2151
|
+
* The socket for the next job; the caller runs it in submission order. A live job goes on a socket
|
|
2152
|
+
* of its own, an idle one or a new one, which `pipelineSockets` does not count. Any other job skips
|
|
2153
|
+
* the sockets with a live source: a new one while every other socket has a source and fewer than
|
|
2154
|
+
* `pipelineSockets` are open, else the one with room and the fewest sources.
|
|
2155
|
+
*/
|
|
2156
|
+
private socketForJob;
|
|
2157
|
+
/** A new socket with the last pop set on it; `patient` waits through 503 with Retry-After. */
|
|
2129
2158
|
private openSocket;
|
|
2130
2159
|
private startHeartbeat;
|
|
2131
2160
|
private socketUrl;
|
|
@@ -2139,7 +2168,11 @@ declare class PipelineBackend implements WorkerBackend {
|
|
|
2139
2168
|
/** Send a command that is answered by `result` or `error` under its id. */
|
|
2140
2169
|
private command;
|
|
2141
2170
|
pop(): Pop | null;
|
|
2142
|
-
/**
|
|
2171
|
+
/**
|
|
2172
|
+
* Set the pop on every open socket's pipeline; a pop the first refuses rejects, and the last pop it
|
|
2173
|
+
* took stays. shortcut: a refusal from a later socket, which the first took, leaves the earlier ones
|
|
2174
|
+
* on the new pop; a refusal is the pop's own fault, so every socket answers it alike.
|
|
2175
|
+
*/
|
|
2143
2176
|
changePop(pop: Pop): Promise<void>;
|
|
2144
2177
|
private setPopOn;
|
|
2145
2178
|
submit(work: WorkerWork): Promise<ResultStream>;
|
|
@@ -2147,11 +2180,16 @@ declare class PipelineBackend implements WorkerBackend {
|
|
|
2147
2180
|
private jobOf;
|
|
2148
2181
|
private sourceJob;
|
|
2149
2182
|
private pathMedia;
|
|
2150
|
-
/**
|
|
2183
|
+
/**
|
|
2184
|
+
* Run the job's source to its end. A live source refused overloaded goes once more on a new socket.
|
|
2185
|
+
* A source refused queue_full goes again once another source on the socket ended, so it may go after
|
|
2186
|
+
* jobs submitted later; with none of the endpoint's other sources open there, or with an upload from
|
|
2187
|
+
* the caller's own stream, which cannot be read twice, the refusal stands.
|
|
2188
|
+
*/
|
|
2151
2189
|
private run;
|
|
2152
2190
|
/** Send the job's setSource; the caller runs it in submission order. */
|
|
2153
2191
|
private setSource;
|
|
2154
|
-
/** Hand the source's predictions to the job until it ends;
|
|
2192
|
+
/** Hand the source's predictions to the job until it ends; the refusal to retry on, overloaded or queue_full. */
|
|
2155
2193
|
private follow;
|
|
2156
2194
|
/** Send each upload member's bytes in chunks within its credit, then its uploaded. */
|
|
2157
2195
|
private upload;
|
|
@@ -2287,4 +2325,4 @@ declare namespace EyePop {
|
|
|
2287
2325
|
function dataEndpoint(opts?: DataOptions): DataEndpoint;
|
|
2288
2326
|
}
|
|
2289
2327
|
|
|
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 };
|
|
2328
|
+
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
|
@@ -665,6 +665,16 @@ interface InferRequest {
|
|
|
665
665
|
refresh?: boolean;
|
|
666
666
|
transform_into?: TransformInto;
|
|
667
667
|
response_schema?: ResponseSchema;
|
|
668
|
+
/**
|
|
669
|
+
* Auto-label task. The worker derives the prompt and output schema from the task and
|
|
670
|
+
* `prompts`, so `text_prompt`, `transform_into` and `response_schema` must be unset.
|
|
671
|
+
* Object detection returns `objects`, image classification `classes`, each labeled with a
|
|
672
|
+
* prompt's label. A task takes one image. Leave `config.max_new_tokens` unset to use the
|
|
673
|
+
* worker's default, which leaves room for a detection answer.
|
|
674
|
+
*/
|
|
675
|
+
task?: AutoAnnotateTask;
|
|
676
|
+
/** Labels and what each one means, for `task`; required with a task. */
|
|
677
|
+
prompts?: AutoAnnotatePrompt[];
|
|
668
678
|
}
|
|
669
679
|
interface EvaluateFilter {
|
|
670
680
|
partitions?: string[];
|
|
@@ -1477,6 +1487,11 @@ interface WorkerOptions extends Options {
|
|
|
1477
1487
|
* Defaults to process.env['EYEPOP_PIPELINE_MODE'].
|
|
1478
1488
|
*/
|
|
1479
1489
|
isPipelineMode?: boolean;
|
|
1490
|
+
/**
|
|
1491
|
+
* In pipeline mode, the most sockets the endpoint opens. Each runs its own pipeline, which plays its
|
|
1492
|
+
* sources one after another; a new one opens only while every open one has a source. Defaults to 4.
|
|
1493
|
+
*/
|
|
1494
|
+
pipelineSockets?: number;
|
|
1480
1495
|
}
|
|
1481
1496
|
|
|
1482
1497
|
/**
|
|
@@ -1979,12 +1994,6 @@ declare class SessionBackend implements WorkerBackend {
|
|
|
1979
1994
|
session(): Promise<WorkerSession>;
|
|
1980
1995
|
popName(): string | null;
|
|
1981
1996
|
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
1997
|
changePop(pop: Pop): Promise<void>;
|
|
1989
1998
|
private _authenticationHeaders;
|
|
1990
1999
|
submit(work: WorkerWork): Promise<ResultStream>;
|
|
@@ -2020,10 +2029,12 @@ declare const PIPELINE_PATH = "/api/v1/pipeline";
|
|
|
2020
2029
|
declare const SUBPROTOCOL = "eyepop.v1";
|
|
2021
2030
|
/** A socket may have this many open sources; one more is answered `queue_full`. */
|
|
2022
2031
|
declare const MAX_OPEN_SOURCES = 256;
|
|
2032
|
+
/** The most sockets an endpoint opens unless `pipelineSockets` says otherwise. */
|
|
2033
|
+
declare const PIPELINE_SOCKETS = 4;
|
|
2023
2034
|
/** Uploads up to this size go as one combined message, larger ones in chunks. */
|
|
2024
2035
|
declare const COMBINED_UPLOAD_MAX_BYTES: number;
|
|
2025
2036
|
/** Why pipeline mode refused its configuration. */
|
|
2026
|
-
type PipelineConfigurationProblem = 'session_options' | 'job_queue_length' | 'no_pipeline_api_url' | 'insecure_url';
|
|
2037
|
+
type PipelineConfigurationProblem = 'session_options' | 'job_queue_length' | 'pipeline_sockets' | 'no_pipeline_api_url' | 'insecure_url';
|
|
2027
2038
|
/** Pipeline mode cannot run as configured; `options` names the refused options for `session_options`. */
|
|
2028
2039
|
declare class PipelineConfigurationError extends Error {
|
|
2029
2040
|
readonly problem: PipelineConfigurationProblem;
|
|
@@ -2075,6 +2086,7 @@ declare class OpenSource {
|
|
|
2075
2086
|
readonly id: string;
|
|
2076
2087
|
readonly inbox: Inbox<InboxItem>;
|
|
2077
2088
|
readonly uploads: Map<number | null, Credit>;
|
|
2089
|
+
endedBefore: number;
|
|
2078
2090
|
constructor(id: string);
|
|
2079
2091
|
close(error: Error): void;
|
|
2080
2092
|
}
|
|
@@ -2083,6 +2095,7 @@ interface Media {
|
|
|
2083
2095
|
readonly open: () => Promise<UploadBody$1>;
|
|
2084
2096
|
readonly contentType: string;
|
|
2085
2097
|
readonly size: number | undefined;
|
|
2098
|
+
readonly once?: boolean;
|
|
2086
2099
|
}
|
|
2087
2100
|
/** A job: one source on the endpoint's socket, its predictions read as an async iterable. */
|
|
2088
2101
|
declare class PipelineJob implements ResultStream {
|
|
@@ -2094,6 +2107,8 @@ declare class PipelineJob implements ResultStream {
|
|
|
2094
2107
|
private readonly _results;
|
|
2095
2108
|
private _consumed;
|
|
2096
2109
|
private _cancelled;
|
|
2110
|
+
private _markCancelled;
|
|
2111
|
+
readonly whenCancelled: Promise<void>;
|
|
2097
2112
|
openSource: OpenSource | null;
|
|
2098
2113
|
stopOnPipeline: (() => void) | null;
|
|
2099
2114
|
constructor(source: Message, media: Media[], live: boolean, params: ProcessParams, mediaStream?: MediaStream | undefined);
|
|
@@ -2104,18 +2119,23 @@ declare class PipelineJob implements ResultStream {
|
|
|
2104
2119
|
cancel(): void;
|
|
2105
2120
|
[Symbol.asyncIterator](): AsyncIterator<Prediction>;
|
|
2106
2121
|
}
|
|
2107
|
-
/**
|
|
2122
|
+
/**
|
|
2123
|
+
* Runs jobs on up to `pipelineSockets` sockets to the pipeline API; connecting opens the first. A
|
|
2124
|
+
* socket's pipeline plays its sources one after another, so a batch on one socket leaves the GPU
|
|
2125
|
+
* mostly idle. While every open socket has a source and fewer than `pipelineSockets` are open, the next
|
|
2126
|
+
* job opens another; each job goes on the socket that has room and the fewest open sources.
|
|
2127
|
+
*/
|
|
2108
2128
|
declare class PipelineBackend implements WorkerBackend {
|
|
2109
2129
|
private readonly ctx;
|
|
2110
2130
|
private _pipelineApiUrl;
|
|
2111
|
-
private
|
|
2131
|
+
private _sockets;
|
|
2112
2132
|
private _connecting;
|
|
2113
2133
|
private _sendChain;
|
|
2114
2134
|
private _disconnecting;
|
|
2115
2135
|
private _nextId;
|
|
2116
2136
|
private _currentPop;
|
|
2117
2137
|
private readonly _warned;
|
|
2118
|
-
private
|
|
2138
|
+
private _noExtraSocketUntil;
|
|
2119
2139
|
private _reconnects;
|
|
2120
2140
|
constructor(ctx: WorkerContext);
|
|
2121
2141
|
reconnect(): Promise<void>;
|
|
@@ -2124,8 +2144,17 @@ declare class PipelineBackend implements WorkerBackend {
|
|
|
2124
2144
|
popName(): string | null;
|
|
2125
2145
|
authorizationHeader(): Promise<string>;
|
|
2126
2146
|
private inOrder;
|
|
2127
|
-
|
|
2147
|
+
private openSockets;
|
|
2148
|
+
/** An open socket, or a new one with the last pop set on it. */
|
|
2128
2149
|
private ensureSocket;
|
|
2150
|
+
/**
|
|
2151
|
+
* The socket for the next job; the caller runs it in submission order. A live job goes on a socket
|
|
2152
|
+
* of its own, an idle one or a new one, which `pipelineSockets` does not count. Any other job skips
|
|
2153
|
+
* the sockets with a live source: a new one while every other socket has a source and fewer than
|
|
2154
|
+
* `pipelineSockets` are open, else the one with room and the fewest sources.
|
|
2155
|
+
*/
|
|
2156
|
+
private socketForJob;
|
|
2157
|
+
/** A new socket with the last pop set on it; `patient` waits through 503 with Retry-After. */
|
|
2129
2158
|
private openSocket;
|
|
2130
2159
|
private startHeartbeat;
|
|
2131
2160
|
private socketUrl;
|
|
@@ -2139,7 +2168,11 @@ declare class PipelineBackend implements WorkerBackend {
|
|
|
2139
2168
|
/** Send a command that is answered by `result` or `error` under its id. */
|
|
2140
2169
|
private command;
|
|
2141
2170
|
pop(): Pop | null;
|
|
2142
|
-
/**
|
|
2171
|
+
/**
|
|
2172
|
+
* Set the pop on every open socket's pipeline; a pop the first refuses rejects, and the last pop it
|
|
2173
|
+
* took stays. shortcut: a refusal from a later socket, which the first took, leaves the earlier ones
|
|
2174
|
+
* on the new pop; a refusal is the pop's own fault, so every socket answers it alike.
|
|
2175
|
+
*/
|
|
2143
2176
|
changePop(pop: Pop): Promise<void>;
|
|
2144
2177
|
private setPopOn;
|
|
2145
2178
|
submit(work: WorkerWork): Promise<ResultStream>;
|
|
@@ -2147,11 +2180,16 @@ declare class PipelineBackend implements WorkerBackend {
|
|
|
2147
2180
|
private jobOf;
|
|
2148
2181
|
private sourceJob;
|
|
2149
2182
|
private pathMedia;
|
|
2150
|
-
/**
|
|
2183
|
+
/**
|
|
2184
|
+
* Run the job's source to its end. A live source refused overloaded goes once more on a new socket.
|
|
2185
|
+
* A source refused queue_full goes again once another source on the socket ended, so it may go after
|
|
2186
|
+
* jobs submitted later; with none of the endpoint's other sources open there, or with an upload from
|
|
2187
|
+
* the caller's own stream, which cannot be read twice, the refusal stands.
|
|
2188
|
+
*/
|
|
2151
2189
|
private run;
|
|
2152
2190
|
/** Send the job's setSource; the caller runs it in submission order. */
|
|
2153
2191
|
private setSource;
|
|
2154
|
-
/** Hand the source's predictions to the job until it ends;
|
|
2192
|
+
/** Hand the source's predictions to the job until it ends; the refusal to retry on, overloaded or queue_full. */
|
|
2155
2193
|
private follow;
|
|
2156
2194
|
/** Send each upload member's bytes in chunks within its credit, then its uploaded. */
|
|
2157
2195
|
private upload;
|
|
@@ -2287,4 +2325,4 @@ declare namespace EyePop {
|
|
|
2287
2325
|
function dataEndpoint(opts?: DataOptions): DataEndpoint;
|
|
2288
2326
|
}
|
|
2289
2327
|
|
|
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 };
|
|
2328
|
+
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 };
|