@hypit/hypit 0.2.10 → 0.2.11
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 +8 -4
- package/package.json +1 -1
- package/packages/pixverse/README.md +1 -1
- package/packages/pixverse/src/index.ts +2 -2
- package/packages/provider-beatapi/src/provider.ts +7 -1
- package/packages/provider-hiapi/src/provider.ts +7 -1
- package/packages/provider-hypihub/src/provider.ts +8 -1
- package/packages/provider-monid/src/provider.ts +7 -1
- package/packages/provider-pollo/src/provider.ts +7 -1
- package/packages/provider-tokendance/src/provider.ts +8 -1
package/README.md
CHANGED
|
@@ -17,7 +17,11 @@
|
|
|
17
17
|
|
|
18
18
|
<p align="center">
|
|
19
19
|
<a href="https://trendshift.io/repositories/229030"><img alt="Trendshift #1 Repository of the Day" src="https://trendshift.io/api/badge/trendshift/repositories/229030/daily"></a>
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
<p align="center">
|
|
20
23
|
<a href="https://trendshift.io/repositories/229030"><img alt="Trendshift #1 TypeScript Repository of the Day" src="https://trendshift.io/api/badge/trendshift/repositories/229030/daily?language=TypeScript"></a>
|
|
24
|
+
<a href="https://trendshift.io/repositories/229030?utm_source=trendshift-badge&utm_medium=badge&utm_campaign=badge-trendshift-229030" target="_blank" rel="noopener noreferrer"><img src="https://trendshift.io/api/badge/trendshift/repositories/229030/weekly?language=TypeScript" alt="hypit-ai/hypit | Trendshift TypeScript Weekly" width="250" height="55"></a>
|
|
21
25
|
</p>
|
|
22
26
|
|
|
23
27
|
<p align="center">
|
|
@@ -154,14 +158,14 @@ commands and the repository layout.
|
|
|
154
158
|
<table>
|
|
155
159
|
<tr>
|
|
156
160
|
<td width="220" align="center">
|
|
157
|
-
<a href="https://watcha.cn">
|
|
161
|
+
<a href="https://watcha.cn/r/geIiJJ">
|
|
158
162
|
<picture>
|
|
159
163
|
<source media="(prefers-color-scheme: dark)" srcset="./docs/public/watcha-dark.png">
|
|
160
164
|
<img alt="Watcha" src="./docs/public/watcha-light.png" width="170">
|
|
161
165
|
</picture>
|
|
162
166
|
</a>
|
|
163
167
|
</td>
|
|
164
|
-
<td><a href="https://watcha.cn">Watcha</a> is an innovative ecosystem and community built for AI builders, connecting great products with high-quality users to turn every Demo into reality. Starting from AI product discovery and genuine feedback, Watcha provides product publishing, distribution, and reputation tracking to support builders from launch to early adoption.</td>
|
|
168
|
+
<td><a href="https://watcha.cn/r/geIiJJ">Watcha</a> is an innovative ecosystem and community built for AI builders, connecting great products with high-quality users to turn every Demo into reality. Starting from AI product discovery and genuine feedback, Watcha provides product publishing, distribution, and reputation tracking to support builders from launch to early adoption.</td>
|
|
165
169
|
</tr>
|
|
166
170
|
<tr>
|
|
167
171
|
<td width="220" align="center">
|
|
@@ -211,9 +215,9 @@ commands and the repository layout.
|
|
|
211
215
|
</tr>
|
|
212
216
|
<tr>
|
|
213
217
|
<td width="220" align="center">
|
|
214
|
-
<a href="https://beatapi.io"><img alt="BeatAPI" src="./docs/public/beatapi.png" width="165"></a>
|
|
218
|
+
<a href="https://beatapi.io/sign-up?aff=hypit"><img alt="BeatAPI" src="./docs/public/beatapi.png" width="165"></a>
|
|
215
219
|
</td>
|
|
216
|
-
<td><a href="https://beatapi.io">BeatAPI</a> is the professional capability layer for any agent. We provide AI models, real-world data, task-ready capabilities, and professional workspaces that help agents complete real-world tasks.</td>
|
|
220
|
+
<td><a href="https://beatapi.io/sign-up?aff=hypit">BeatAPI</a> is the professional capability layer for any agent. We provide AI models, real-world data, task-ready capabilities, and professional workspaces that help agents complete real-world tasks.</td>
|
|
217
221
|
</tr>
|
|
218
222
|
</table>
|
|
219
223
|
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ Exact author/compute contracts and package-owned author Surfaces for PixVerse. T
|
|
|
4
4
|
two exact models, `pixverse-v6` and `pixverse-c1`, and selects no Provider, API key or network
|
|
5
5
|
execution. The selected Provider implements the exact capability.
|
|
6
6
|
|
|
7
|
-
Both models render 1 to 15 seconds at `
|
|
7
|
+
Both models render 1 to 15 seconds at `540p` or `720p` from a prompt of up to
|
|
8
8
|
5,000 characters. `<pix:Video>` generates from the prompt, from a first frame, or from a first and
|
|
9
9
|
last frame; `<pix:ReferenceVideo>` generates from the image and video subjects its `Reference`
|
|
10
10
|
children carry.
|
|
@@ -17,7 +17,7 @@ export const pixverseModuleRef = { name: "@hypit/pixverse", version: "1" } as co
|
|
|
17
17
|
export const pixverseModels = ["pixverse-v6", "pixverse-c1"] as const;
|
|
18
18
|
export type PixverseModel = typeof pixverseModels[number];
|
|
19
19
|
|
|
20
|
-
const PIXVERSE_QUALITIES = ["
|
|
20
|
+
const PIXVERSE_QUALITIES = ["540p", "720p"] as const;
|
|
21
21
|
const PIXVERSE_ASPECT_RATIOS = ["16:9", "4:3", "1:1", "3:4", "9:16", "2:3", "3:2", "21:9"] as const;
|
|
22
22
|
/** V6 reads `auto` as the shape of the reference videos it generates from. */
|
|
23
23
|
const PIXVERSE_V6_ASPECT_RATIOS = [...PIXVERSE_ASPECT_RATIOS, "auto"] as const;
|
|
@@ -142,7 +142,7 @@ const pixverseVideoPort: readonly SurfacePortVocabulary[] = [{
|
|
|
142
142
|
summary: "The generated video, addressed as `<id>.video`.",
|
|
143
143
|
}];
|
|
144
144
|
|
|
145
|
-
const pixverseQualityNote = "`quality` is `
|
|
145
|
+
const pixverseQualityNote = "`quality` is `540p` or `720p`, and `duration` is 1 to 15 seconds.";
|
|
146
146
|
const pixversePromptNote = "A spoken line belongs in the prompt; the model exposes no separate voice, language or dialogue field.";
|
|
147
147
|
const pixverseModelNote = "V6 accepts `seed` and up to ten references; C1 accepts up to seven references.";
|
|
148
148
|
|
|
@@ -181,7 +181,13 @@ function endpoint(client: BeatApiClient, pollIntervalMs: number, maxOperationMs:
|
|
|
181
181
|
if (Date.now() - handle.startedAt > maxOperationMs) {
|
|
182
182
|
return { status: "failed", receipt, failure: { code: "BEATAPI_OPERATION_TIMEOUT", message: `BeatAPI task ${handle.taskId} exceeded this Provider's operationTimeoutMs (${maxOperationMs}); remote outcome is unknown` } };
|
|
183
183
|
}
|
|
184
|
-
|
|
184
|
+
let task: Record<string, unknown>;
|
|
185
|
+
try {
|
|
186
|
+
task = await client.json(`/v1/tasks/${encodeURIComponent(handle.taskId)}`, apiKey(context.credentials));
|
|
187
|
+
} catch (error) {
|
|
188
|
+
if (error instanceof BeatApiHttpError && error.status < 500) return { ...failure(error), receipt };
|
|
189
|
+
return { ...wakeAfter(canonicalize(handle), pollIntervalMs, Date.now(), { phase: "retrying" }), receipt };
|
|
190
|
+
}
|
|
185
191
|
const status = String(task.status);
|
|
186
192
|
if (pendingStatuses.includes(status)) {
|
|
187
193
|
return { ...wakeAfter(canonicalize(handle), pollIntervalMs, Date.now(), { phase: status }), receipt };
|
|
@@ -155,7 +155,13 @@ function endpoint(client: HiApiClient, pollIntervalMs: number, maxOperationMs: n
|
|
|
155
155
|
if (Date.now() - handle.startedAt > maxOperationMs) {
|
|
156
156
|
return { status: "failed", receipt, failure: { code: "HIAPI_OPERATION_TIMEOUT", message: `HiAPI task ${handle.taskId} exceeded this Provider's operationTimeoutMs (${maxOperationMs}); remote outcome is unknown` } };
|
|
157
157
|
}
|
|
158
|
-
|
|
158
|
+
let task: Record<string, unknown>;
|
|
159
|
+
try {
|
|
160
|
+
task = await client.json(`/v1/tasks/${encodeURIComponent(handle.taskId)}`, apiKey(context.credentials));
|
|
161
|
+
} catch (error) {
|
|
162
|
+
if (error instanceof HiApiHttpError && error.status < 500) return { ...failure(error), receipt };
|
|
163
|
+
return { ...wakeAfter(canonicalize(handle), pollIntervalMs, Date.now(), { phase: "retrying" }), receipt };
|
|
164
|
+
}
|
|
159
165
|
const status = String(task.status);
|
|
160
166
|
if (status === "queued" || status === "handling" || status === "archiving") {
|
|
161
167
|
return { ...wakeAfter(canonicalize(handle), pollIntervalMs, Date.now(), { phase: status }), receipt };
|
|
@@ -494,7 +494,14 @@ function endpoint(client: HypiHubClient, pollIntervalMs: number, maxOperationMs:
|
|
|
494
494
|
receipt: { id: handle.jobId },
|
|
495
495
|
failure: { code: "HYPIHUB_OPERATION_TIMEOUT", message: `HypiHub job ${handle.jobId} exceeded this Provider's operationTimeoutMs (${maxOperationMs}); remote outcome is unknown` } };
|
|
496
496
|
}
|
|
497
|
-
|
|
497
|
+
let job: Record<string, unknown>;
|
|
498
|
+
try {
|
|
499
|
+
job = await client.json(`/jobs/${encodeURIComponent(handle.jobId)}`, authFor(context, client));
|
|
500
|
+
} catch (error) {
|
|
501
|
+
if (error instanceof HypiHubHttpError && error.status < 500) return failure(error);
|
|
502
|
+
return wakeAfter(canonicalize(handle), pollIntervalMs, Date.now(), { phase: "retrying" });
|
|
503
|
+
}
|
|
504
|
+
const status = job.status;
|
|
498
505
|
if (status === "queued" || status === "running" || status === "in_progress") return wakeAfter(canonicalize(handle), pollIntervalMs, Date.now(), { phase: String(status) });
|
|
499
506
|
const rejected = hypiHubJobFailure(job, handle.jobId);
|
|
500
507
|
if (rejected !== undefined) return { ...failure(rejected), receipt: { id: handle.jobId } };
|
|
@@ -202,7 +202,13 @@ function endpoint(client: MonidClient, pollIntervalMs: number, maxOperationMs: n
|
|
|
202
202
|
if (Date.now() - handle.startedAt > maxOperationMs) {
|
|
203
203
|
return { status: "failed", receipt, failure: { code: "MONID_OPERATION_TIMEOUT", message: `Monid run ${handle.runId} exceeded this Provider's operationTimeoutMs (${maxOperationMs}); remote outcome is unknown` } };
|
|
204
204
|
}
|
|
205
|
-
|
|
205
|
+
let run: Record<string, unknown>;
|
|
206
|
+
try {
|
|
207
|
+
run = await client.getRun(handle.runId, apiKey(context.credentials));
|
|
208
|
+
} catch (error) {
|
|
209
|
+
if (error instanceof MonidHttpError && error.status < 500) return { ...failure(error), receipt };
|
|
210
|
+
return { ...wakeAfter(canonicalize(handle), pollIntervalMs, Date.now(), { phase: "retrying" }), receipt };
|
|
211
|
+
}
|
|
206
212
|
const status = String(run.status);
|
|
207
213
|
if (!monidTerminalStatuses.includes(status as typeof monidTerminalStatuses[number])) {
|
|
208
214
|
return { ...wakeAfter(canonicalize(handle), pollIntervalMs, Date.now(), { phase: status }), receipt };
|
|
@@ -133,7 +133,13 @@ function endpoint(client: PolloClient, pollIntervalMs: number, maxOperationMs: n
|
|
|
133
133
|
if (Date.now() - handle.startedAt > maxOperationMs) {
|
|
134
134
|
return { status: "failed", receipt, failure: { code: "POLLO_OPERATION_TIMEOUT", message: `Pollo task ${handle.taskId} exceeded this Provider's operationTimeoutMs (${maxOperationMs}); remote outcome is unknown` } };
|
|
135
135
|
}
|
|
136
|
-
|
|
136
|
+
let task: Record<string, unknown>;
|
|
137
|
+
try {
|
|
138
|
+
task = await client.json(`/v1/generation/${encodeURIComponent(handle.taskId)}/status`, apiKey(context.credentials));
|
|
139
|
+
} catch (error) {
|
|
140
|
+
if (error instanceof PolloHttpError && error.status < 500) return { ...failure(error), receipt };
|
|
141
|
+
return { ...wakeAfter(canonicalize(handle), pollIntervalMs, Date.now(), { phase: "retrying" }), receipt };
|
|
142
|
+
}
|
|
137
143
|
assert(Array.isArray(task.generations) && task.generations.length > 0, "Pollo task has no generations");
|
|
138
144
|
const generations = task.generations.map((item, index) => object(item, `Pollo generation ${index + 1}`));
|
|
139
145
|
const rejected = polloTaskFailure(generations, handle.taskId);
|
|
@@ -208,7 +208,14 @@ function endpoint(client: TokenDanceClient, pollIntervalMs: number, maxOperation
|
|
|
208
208
|
if (Date.now() - handle.startedAt > maxOperationMs) {
|
|
209
209
|
return { status: "failed", receipt, failure: { code: "TOKENDANCE_OPERATION_TIMEOUT", message: `TokenDance task ${handle.taskId} exceeded this Provider's operationTimeoutMs (${maxOperationMs}); remote outcome is unknown` } };
|
|
210
210
|
}
|
|
211
|
-
|
|
211
|
+
let response: Record<string, unknown>;
|
|
212
|
+
try {
|
|
213
|
+
response = await client.json(paths[route.protocol].task(handle.taskId), apiKey(context.credentials));
|
|
214
|
+
} catch (error) {
|
|
215
|
+
if (error instanceof TokenDanceHttpError && error.status < 500) return { ...failure(error), receipt };
|
|
216
|
+
return { ...wakeAfter(canonicalize(handle), pollIntervalMs, Date.now(), { phase: "retrying" }), receipt };
|
|
217
|
+
}
|
|
218
|
+
const task = taskBody(route.protocol, response);
|
|
212
219
|
const status = String(task.status);
|
|
213
220
|
if (status === "queued" || status === "running") return { ...wakeAfter(canonicalize(handle), pollIntervalMs, Date.now(), { phase: status }), receipt };
|
|
214
221
|
const rejected = tokenDanceTaskFailure(task, handle.taskId);
|