@nebutra/audio-pipeline 0.1.1 → 0.1.3
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/CHANGELOG.md +25 -0
- package/LICENSE +21 -0
- package/package.json +18 -8
- package/.turbo/turbo-build.log +0 -22
- package/.turbo/turbo-test.log +0 -14
- package/.turbo/turbo-typecheck.log +0 -4
- package/examples/bgm.ts +0 -10
- package/examples/license.ts +0 -11
- package/examples/loudness.ts +0 -11
- package/src/cli.ts +0 -36
- package/src/index.test.ts +0 -33
- package/src/index.ts +0 -176
- package/tsconfig.json +0 -12
- package/tsup.config.ts +0 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @nebutra/audio-pipeline
|
|
2
2
|
|
|
3
|
+
## 0.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Ship the MIT LICENSE file these packages have always declared but never included.
|
|
8
|
+
|
|
9
|
+
Every one of these declares `"license": "MIT"` in its manifest, and npm shows
|
|
10
|
+
that on the registry page — but the tarball carried no licence text at all.
|
|
11
|
+
MIT's own terms require the notice to accompany "all copies or substantial
|
|
12
|
+
portions of the Software", so a consumer vendoring one of these packages had
|
|
13
|
+
nothing to comply with.
|
|
14
|
+
|
|
15
|
+
No code changes. This is the licence text only, published so the tarballs
|
|
16
|
+
match what the manifests have been claiming.
|
|
17
|
+
|
|
18
|
+
`tests/architecture/release-surface.test.ts` now asserts the LICENSE _file_
|
|
19
|
+
exists and is MIT, not just the manifest _field_ — the field-only check is how
|
|
20
|
+
this went unnoticed, and is also how `create-sailor` shipped the full AGPL-3.0
|
|
21
|
+
text under an MIT declaration for its entire published history.
|
|
22
|
+
|
|
23
|
+
- Updated dependencies []:
|
|
24
|
+
- @nebutra/generation-context@0.1.2
|
|
25
|
+
- @nebutra/capability-kit@0.2.2
|
|
26
|
+
- @nebutra/errors@0.1.2
|
|
27
|
+
|
|
3
28
|
## 0.1.1
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Wuxi Nebutra Intelligence Technology Co., Ltd.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nebutra/audio-pipeline",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "BrandContext-first audio generation, license metadata, and loudness utilities",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,18 +22,22 @@
|
|
|
22
22
|
"category": "ai",
|
|
23
23
|
"summary": "License-aware BGM, SFX, and song generation surface"
|
|
24
24
|
},
|
|
25
|
-
"main": "./
|
|
26
|
-
"types": "./
|
|
25
|
+
"main": "./dist/index.js",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
27
|
"exports": {
|
|
28
|
-
".":
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"import": "./dist/index.js",
|
|
31
|
+
"default": "./dist/index.js"
|
|
32
|
+
}
|
|
29
33
|
},
|
|
30
34
|
"dependencies": {
|
|
31
|
-
"@nebutra/capability-kit": "0.2.
|
|
32
|
-
"@nebutra/errors": "0.1.
|
|
33
|
-
"@nebutra/generation-context": "0.1.
|
|
35
|
+
"@nebutra/capability-kit": "0.2.4",
|
|
36
|
+
"@nebutra/errors": "0.1.2",
|
|
37
|
+
"@nebutra/generation-context": "0.1.3"
|
|
34
38
|
},
|
|
35
39
|
"devDependencies": {
|
|
36
|
-
"@types/node": "^
|
|
40
|
+
"@types/node": "^25.9.1",
|
|
37
41
|
"tsup": "^8.5.1",
|
|
38
42
|
"tsx": "^4.21.0",
|
|
39
43
|
"typescript": "^5.9.3",
|
|
@@ -51,6 +55,12 @@
|
|
|
51
55
|
"publishConfig": {
|
|
52
56
|
"access": "public"
|
|
53
57
|
},
|
|
58
|
+
"files": [
|
|
59
|
+
"dist",
|
|
60
|
+
"README.md",
|
|
61
|
+
"LICENSE",
|
|
62
|
+
"CHANGELOG.md"
|
|
63
|
+
],
|
|
54
64
|
"scripts": {
|
|
55
65
|
"build": "tsup",
|
|
56
66
|
"test": "vitest run",
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> @nebutra/audio-pipeline@0.1.1 build /home/runner/work/Nebutra-Sailor/Nebutra-Sailor/packages/ai/audio-pipeline
|
|
3
|
-
> tsup
|
|
4
|
-
|
|
5
|
-
[34mCLI[39m Building entry: src/cli.ts, src/index.ts
|
|
6
|
-
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
-
[34mCLI[39m tsup v8.5.1
|
|
8
|
-
[34mCLI[39m Using tsup config: /home/runner/work/Nebutra-Sailor/Nebutra-Sailor/packages/ai/audio-pipeline/tsup.config.ts
|
|
9
|
-
[34mCLI[39m Target: es2022
|
|
10
|
-
[34mCLI[39m Cleaning output folder
|
|
11
|
-
[34mESM[39m Build start
|
|
12
|
-
[32mESM[39m [1mdist/cli.js [22m[32m1.32 KB[39m
|
|
13
|
-
[32mESM[39m [1mdist/index.js [22m[32m186.00 B[39m
|
|
14
|
-
[32mESM[39m [1mdist/chunk-32LVUMTP.js [22m[32m4.46 KB[39m
|
|
15
|
-
[32mESM[39m [1mdist/cli.js.map [22m[32m2.35 KB[39m
|
|
16
|
-
[32mESM[39m [1mdist/index.js.map [22m[32m71.00 B[39m
|
|
17
|
-
[32mESM[39m [1mdist/chunk-32LVUMTP.js.map [22m[32m8.83 KB[39m
|
|
18
|
-
[32mESM[39m ⚡️ Build success in 79ms
|
|
19
|
-
[34mDTS[39m Build start
|
|
20
|
-
[32mDTS[39m ⚡️ Build success in 11452ms
|
|
21
|
-
[32mDTS[39m [1mdist/cli.d.ts [22m[32m13.00 B[39m
|
|
22
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m1.47 KB[39m
|
package/.turbo/turbo-test.log
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
> @nebutra/audio-pipeline@0.1.1 test /home/runner/work/Nebutra-Sailor/Nebutra-Sailor/packages/ai/audio-pipeline
|
|
3
|
-
> vitest run
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
[1m[30m[46m RUN [49m[39m[22m [36mv4.1.4 [39m[90m/home/runner/work/Nebutra-Sailor/Nebutra-Sailor/packages/ai/audio-pipeline[39m
|
|
7
|
-
|
|
8
|
-
[32m✓[39m src/index.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 93[2mms[22m[39m
|
|
9
|
-
|
|
10
|
-
[2m Test Files [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
11
|
-
[2m Tests [22m [1m[32m2 passed[39m[22m[90m (2)[39m
|
|
12
|
-
[2m Start at [22m 08:15:06
|
|
13
|
-
[2m Duration [22m 1.66s[2m (transform 647ms, setup 0ms, import 774ms, tests 93ms, environment 0ms)[22m
|
|
14
|
-
|
package/examples/bgm.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { createDemoBrandContext } from "@nebutra/generation-context";
|
|
2
|
-
import { AudioPipeline } from "../src/index";
|
|
3
|
-
|
|
4
|
-
const asset = await new AudioPipeline().generate(
|
|
5
|
-
{ type: "bgm", durationS: 5, mood: "uplifting tech", bpm: 110 },
|
|
6
|
-
createDemoBrandContext(),
|
|
7
|
-
true,
|
|
8
|
-
);
|
|
9
|
-
|
|
10
|
-
process.stdout.write(`${asset.path}\n`);
|
package/examples/license.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createDemoBrandContext } from "@nebutra/generation-context";
|
|
2
|
-
import { AudioPipeline } from "../src/index";
|
|
3
|
-
|
|
4
|
-
const pipeline = new AudioPipeline();
|
|
5
|
-
const asset = await pipeline.generate(
|
|
6
|
-
{ type: "sfx", description: "keyboard typing", durationS: 2 },
|
|
7
|
-
createDemoBrandContext(),
|
|
8
|
-
true,
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
process.stdout.write(`${JSON.stringify(await pipeline.license(asset), null, 2)}\n`);
|
package/examples/loudness.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createDemoBrandContext } from "@nebutra/generation-context";
|
|
2
|
-
import { AudioPipeline } from "../src/index";
|
|
3
|
-
|
|
4
|
-
const pipeline = new AudioPipeline();
|
|
5
|
-
const asset = await pipeline.generate(
|
|
6
|
-
{ type: "song", lyricsPrompt: "indie developer anthem", durationS: 8 },
|
|
7
|
-
createDemoBrandContext(),
|
|
8
|
-
true,
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
process.stdout.write(`${JSON.stringify(await pipeline.loudness(asset), null, 2)}\n`);
|
package/src/cli.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { createDemoBrandContext } from "@nebutra/generation-context";
|
|
2
|
-
import { AudioPipeline, readAudioDebug } from "./index";
|
|
3
|
-
|
|
4
|
-
const command = process.argv[2] ?? "doctor";
|
|
5
|
-
const pipeline = new AudioPipeline();
|
|
6
|
-
|
|
7
|
-
if (command === "doctor") {
|
|
8
|
-
process.stdout.write(
|
|
9
|
-
`${JSON.stringify({ capability: "audio-pipeline", results: await pipeline.doctor() }, null, 2)}\n`,
|
|
10
|
-
);
|
|
11
|
-
} else if (command === "debug") {
|
|
12
|
-
process.stdout.write(
|
|
13
|
-
`${JSON.stringify({ capability: "audio-pipeline", entries: await readAudioDebug() }, null, 2)}\n`,
|
|
14
|
-
);
|
|
15
|
-
} else if (command === "license") {
|
|
16
|
-
const asset = await pipeline.generate(
|
|
17
|
-
{ type: "bgm", durationS: 3, mood: "uplifting technical" },
|
|
18
|
-
createDemoBrandContext(),
|
|
19
|
-
true,
|
|
20
|
-
);
|
|
21
|
-
process.stdout.write(
|
|
22
|
-
`${JSON.stringify({ capability: "audio-pipeline", license: await pipeline.license(asset) }, null, 2)}\n`,
|
|
23
|
-
);
|
|
24
|
-
} else if (command === "loudness") {
|
|
25
|
-
const asset = await pipeline.generate(
|
|
26
|
-
{ type: "sfx", description: "keyboard typing", durationS: 1 },
|
|
27
|
-
createDemoBrandContext(),
|
|
28
|
-
true,
|
|
29
|
-
);
|
|
30
|
-
process.stdout.write(
|
|
31
|
-
`${JSON.stringify({ capability: "audio-pipeline", loudness: await pipeline.loudness(asset) }, null, 2)}\n`,
|
|
32
|
-
);
|
|
33
|
-
} else {
|
|
34
|
-
process.stderr.write(`Unknown audio-pipeline command: ${command}\n`);
|
|
35
|
-
process.exitCode = 1;
|
|
36
|
-
}
|
package/src/index.test.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { mkdtemp, readFile, rm } from "node:fs/promises";
|
|
2
|
-
import { tmpdir } from "node:os";
|
|
3
|
-
import { join } from "node:path";
|
|
4
|
-
import { createDemoBrandContext } from "@nebutra/generation-context";
|
|
5
|
-
import { afterEach, describe, expect, it } from "vitest";
|
|
6
|
-
import { AudioPipeline, readAudioDebug } from "./index";
|
|
7
|
-
|
|
8
|
-
let root: string | undefined;
|
|
9
|
-
|
|
10
|
-
afterEach(async () => {
|
|
11
|
-
if (root) await rm(root, { recursive: true, force: true });
|
|
12
|
-
root = undefined;
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
describe("AudioPipeline", () => {
|
|
16
|
-
it("requires BrandContext", async () => {
|
|
17
|
-
await expect(
|
|
18
|
-
new AudioPipeline().generate({ type: "sfx", description: "click" }, undefined, true),
|
|
19
|
-
).rejects.toMatchObject({ capability: "audio-pipeline" });
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it("writes a valid WAV header with commercial metadata", async () => {
|
|
23
|
-
root = await mkdtemp(join(tmpdir(), "audio-pipeline-"));
|
|
24
|
-
const asset = await new AudioPipeline({ root }).generate(
|
|
25
|
-
{ type: "bgm", durationS: 4, mood: "calm technical" },
|
|
26
|
-
createDemoBrandContext(),
|
|
27
|
-
true,
|
|
28
|
-
);
|
|
29
|
-
expect((await readFile(asset.path)).subarray(0, 4).toString()).toBe("RIFF");
|
|
30
|
-
expect(asset.license.status).toBe("commercial-ok");
|
|
31
|
-
expect(await readAudioDebug(root)).toHaveLength(1);
|
|
32
|
-
});
|
|
33
|
-
});
|
package/src/index.ts
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
|
-
import { dirname, join } from "node:path";
|
|
3
|
-
import { appendCapabilityDebug, readCapabilityDebug } from "@nebutra/capability-kit/debug";
|
|
4
|
-
import { CapabilityError } from "@nebutra/errors";
|
|
5
|
-
import {
|
|
6
|
-
assetId,
|
|
7
|
-
type BrandContext,
|
|
8
|
-
type GeneratedAsset,
|
|
9
|
-
type LicenseMetadata,
|
|
10
|
-
requireBrandContext,
|
|
11
|
-
} from "@nebutra/generation-context";
|
|
12
|
-
|
|
13
|
-
export type AudioIntent =
|
|
14
|
-
| { type: "bgm"; durationS: number; mood: string; bpm?: number }
|
|
15
|
-
| { type: "sfx"; description: string; durationS?: number }
|
|
16
|
-
| { type: "song"; lyricsPrompt: string; durationS: number };
|
|
17
|
-
|
|
18
|
-
export interface AudioAsset extends GeneratedAsset {
|
|
19
|
-
readonly kind: "audio";
|
|
20
|
-
readonly durationS: number;
|
|
21
|
-
readonly format: "wav";
|
|
22
|
-
readonly loudnessLufs: number;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface AudioHealth {
|
|
26
|
-
readonly provider: string;
|
|
27
|
-
readonly ok: boolean;
|
|
28
|
-
readonly suggestion?: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface AudioPipelineOptions {
|
|
32
|
-
readonly root?: string;
|
|
33
|
-
readonly provider?: "tone-local" | "local-model" | "remote";
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export async function readAudioDebug(root = process.cwd(), limit = 10): Promise<unknown[]> {
|
|
37
|
-
return readCapabilityDebug("audio-pipeline", { root, limit });
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function intentLabel(intent: AudioIntent): string {
|
|
41
|
-
switch (intent.type) {
|
|
42
|
-
case "bgm":
|
|
43
|
-
return intent.mood;
|
|
44
|
-
case "sfx":
|
|
45
|
-
return intent.description;
|
|
46
|
-
case "song":
|
|
47
|
-
return intent.lyricsPrompt;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function durationFor(intent: AudioIntent): number {
|
|
52
|
-
if (intent.type === "sfx") return Math.max(1, Math.min(intent.durationS ?? 3, 8));
|
|
53
|
-
return Math.max(1, Math.min(intent.durationS, 12));
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export function createToneWav(durationS: number, frequency = 440, sampleRate = 24_000): Buffer {
|
|
57
|
-
const samples = Math.max(1, Math.floor(durationS * sampleRate));
|
|
58
|
-
const dataBytes = samples * 2;
|
|
59
|
-
const buffer = Buffer.alloc(44 + dataBytes);
|
|
60
|
-
buffer.write("RIFF", 0);
|
|
61
|
-
buffer.writeUInt32LE(36 + dataBytes, 4);
|
|
62
|
-
buffer.write("WAVE", 8);
|
|
63
|
-
buffer.write("fmt ", 12);
|
|
64
|
-
buffer.writeUInt32LE(16, 16);
|
|
65
|
-
buffer.writeUInt16LE(1, 20);
|
|
66
|
-
buffer.writeUInt16LE(1, 22);
|
|
67
|
-
buffer.writeUInt32LE(sampleRate, 24);
|
|
68
|
-
buffer.writeUInt32LE(sampleRate * 2, 28);
|
|
69
|
-
buffer.writeUInt16LE(2, 32);
|
|
70
|
-
buffer.writeUInt16LE(16, 34);
|
|
71
|
-
buffer.write("data", 36);
|
|
72
|
-
buffer.writeUInt32LE(dataBytes, 40);
|
|
73
|
-
for (let index = 0; index < samples; index += 1) {
|
|
74
|
-
const fade = Math.min(index / 1200, (samples - index) / 1200, 1);
|
|
75
|
-
const sample = Math.round(
|
|
76
|
-
Math.sin((2 * Math.PI * frequency * index) / sampleRate) * 9000 * fade,
|
|
77
|
-
);
|
|
78
|
-
buffer.writeInt16LE(sample, 44 + index * 2);
|
|
79
|
-
}
|
|
80
|
-
return buffer;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function frequencyFor(brand: BrandContext, intent: AudioIntent): number {
|
|
84
|
-
const base = brand.toneKeywords.join("").length + intentLabel(intent).length;
|
|
85
|
-
return 220 + (base % 9) * 55;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function licenseFor(requireCommercial: boolean, provider: string): LicenseMetadata {
|
|
89
|
-
if (requireCommercial && provider !== "tone-local") {
|
|
90
|
-
return {
|
|
91
|
-
status: "unknown",
|
|
92
|
-
source: provider,
|
|
93
|
-
suggestion: "Verify the provider plan and model terms before commercial use.",
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
return { status: "commercial-ok", source: "deterministic local renderer" };
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export class AudioPipeline {
|
|
100
|
-
readonly #root: string;
|
|
101
|
-
readonly #provider: "tone-local" | "local-model" | "remote";
|
|
102
|
-
|
|
103
|
-
constructor(options: AudioPipelineOptions = {}) {
|
|
104
|
-
this.#root = options.root ?? process.cwd();
|
|
105
|
-
this.#provider = options.provider ?? "tone-local";
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
async generate(
|
|
109
|
-
intent: AudioIntent,
|
|
110
|
-
brandInput: BrandContext | undefined,
|
|
111
|
-
requireCommercial = true,
|
|
112
|
-
): Promise<AudioAsset> {
|
|
113
|
-
const brand = requireBrandContext(brandInput, "audio-pipeline");
|
|
114
|
-
if (requireCommercial && this.#provider !== "tone-local") {
|
|
115
|
-
throw new CapabilityError(
|
|
116
|
-
"audio-pipeline",
|
|
117
|
-
"Selected audio provider lacks verified license",
|
|
118
|
-
{
|
|
119
|
-
suggestion: "Use tone-local or wire a provider with commercial license metadata.",
|
|
120
|
-
statusCode: 409,
|
|
121
|
-
},
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
const durationS = durationFor(intent);
|
|
125
|
-
const id = assetId("audio", `${intent.type}_${intentLabel(intent)}`);
|
|
126
|
-
const path = join(this.#root, ".nebutra", "generated", "audio-pipeline", `${id}.wav`);
|
|
127
|
-
await mkdir(dirname(path), { recursive: true });
|
|
128
|
-
await writeFile(path, createToneWav(durationS, frequencyFor(brand, intent)));
|
|
129
|
-
|
|
130
|
-
const asset: AudioAsset = {
|
|
131
|
-
id,
|
|
132
|
-
tenantId: brand.tenantId,
|
|
133
|
-
kind: "audio",
|
|
134
|
-
path,
|
|
135
|
-
brandId: brand.brandId,
|
|
136
|
-
provider: this.#provider,
|
|
137
|
-
model: "brand-context-tone-v1",
|
|
138
|
-
createdAt: new Date().toISOString(),
|
|
139
|
-
license: licenseFor(requireCommercial, this.#provider),
|
|
140
|
-
durationS,
|
|
141
|
-
format: "wav",
|
|
142
|
-
loudnessLufs: -18,
|
|
143
|
-
metadata: { intent, brandSource: brand.sourcePath },
|
|
144
|
-
};
|
|
145
|
-
await appendCapabilityDebug(
|
|
146
|
-
"audio-pipeline",
|
|
147
|
-
{ type: "generate", asset },
|
|
148
|
-
{ root: this.#root },
|
|
149
|
-
);
|
|
150
|
-
return asset;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
async doctor(): Promise<AudioHealth[]> {
|
|
154
|
-
return [
|
|
155
|
-
{ provider: "tone-local", ok: true },
|
|
156
|
-
{
|
|
157
|
-
provider: "local-model",
|
|
158
|
-
ok: Boolean(process.env.AUDIO_LOCAL_MODEL_PATH),
|
|
159
|
-
suggestion: "Set AUDIO_LOCAL_MODEL_PATH to enable local model generation.",
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
provider: "remote",
|
|
163
|
-
ok: Boolean(process.env.AUDIO_REMOTE_API_KEY),
|
|
164
|
-
suggestion: "Set AUDIO_REMOTE_API_KEY to enable remote audio fallback.",
|
|
165
|
-
},
|
|
166
|
-
];
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
async license(asset: Pick<AudioAsset, "license">): Promise<LicenseMetadata> {
|
|
170
|
-
return asset.license;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
async loudness(asset: Pick<AudioAsset, "loudnessLufs">): Promise<{ lufs: number }> {
|
|
174
|
-
return { lufs: asset.loudnessLufs };
|
|
175
|
-
}
|
|
176
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"target": "esnext",
|
|
7
|
-
"types": ["node"],
|
|
8
|
-
"incremental": false
|
|
9
|
-
},
|
|
10
|
-
"include": ["src", "examples"],
|
|
11
|
-
"exclude": ["node_modules", "dist"]
|
|
12
|
-
}
|
package/tsup.config.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "tsup";
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
entry: ["src/index.ts", "src/cli.ts"],
|
|
5
|
-
format: ["esm"],
|
|
6
|
-
dts: true,
|
|
7
|
-
sourcemap: true,
|
|
8
|
-
clean: true,
|
|
9
|
-
target: "es2022",
|
|
10
|
-
external: ["@nebutra/capability-kit/debug", "@nebutra/errors", "@nebutra/generation-context"],
|
|
11
|
-
});
|