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.

test(provider): follow package version in user agent

kashorinff7582a3ff5f
diff --git a/packages/provider-hypihub/test/provider.test.ts b/packages/provider-hypihub/test/provider.test.ts
index 8ce61580..d91dfb71 100644
--- a/packages/provider-hypihub/test/provider.test.ts
+++ b/packages/provider-hypihub/test/provider.test.ts
@@ -1,4 +1,5 @@
import assert from "node:assert/strict";
+import { readFileSync } from "node:fs";
import test from "node:test";
import { encodeOAuth2Credential } from "@hypit/runtime";
@@ -18,6 +19,10 @@ import { portraitMattingEndpoint, sealPortraitMattingRequest } from "@hypit/volc
import { createHypiHubProvider, diagnoseHypiHubProvider } from "../src/provider.js";
+const packageVersion = (JSON.parse(
+ readFileSync(new URL("../package.json", import.meta.url), "utf8"),
+) as { readonly version: string }).version;
+
function need(constraints: CanonicalValue): Need {
return {
id: "need:hypihub-test",
@@ -239,7 +244,7 @@ test("HypiHub returns its current model-pricing document", async () => {
assert.equal(String(input), "https://hypit.ai/v1/pricing?model=seedance-2");
assert.equal((init?.headers as Record<string, string>).authorization, "Bearer test-key");
assert.equal((init?.headers as Record<string, string>)["user-agent"],
- "hypit-provider-hypihub/0.1.0");
+ `hypit-provider-hypihub/${packageVersion}`);
return Response.json({
object: "model_pricing",
model: "seedance-2",