open-agents-ai 0.138.2 → 0.138.4
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/dist/index.js +36 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -39875,20 +39875,30 @@ if __name__ == '__main__':
|
|
|
39875
39875
|
}
|
|
39876
39876
|
if (!existsSync35(wavPath))
|
|
39877
39877
|
return;
|
|
39878
|
-
|
|
39879
|
-
|
|
39880
|
-
|
|
39881
|
-
|
|
39882
|
-
|
|
39878
|
+
try {
|
|
39879
|
+
const wavData = readFileSync24(wavPath);
|
|
39880
|
+
if (wavData.length > 44) {
|
|
39881
|
+
const sampleRate = wavData.readUInt32LE(24);
|
|
39882
|
+
const samples = new Int16Array(wavData.buffer, wavData.byteOffset + 44, (wavData.length - 44) / 2);
|
|
39883
|
+
const fadeInSamples = Math.min(Math.round(sampleRate * 0.2), samples.length);
|
|
39884
|
+
for (let i = 0; i < fadeInSamples; i++) {
|
|
39885
|
+
samples[i] = Math.round(samples[i] * (i / fadeInSamples));
|
|
39886
|
+
}
|
|
39887
|
+
const fadeOutSamples = Math.min(Math.round(sampleRate * 0.05), samples.length);
|
|
39888
|
+
const fadeOutStart = samples.length - fadeOutSamples;
|
|
39889
|
+
for (let i = 0; i < fadeOutSamples; i++) {
|
|
39890
|
+
samples[fadeOutStart + i] = Math.round(samples[fadeOutStart + i] * (1 - i / fadeOutSamples));
|
|
39891
|
+
}
|
|
39892
|
+
if (volume !== 1) {
|
|
39883
39893
|
for (let i = 0; i < samples.length; i++) {
|
|
39884
39894
|
samples[i] = Math.round(samples[i] * volume);
|
|
39885
39895
|
}
|
|
39886
|
-
const header = wavData.subarray(0, 44);
|
|
39887
|
-
const scaled = Buffer.concat([header, Buffer.from(samples.buffer, samples.byteOffset, samples.byteLength)]);
|
|
39888
|
-
writeFileSync14(wavPath, scaled);
|
|
39889
39896
|
}
|
|
39890
|
-
|
|
39897
|
+
const header = wavData.subarray(0, 44);
|
|
39898
|
+
const scaled = Buffer.concat([header, Buffer.from(samples.buffer, samples.byteOffset, samples.byteLength)]);
|
|
39899
|
+
writeFileSync14(wavPath, scaled);
|
|
39891
39900
|
}
|
|
39901
|
+
} catch {
|
|
39892
39902
|
}
|
|
39893
39903
|
if (pitchFactor !== 1) {
|
|
39894
39904
|
try {
|
|
@@ -39936,6 +39946,7 @@ if __name__ == '__main__':
|
|
|
39936
39946
|
}
|
|
39937
39947
|
}
|
|
39938
39948
|
await this.playWav(wavPath);
|
|
39949
|
+
await this.sleep(80);
|
|
39939
39950
|
try {
|
|
39940
39951
|
unlinkSync8(wavPath);
|
|
39941
39952
|
} catch {
|
|
@@ -44557,17 +44568,24 @@ function createCohereBanner() {
|
|
|
44557
44568
|
const width = process.stdout.columns ?? 80;
|
|
44558
44569
|
const rows = 3;
|
|
44559
44570
|
const grid = [];
|
|
44571
|
+
const bgColor = 236;
|
|
44572
|
+
const fgColor = 226;
|
|
44573
|
+
const halftone = ["\u2588", "\u2593", "\u2592", "\u2591", " "];
|
|
44560
44574
|
for (let r = 0; r < rows; r++) {
|
|
44561
44575
|
const row = [];
|
|
44562
44576
|
for (let c3 = 0; c3 < width; c3++) {
|
|
44563
|
-
|
|
44577
|
+
const distFromCenter = Math.abs(c3 - width / 2) / (width / 2);
|
|
44578
|
+
const htIdx = Math.min(halftone.length - 1, Math.floor(distFromCenter * halftone.length));
|
|
44579
|
+
const char = r === 0 || r === 2 ? halftone[htIdx] : " ";
|
|
44580
|
+
const charFg = r === 1 ? fgColor : 238;
|
|
44581
|
+
row.push({ char, fg: charFg, bg: bgColor, bold: false });
|
|
44564
44582
|
}
|
|
44565
44583
|
grid.push(row);
|
|
44566
44584
|
}
|
|
44567
|
-
const text = "COHERE \u2014
|
|
44585
|
+
const text = "COHERE \u2014 Distributed Cognitive Commons";
|
|
44568
44586
|
const startCol = Math.max(0, Math.floor((width - text.length) / 2));
|
|
44569
44587
|
for (let i = 0; i < text.length && startCol + i < width; i++) {
|
|
44570
|
-
grid[1][startCol + i] = { char: text[i], fg:
|
|
44588
|
+
grid[1][startCol + i] = { char: text[i], fg: fgColor, bg: bgColor, bold: true };
|
|
44571
44589
|
}
|
|
44572
44590
|
return {
|
|
44573
44591
|
id: "cohere-default",
|
|
@@ -54308,10 +54326,14 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
54308
54326
|
statusBar.setCohereActive(cohereEnabled);
|
|
54309
54327
|
if (cohereEnabled) {
|
|
54310
54328
|
banner.setDesign(createCohereBanner());
|
|
54311
|
-
banner.start();
|
|
54329
|
+
const reserved = banner.start();
|
|
54330
|
+
if (statusBar.isActive && reserved > 0)
|
|
54331
|
+
statusBar.setScrollRegionTop(reserved + 1);
|
|
54312
54332
|
} else {
|
|
54313
54333
|
banner.setDesign(createDefaultBanner(version));
|
|
54314
|
-
banner.start();
|
|
54334
|
+
const reserved = banner.start();
|
|
54335
|
+
if (statusBar.isActive && reserved > 0)
|
|
54336
|
+
statusBar.setScrollRegionTop(reserved + 1);
|
|
54315
54337
|
}
|
|
54316
54338
|
return cohereEnabled;
|
|
54317
54339
|
},
|
package/package.json
CHANGED