@kernel.chat/kbot 3.95.0 → 3.97.1

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/doctor.js CHANGED
@@ -518,11 +518,12 @@ export async function runDoctor() {
518
518
  // ── Formatter ──
519
519
  // Color palette matching ui.ts
520
520
  const useColor = !process.env.NO_COLOR && process.stdout.isTTY !== false;
521
- const GREEN = useColor ? chalk.hex('#4ADE80') : chalk;
522
- const RED = useColor ? chalk.hex('#F87171') : chalk;
523
- const YELLOW = useColor ? chalk.hex('#FBBF24') : chalk;
521
+ const hex = typeof chalk.hex === 'function' ? (c) => chalk.hex(c) : () => ((s) => s);
522
+ const GREEN = useColor ? hex('#4ADE80') : ((s) => s);
523
+ const RED = useColor ? hex('#F87171') : ((s) => s);
524
+ const YELLOW = useColor ? hex('#FBBF24') : ((s) => s);
524
525
  const DIM = useColor ? chalk.dim : ((s) => s);
525
- const ACCENT = useColor ? chalk.hex('#A78BFA') : chalk;
526
+ const ACCENT = useColor ? hex('#A78BFA') : ((s) => s);
526
527
  const STATUS_ICON = {
527
528
  pass: GREEN('✓'),
528
529
  warn: YELLOW('!'),
package/dist/share.js CHANGED
@@ -25,7 +25,7 @@ export function formatShareMarkdown(turns, meta) {
25
25
  const lines = [
26
26
  `# ${name}`,
27
27
  '',
28
- `> Generated with [kbot](${KBOT_URL}) — 25 specialist agents, 290+ tools, 20 AI providers`,
28
+ `> Generated with [kbot](${KBOT_URL}) — 35 specialist agents, 787+ tools, 20 AI providers`,
29
29
  `> Agent: \`${agent}\` | Date: ${date}`,
30
30
  '',
31
31
  '---',
package/dist/streaming.js CHANGED
@@ -7,7 +7,7 @@
7
7
  // The thinking display shows the AI's reasoning process in real-time,
8
8
  // then the final response renders normally.
9
9
  import chalk from 'chalk';
10
- const ACCENT_DIM = chalk.hex('#7C6CB0');
10
+ const ACCENT_DIM = typeof chalk.hex === 'function' ? chalk.hex('#7C6CB0') : chalk.dim;
11
11
  const THINKING_COLOR = chalk.dim.italic;
12
12
  /** Max accumulated content size during streaming (5MB) to prevent OOM */
13
13
  const MAX_STREAM_CONTENT = 5 * 1024 * 1024;
@@ -11,6 +11,55 @@ export interface SoundEvent {
11
11
  type: SoundEventType;
12
12
  timestamp: number;
13
13
  }
14
+ export type SFXType = 'chat' | 'follow' | 'achievement' | 'boss' | 'raid' | 'build' | 'discovery';
15
+ export type WaveformType = 'sine' | 'square' | 'sawtooth' | 'triangle' | 'noise_white' | 'noise_pink';
16
+ export type FilterType = 'lowpass' | 'highpass' | 'bandpass';
17
+ export type ScaleType = 'pentatonic' | 'minor' | 'major';
18
+ export interface ADSREnvelope {
19
+ attack: number;
20
+ decay: number;
21
+ sustain: number;
22
+ release: number;
23
+ }
24
+ export interface SFXEvent {
25
+ type: SFXType;
26
+ triggeredAt: number;
27
+ /** Remaining samples of this SFX (counts down to 0) */
28
+ samplesRemaining: number;
29
+ phase: number;
30
+ }
31
+ export interface SequencerChannel {
32
+ pattern: number[];
33
+ waveform: WaveformType;
34
+ envelope: ADSREnvelope;
35
+ volume: number;
36
+ filterType: FilterType;
37
+ filterFreq: number;
38
+ filterQ: number;
39
+ phase: number;
40
+ envStage: 'off' | 'attack' | 'decay' | 'sustain' | 'release';
41
+ envLevel: number;
42
+ envTime: number;
43
+ currentNote: number;
44
+ }
45
+ export interface SequencerState {
46
+ step: number;
47
+ sampleCounter: number;
48
+ samplesPerStep: number;
49
+ channels: {
50
+ melody: SequencerChannel;
51
+ bass: SequencerChannel;
52
+ arp: SequencerChannel;
53
+ drums: SequencerChannel;
54
+ };
55
+ }
56
+ export interface DelayLine {
57
+ buffer: Float32Array;
58
+ writeIndex: number;
59
+ delaySamples: number;
60
+ feedback: number;
61
+ mix: number;
62
+ }
14
63
  export interface AudioEngine {
15
64
  currentAmbience: AmbienceType;
16
65
  musicState: MusicState;
@@ -25,8 +74,35 @@ export interface AudioEngine {
25
74
  ambienceInterval: number;
26
75
  /** Total descriptions emitted */
27
76
  totalDescriptions: number;
77
+ pcmEnabled: boolean;
78
+ sfxQueue: SFXEvent[];
79
+ sequencer: SequencerState;
80
+ masterVolume: number;
81
+ delayLine: DelayLine;
82
+ /** Total PCM samples generated since engine creation */
83
+ totalSamplesGenerated: number;
84
+ musicEnabled: boolean;
28
85
  }
29
86
  export declare function createAudioEngine(): AudioEngine;
87
+ /**
88
+ * Trigger a sound effect. The SFX will be mixed into the next generateAudioBuffer call.
89
+ */
90
+ export declare function triggerSFX(engine: AudioEngine, sfx: SFXType): void;
91
+ /**
92
+ * Enable or disable background music generation.
93
+ */
94
+ export declare function setMusicEnabled(engine: AudioEngine, enabled: boolean): void;
95
+ /**
96
+ * Generate a buffer of PCM Float32 audio samples.
97
+ * Mixes the 4-channel chiptune sequencer + any active SFX.
98
+ * Output: mono Float32Array, ready to pipe to ffmpeg via -f f32le -ar 44100 -ac 1 -i pipe:3
99
+ *
100
+ * @param engine The audio engine state
101
+ * @param sampleCount Number of samples to generate
102
+ * @param sampleRate Sample rate (default 44100)
103
+ * @returns Float32Array of PCM samples in [-1, 1]
104
+ */
105
+ export declare function generateAudioBuffer(engine: AudioEngine, sampleCount: number, sampleRate?: number): Float32Array;
30
106
  export declare function getAmbienceDescription(ambience: AmbienceType): string;
31
107
  export declare function getSoundDescription(event: SoundEvent): string;
32
108
  export declare function getMusicDescription(mood: string, biome: string): string;