@eyepop.ai/eyepop 3.15.1 → 3.16.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/README.md CHANGED
@@ -56,18 +56,18 @@ For provisioned persistent worker sessions, also set `EYEPOP_SESSION_UUID`.
56
56
  import { EyePop } from '@eyepop.ai/eyepop'
57
57
 
58
58
  ;(async () => {
59
- const endpoint = await EyePop.workerEndpoint().connect()
60
- try {
61
- await endpoint.changePop({
59
+ const endpoint = await EyePop.workerEndpoint({
60
+ pop: {
62
61
  components: [
63
62
  {
64
63
  type: 'inference',
65
- model: 'eyepop.person:latest',
64
+ ability: 'eyepop.person:latest',
66
65
  categoryName: 'person',
67
66
  },
68
67
  ],
69
- })
70
-
68
+ },
69
+ }).connect()
70
+ try {
71
71
  const results = await endpoint.process({ source: { path: 'examples/example.jpg' } })
72
72
  for await (const result of results) {
73
73
  console.log(result)
@@ -78,6 +78,8 @@ import { EyePop } from '@eyepop.ai/eyepop'
78
78
  })()
79
79
  ```
80
80
 
81
+ For transient sessions, pass `pop` when creating the endpoint whenever possible. Use `endpoint.changePop(pop)` only when an already connected transient worker needs to switch Pops.
82
+
81
83
  You can also pass the key explicitly from server-side configuration:
82
84
 
83
85
  ```typescript
@@ -133,7 +135,7 @@ Dashboard users can run local browser demos with the current browser session:
133
135
  components: [
134
136
  {
135
137
  type: 'inference',
136
- model: 'eyepop.person:latest',
138
+ ability: 'eyepop.person:latest',
137
139
  categoryName: 'person',
138
140
  },
139
141
  ],
@@ -735,8 +735,15 @@ declare enum PredictionVersion {
735
735
  }
736
736
  declare const DEFAULT_PREDICTION_VERSION: PredictionVersion;
737
737
  interface WorkerSession extends Session {
738
+ /**
739
+ * @deprecated Pop ids are only retained for backwards compatibility.
740
+ * Configure transient sessions with `WorkerOptions.pop`.
741
+ */
738
742
  readonly popId: string;
739
743
  readonly baseUrl: string | undefined;
744
+ /**
745
+ * Transient sessions may not have a pipeline until the first source is processed.
746
+ */
740
747
  readonly pipelineId: string | undefined;
741
748
  authenticationHeaders(): any;
742
749
  }
@@ -1068,15 +1075,25 @@ declare class Endpoint<T extends Endpoint<T>> {
1068
1075
  private currentAccessToken;
1069
1076
  }
1070
1077
 
1078
+ /**
1079
+ * @deprecated Configure transient sessions with `WorkerOptions.pop`.
1080
+ * Support for pop id will be removed in 3.16.
1081
+ */
1071
1082
  declare enum TransientPopId {
1072
1083
  Transient = "transient"
1073
1084
  }
1074
1085
  interface WorkerOptions extends Options {
1075
1086
  /**
1076
- * TODO: deprecated, support for pop id will be removed in 3.16
1087
+ * @deprecated Pass `pop` for transient sessions or `sessionUuid` for persistent sessions.
1088
+ * Support for pop id will be removed in 3.16.
1077
1089
  */
1078
1090
  popId?: string | TransientPopId | undefined;
1079
1091
  sessionUuid?: string | undefined;
1092
+ sessionName?: string | undefined;
1093
+ pipelineImage?: string | undefined;
1094
+ pipelineVersion?: string | undefined;
1095
+ pop?: Pop | undefined;
1096
+ sessionReadyTimeoutSeconds?: number | undefined;
1080
1097
  autoStart?: boolean;
1081
1098
  stopJobs?: boolean;
1082
1099
  isLocalMode?: boolean;
@@ -1092,13 +1109,17 @@ declare enum SessionStatus {
1092
1109
  PIPELINE_CREATING = "pipeline_creating",
1093
1110
  PIPELINE_OK = "pipeline_ok",
1094
1111
  PIPELINE_CHECKING = "pipeline_checking",
1095
- PIPELINE_ERROR = "pipeline_error"
1112
+ PIPELINE_ERROR = "pipeline_error",
1113
+ UPGRADING = "upgrading"
1096
1114
  }
1097
1115
  declare class WorkerEndpoint extends Endpoint<WorkerEndpoint> {
1098
1116
  private _baseUrl;
1099
1117
  private _pipelineId;
1100
1118
  private _popName;
1119
+ private _sessionAccessToken;
1120
+ private _sessionAccessTokenValidUntil;
1101
1121
  private _pipeline;
1122
+ private _pipelineCreatePromise;
1102
1123
  constructor(options: WorkerOptions);
1103
1124
  private options;
1104
1125
  disconnect(wait?: boolean): Promise<void>;
@@ -1108,6 +1129,10 @@ declare class WorkerEndpoint extends Endpoint<WorkerEndpoint> {
1108
1129
  pop(): Pop | null;
1109
1130
  changePop(pop: Pop): Promise<void>;
1110
1131
  private _authenticationHeaders;
1132
+ /**
1133
+ * @deprecated Pop ids are only retained for backwards compatibility.
1134
+ * Configure transient sessions with `WorkerOptions.pop`.
1135
+ */
1111
1136
  popId(): string | null;
1112
1137
  /**
1113
1138
  * V1 call to process media as a source with optional component params
@@ -1141,10 +1166,21 @@ declare class WorkerEndpoint extends Endpoint<WorkerEndpoint> {
1141
1166
  private static SESSION_DEAD;
1142
1167
  private static WAIT_FOR_IS_READY;
1143
1168
  private static CHECK_FOR_IS_READY_INTERVAL;
1169
+ private sessionReadyTimeoutMs;
1170
+ private sessionHealthReady;
1144
1171
  private getComputeSession;
1145
1172
  private getOnDemandComputeSession;
1146
1173
  private getPermanentComputeSession;
1147
1174
  private startTransientPipeline;
1175
+ private ensureTransientPipelineStarted;
1176
+ private changeTransientPop;
1177
+ private deleteTransientPipeline;
1178
+ private pipelineIdFromSession;
1179
+ protected authorizationHeader(): Promise<string>;
1180
+ private computeAuthorizationHeader;
1181
+ private setComputeSessionAccessToken;
1182
+ private setTransientPipelinePop;
1183
+ private sessionCreateBody;
1148
1184
  }
1149
1185
 
1150
1186
  interface DataOptions extends Options {
@@ -735,8 +735,15 @@ declare enum PredictionVersion {
735
735
  }
736
736
  declare const DEFAULT_PREDICTION_VERSION: PredictionVersion;
737
737
  interface WorkerSession extends Session {
738
+ /**
739
+ * @deprecated Pop ids are only retained for backwards compatibility.
740
+ * Configure transient sessions with `WorkerOptions.pop`.
741
+ */
738
742
  readonly popId: string;
739
743
  readonly baseUrl: string | undefined;
744
+ /**
745
+ * Transient sessions may not have a pipeline until the first source is processed.
746
+ */
740
747
  readonly pipelineId: string | undefined;
741
748
  authenticationHeaders(): any;
742
749
  }
@@ -1068,15 +1075,25 @@ declare class Endpoint<T extends Endpoint<T>> {
1068
1075
  private currentAccessToken;
1069
1076
  }
1070
1077
 
1078
+ /**
1079
+ * @deprecated Configure transient sessions with `WorkerOptions.pop`.
1080
+ * Support for pop id will be removed in 3.16.
1081
+ */
1071
1082
  declare enum TransientPopId {
1072
1083
  Transient = "transient"
1073
1084
  }
1074
1085
  interface WorkerOptions extends Options {
1075
1086
  /**
1076
- * TODO: deprecated, support for pop id will be removed in 3.16
1087
+ * @deprecated Pass `pop` for transient sessions or `sessionUuid` for persistent sessions.
1088
+ * Support for pop id will be removed in 3.16.
1077
1089
  */
1078
1090
  popId?: string | TransientPopId | undefined;
1079
1091
  sessionUuid?: string | undefined;
1092
+ sessionName?: string | undefined;
1093
+ pipelineImage?: string | undefined;
1094
+ pipelineVersion?: string | undefined;
1095
+ pop?: Pop | undefined;
1096
+ sessionReadyTimeoutSeconds?: number | undefined;
1080
1097
  autoStart?: boolean;
1081
1098
  stopJobs?: boolean;
1082
1099
  isLocalMode?: boolean;
@@ -1092,13 +1109,17 @@ declare enum SessionStatus {
1092
1109
  PIPELINE_CREATING = "pipeline_creating",
1093
1110
  PIPELINE_OK = "pipeline_ok",
1094
1111
  PIPELINE_CHECKING = "pipeline_checking",
1095
- PIPELINE_ERROR = "pipeline_error"
1112
+ PIPELINE_ERROR = "pipeline_error",
1113
+ UPGRADING = "upgrading"
1096
1114
  }
1097
1115
  declare class WorkerEndpoint extends Endpoint<WorkerEndpoint> {
1098
1116
  private _baseUrl;
1099
1117
  private _pipelineId;
1100
1118
  private _popName;
1119
+ private _sessionAccessToken;
1120
+ private _sessionAccessTokenValidUntil;
1101
1121
  private _pipeline;
1122
+ private _pipelineCreatePromise;
1102
1123
  constructor(options: WorkerOptions);
1103
1124
  private options;
1104
1125
  disconnect(wait?: boolean): Promise<void>;
@@ -1108,6 +1129,10 @@ declare class WorkerEndpoint extends Endpoint<WorkerEndpoint> {
1108
1129
  pop(): Pop | null;
1109
1130
  changePop(pop: Pop): Promise<void>;
1110
1131
  private _authenticationHeaders;
1132
+ /**
1133
+ * @deprecated Pop ids are only retained for backwards compatibility.
1134
+ * Configure transient sessions with `WorkerOptions.pop`.
1135
+ */
1111
1136
  popId(): string | null;
1112
1137
  /**
1113
1138
  * V1 call to process media as a source with optional component params
@@ -1141,10 +1166,21 @@ declare class WorkerEndpoint extends Endpoint<WorkerEndpoint> {
1141
1166
  private static SESSION_DEAD;
1142
1167
  private static WAIT_FOR_IS_READY;
1143
1168
  private static CHECK_FOR_IS_READY_INTERVAL;
1169
+ private sessionReadyTimeoutMs;
1170
+ private sessionHealthReady;
1144
1171
  private getComputeSession;
1145
1172
  private getOnDemandComputeSession;
1146
1173
  private getPermanentComputeSession;
1147
1174
  private startTransientPipeline;
1175
+ private ensureTransientPipelineStarted;
1176
+ private changeTransientPop;
1177
+ private deleteTransientPipeline;
1178
+ private pipelineIdFromSession;
1179
+ protected authorizationHeader(): Promise<string>;
1180
+ private computeAuthorizationHeader;
1181
+ private setComputeSessionAccessToken;
1182
+ private setTransientPipelinePop;
1183
+ private sessionCreateBody;
1148
1184
  }
1149
1185
 
1150
1186
  interface DataOptions extends Options {