Skip to content

armgit / hypit

Public Imported from GitHub
0

Clone any viral video with AI agents. Not just a script, the whole workflow: swap the face, the words, the B-roll, ship 100 variants in one command, and get your 100M views.

fix: keep HypiHub audio opt-in

rpone89a04d3a2b84
diff --git a/packages/provider-hypihub/README.md b/packages/provider-hypihub/README.md
index c441a7ba..656f1a49 100644
--- a/packages/provider-hypihub/README.md
+++ b/packages/provider-hypihub/README.md
@@ -39,5 +39,7 @@ Artifacts are uploaded automatically through `POST /v1/files`, then their return
URLs are used in image and video requests. Uploads are deduplicated by Artifact digest within one
Runtime operation. Embedded callers may override that transport with `publicAssetUrl`.
-Set `audio: false` when official `@hypit/provider-xiaomi-mimo` should own MiMo audio capabilities;
-one Runtime can then use HypiHub for image/video and the official MiMo endpoint for audio.
+HypiHub audio capabilities are disabled by default because a HypiHub key may not include the MiMo
+audio models. Set `audio: true` only when that key explicitly has them enabled. The usual setup keeps
+official `@hypit/provider-xiaomi-mimo` as the audio endpoint, so one Runtime uses HypiHub for
+image/video and official MiMo for audio.
diff --git a/packages/provider-hypihub/package.json b/packages/provider-hypihub/package.json
index 5e52fc3b..138fbb4d 100644
--- a/packages/provider-hypihub/package.json
+++ b/packages/provider-hypihub/package.json
@@ -15,6 +15,7 @@
},
"devDependencies": {
"@hypit/driver-node": "workspace:*",
+ "@hypit/mimo-tts": "workspace:*",
"@hypit/seedance": "workspace:*"
}
}
diff --git a/packages/provider-hypihub/src/provider.ts b/packages/provider-hypihub/src/provider.ts
index 34a274f8..b8d158cf 100644
--- a/packages/provider-hypihub/src/provider.ts
+++ b/packages/provider-hypihub/src/provider.ts
@@ -223,7 +223,10 @@ export function createHypiHubProvider(options: CreateHypiHubProviderOptions = {}
module: hypiHubProviderModuleRef, facet: "gateway", instance: options.instance ?? "hypihub.default", pool: options.pool ?? options.instance ?? "hypihub.default",
credentials: { apiKey: options.apiKey ?? credentialRef("env", "HYPIHUB_API_KEY") }, credentialInputs: { apiKey: { label: "HypiHub API key" } }, defaultConcurrency: options.defaultConcurrency ?? 4,
capabilities: hypiHubRoutes
- .filter((route) => options.audio !== false || route.media !== "audio")
+ // HypiHub keys do not necessarily include the MiMo audio models. Keep
+ // official Xiaomi MiMo as the safe default; opting into HypiHub audio is
+ // an explicit Runtime decision for a key that actually has those models.
+ .filter((route) => options.audio === true || route.media !== "audio")
.map((route) => route.media === "audio"
? { capability: route.capability, returns: route.returns, lifecycle: "immediate" as const, handler: audioEndpoint, lane: route.capability.name }
: { capability: route.capability, returns: route.returns, lifecycle: "asynchronous" as const, endpoint: asyncEndpoint, lane: route.capability.name }),
diff --git a/packages/provider-hypihub/test/provider.test.ts b/packages/provider-hypihub/test/provider.test.ts
index f8db4800..f273b6b9 100644
--- a/packages/provider-hypihub/test/provider.test.ts
+++ b/packages/provider-hypihub/test/provider.test.ts
@@ -4,6 +4,7 @@ import test from "node:test";
import { EndpointRegistry, MemoryArtifactStore } from "@hypit/driver-node";
import type { AsyncEndpoint } from "@hypit/endpoint-kit";
import type { CanonicalValue, Need } from "@hypit/protocol";
+import { mimoTtsEndpoints } from "@hypit/mimo-tts";
import { sealSeedanceRequest, seedanceEndpoints } from "@hypit/seedance";
import { createHypiHubProvider } from "../src/provider.js";
@@ -27,6 +28,28 @@ async function endpointFor(request: Need, fetch: typeof globalThis.fetch): Promi
return resolution.registration.endpoint;
}
+test("HypiHub keeps audio opt-in so official MiMo can own the default audio routes", async () => {
+ const registry = new EndpointRegistry();
+ await createHypiHubProvider({ fetch: async () => { throw new Error("audio must not call fetch"); } }).install(registry);
+ assert.equal(registry.resolve({
+ id: "need:hypihub-audio-default",
+ capability: mimoTtsEndpoints.preset.capability,
+ returns: mimoTtsEndpoints.preset.returns,
+ constraints: { ports: {} },
+ result: "record:hypihub-audio-default",
+ }).status, "missing");
+
+ const optedIn = new EndpointRegistry();
+ await createHypiHubProvider({ audio: true, fetch: async () => { throw new Error("not reached"); } }).install(optedIn);
+ assert.equal(optedIn.resolve({
+ id: "need:hypihub-audio-opt-in",
+ capability: mimoTtsEndpoints.preset.capability,
+ returns: mimoTtsEndpoints.preset.returns,
+ constraints: { ports: {} },
+ result: "record:hypihub-audio-opt-in",
+ }).status, "resolved");
+});
+
test("HypiHub uploads referenced Artifacts once, submits their HTTPS URLs, and persists the result", async () => {
const artifacts = new MemoryArtifactStore();
const reference = await artifacts.put(new Uint8Array([1, 2, 3]), "image/png");
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 427b8fd4..c2f8a6f2 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1964,6 +1964,9 @@ importers:
'@hypit/driver-node':
specifier: workspace:*
version: link:../driver-node
+ '@hypit/mimo-tts':
+ specifier: workspace:*
+ version: link:../mimo-tts
'@hypit/seedance':
specifier: workspace:*
version: link:../seedance