@vibesdotdev/agent-execution 0.0.0-stage → 1.0.0-rc.2

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.
Files changed (191) hide show
  1. package/LICENSE +18 -0
  2. package/README.md +53 -2
  3. package/dist/code-session/agent-code-session.consumer.descriptor.d.ts +68 -0
  4. package/dist/code-session/agent-code-session.consumer.descriptor.d.ts.map +1 -0
  5. package/dist/code-session/agent-code-session.consumer.descriptor.js +31 -0
  6. package/dist/code-session/agent-code-session.consumer.descriptor.js.map +1 -0
  7. package/dist/code-session/agent-code-session.consumer.plugin.d.ts +18 -0
  8. package/dist/code-session/agent-code-session.consumer.plugin.d.ts.map +1 -0
  9. package/dist/code-session/agent-code-session.consumer.plugin.js +47 -0
  10. package/dist/code-session/agent-code-session.consumer.plugin.js.map +1 -0
  11. package/dist/code-session/agent-code-session.descriptor.d.ts +163 -0
  12. package/dist/code-session/agent-code-session.descriptor.d.ts.map +1 -0
  13. package/dist/code-session/agent-code-session.descriptor.js +129 -0
  14. package/dist/code-session/agent-code-session.descriptor.js.map +1 -0
  15. package/dist/code-session/agent-code-session.impl.consumer.d.ts +224 -0
  16. package/dist/code-session/agent-code-session.impl.consumer.d.ts.map +1 -0
  17. package/dist/code-session/agent-code-session.impl.consumer.js +2131 -0
  18. package/dist/code-session/agent-code-session.impl.consumer.js.map +1 -0
  19. package/dist/code-session/agent-code-session.kind.d.ts +15 -0
  20. package/dist/code-session/agent-code-session.kind.d.ts.map +1 -0
  21. package/dist/code-session/agent-code-session.kind.js +17 -0
  22. package/dist/code-session/agent-code-session.kind.js.map +1 -0
  23. package/dist/code-session/agent-code-session.plugin.d.ts +17 -0
  24. package/dist/code-session/agent-code-session.plugin.d.ts.map +1 -0
  25. package/dist/code-session/agent-code-session.plugin.js +28 -0
  26. package/dist/code-session/agent-code-session.plugin.js.map +1 -0
  27. package/dist/code-session/billing/gates.d.ts +52 -0
  28. package/dist/code-session/billing/gates.d.ts.map +1 -0
  29. package/dist/code-session/billing/gates.js +75 -0
  30. package/dist/code-session/billing/gates.js.map +1 -0
  31. package/dist/code-session/client/index.d.ts +2 -0
  32. package/dist/code-session/client/index.d.ts.map +1 -0
  33. package/dist/code-session/client/index.js +2 -0
  34. package/dist/code-session/client/index.js.map +1 -0
  35. package/dist/code-session/client/resolve.d.ts +20 -0
  36. package/dist/code-session/client/resolve.d.ts.map +1 -0
  37. package/dist/code-session/client/resolve.js +145 -0
  38. package/dist/code-session/client/resolve.js.map +1 -0
  39. package/dist/code-session/docs/agent-code-session.docs.descriptor.d.ts +4 -0
  40. package/dist/code-session/docs/agent-code-session.docs.descriptor.d.ts.map +1 -0
  41. package/dist/code-session/docs/agent-code-session.docs.descriptor.js +109 -0
  42. package/dist/code-session/docs/agent-code-session.docs.descriptor.js.map +1 -0
  43. package/dist/code-session/git-credential.d.ts +87 -0
  44. package/dist/code-session/git-credential.d.ts.map +1 -0
  45. package/dist/code-session/git-credential.js +107 -0
  46. package/dist/code-session/git-credential.js.map +1 -0
  47. package/dist/code-session/host-target.d.ts +76 -0
  48. package/dist/code-session/host-target.d.ts.map +1 -0
  49. package/dist/code-session/host-target.js +81 -0
  50. package/dist/code-session/host-target.js.map +1 -0
  51. package/dist/code-session/index.d.ts +20 -0
  52. package/dist/code-session/index.d.ts.map +1 -0
  53. package/dist/code-session/index.js +20 -0
  54. package/dist/code-session/index.js.map +1 -0
  55. package/dist/code-session/interfaces/code-session.d.ts +448 -0
  56. package/dist/code-session/interfaces/code-session.d.ts.map +1 -0
  57. package/dist/code-session/interfaces/code-session.js +373 -0
  58. package/dist/code-session/interfaces/code-session.js.map +1 -0
  59. package/dist/code-session/operation-lease.d.ts +48 -0
  60. package/dist/code-session/operation-lease.d.ts.map +1 -0
  61. package/dist/code-session/operation-lease.js +73 -0
  62. package/dist/code-session/operation-lease.js.map +1 -0
  63. package/dist/code-session/remote-setup-custody.d.ts +59 -0
  64. package/dist/code-session/remote-setup-custody.d.ts.map +1 -0
  65. package/dist/code-session/remote-setup-custody.js +78 -0
  66. package/dist/code-session/remote-setup-custody.js.map +1 -0
  67. package/dist/code-session/remote-workspace-fs.d.ts +119 -0
  68. package/dist/code-session/remote-workspace-fs.d.ts.map +1 -0
  69. package/dist/code-session/remote-workspace-fs.js +257 -0
  70. package/dist/code-session/remote-workspace-fs.js.map +1 -0
  71. package/dist/code-session/session-metadata.d.ts +40 -0
  72. package/dist/code-session/session-metadata.d.ts.map +1 -0
  73. package/dist/code-session/session-metadata.js +69 -0
  74. package/dist/code-session/session-metadata.js.map +1 -0
  75. package/dist/code-session-relay/agent-code-session-relay.descriptor.d.ts +78 -0
  76. package/dist/code-session-relay/agent-code-session-relay.descriptor.d.ts.map +1 -0
  77. package/dist/code-session-relay/agent-code-session-relay.descriptor.js +38 -0
  78. package/dist/code-session-relay/agent-code-session-relay.descriptor.js.map +1 -0
  79. package/dist/code-session-relay/agent-code-session-relay.impl.d.ts +120 -0
  80. package/dist/code-session-relay/agent-code-session-relay.impl.d.ts.map +1 -0
  81. package/dist/code-session-relay/agent-code-session-relay.impl.js +1392 -0
  82. package/dist/code-session-relay/agent-code-session-relay.impl.js.map +1 -0
  83. package/dist/code-session-relay/agent-code-session-relay.plugin.d.ts +14 -0
  84. package/dist/code-session-relay/agent-code-session-relay.plugin.d.ts.map +1 -0
  85. package/dist/code-session-relay/agent-code-session-relay.plugin.js +25 -0
  86. package/dist/code-session-relay/agent-code-session-relay.plugin.js.map +1 -0
  87. package/dist/code-session-relay/index.d.ts +13 -0
  88. package/dist/code-session-relay/index.d.ts.map +1 -0
  89. package/dist/code-session-relay/index.js +13 -0
  90. package/dist/code-session-relay/index.js.map +1 -0
  91. package/dist/code-session-relay/relay-dial.d.ts +72 -0
  92. package/dist/code-session-relay/relay-dial.d.ts.map +1 -0
  93. package/dist/code-session-relay/relay-dial.js +177 -0
  94. package/dist/code-session-relay/relay-dial.js.map +1 -0
  95. package/dist/index.d.ts +10 -0
  96. package/dist/index.d.ts.map +1 -0
  97. package/dist/index.js +10 -0
  98. package/dist/index.js.map +1 -0
  99. package/dist/sandbox/agent-sandbox.consumer.descriptor.d.ts +35 -0
  100. package/dist/sandbox/agent-sandbox.consumer.descriptor.d.ts.map +1 -0
  101. package/dist/sandbox/agent-sandbox.consumer.descriptor.js +19 -0
  102. package/dist/sandbox/agent-sandbox.consumer.descriptor.js.map +1 -0
  103. package/dist/sandbox/agent-sandbox.consumer.plugin.d.ts +9 -0
  104. package/dist/sandbox/agent-sandbox.consumer.plugin.d.ts.map +1 -0
  105. package/dist/sandbox/agent-sandbox.consumer.plugin.js +33 -0
  106. package/dist/sandbox/agent-sandbox.consumer.plugin.js.map +1 -0
  107. package/dist/sandbox/agent-sandbox.descriptor.d.ts +76 -0
  108. package/dist/sandbox/agent-sandbox.descriptor.d.ts.map +1 -0
  109. package/dist/sandbox/agent-sandbox.descriptor.js +57 -0
  110. package/dist/sandbox/agent-sandbox.descriptor.js.map +1 -0
  111. package/dist/sandbox/agent-sandbox.impl.consumer.d.ts +15 -0
  112. package/dist/sandbox/agent-sandbox.impl.consumer.d.ts.map +1 -0
  113. package/dist/sandbox/agent-sandbox.impl.consumer.js +23 -0
  114. package/dist/sandbox/agent-sandbox.impl.consumer.js.map +1 -0
  115. package/dist/sandbox/agent-sandbox.kind.d.ts +14 -0
  116. package/dist/sandbox/agent-sandbox.kind.d.ts.map +1 -0
  117. package/dist/sandbox/agent-sandbox.kind.js +16 -0
  118. package/dist/sandbox/agent-sandbox.kind.js.map +1 -0
  119. package/dist/sandbox/agent-sandbox.plugin.d.ts +15 -0
  120. package/dist/sandbox/agent-sandbox.plugin.d.ts.map +1 -0
  121. package/dist/sandbox/agent-sandbox.plugin.js +25 -0
  122. package/dist/sandbox/agent-sandbox.plugin.js.map +1 -0
  123. package/dist/sandbox/client/resolve.d.ts +21 -0
  124. package/dist/sandbox/client/resolve.d.ts.map +1 -0
  125. package/dist/sandbox/client/resolve.js +103 -0
  126. package/dist/sandbox/client/resolve.js.map +1 -0
  127. package/dist/sandbox/docs/agent-sandbox.docs.descriptor.d.ts +4 -0
  128. package/dist/sandbox/docs/agent-sandbox.docs.descriptor.d.ts.map +1 -0
  129. package/dist/sandbox/docs/agent-sandbox.docs.descriptor.js +75 -0
  130. package/dist/sandbox/docs/agent-sandbox.docs.descriptor.js.map +1 -0
  131. package/dist/sandbox/index.d.ts +15 -0
  132. package/dist/sandbox/index.d.ts.map +1 -0
  133. package/dist/sandbox/index.js +14 -0
  134. package/dist/sandbox/index.js.map +1 -0
  135. package/dist/sandbox/interfaces/sandbox.d.ts +61 -0
  136. package/dist/sandbox/interfaces/sandbox.d.ts.map +1 -0
  137. package/dist/sandbox/interfaces/sandbox.js +54 -0
  138. package/dist/sandbox/interfaces/sandbox.js.map +1 -0
  139. package/dist/schemas/code-session-resolution.d.ts +20 -0
  140. package/dist/schemas/code-session-resolution.d.ts.map +1 -0
  141. package/dist/schemas/code-session-resolution.js +11 -0
  142. package/dist/schemas/code-session-resolution.js.map +1 -0
  143. package/dist/schemas/session-operation.d.ts +73 -0
  144. package/dist/schemas/session-operation.d.ts.map +1 -0
  145. package/dist/schemas/session-operation.js +47 -0
  146. package/dist/schemas/session-operation.js.map +1 -0
  147. package/dist/schemas/voice.d.ts +87 -0
  148. package/dist/schemas/voice.d.ts.map +1 -0
  149. package/dist/schemas/voice.js +70 -0
  150. package/dist/schemas/voice.js.map +1 -0
  151. package/dist/voice/agent-voice.consumer.descriptor.d.ts +43 -0
  152. package/dist/voice/agent-voice.consumer.descriptor.d.ts.map +1 -0
  153. package/dist/voice/agent-voice.consumer.descriptor.js +20 -0
  154. package/dist/voice/agent-voice.consumer.descriptor.js.map +1 -0
  155. package/dist/voice/agent-voice.consumer.plugin.d.ts +4 -0
  156. package/dist/voice/agent-voice.consumer.plugin.d.ts.map +1 -0
  157. package/dist/voice/agent-voice.consumer.plugin.js +13 -0
  158. package/dist/voice/agent-voice.consumer.plugin.js.map +1 -0
  159. package/dist/voice/agent-voice.descriptor.d.ts +82 -0
  160. package/dist/voice/agent-voice.descriptor.d.ts.map +1 -0
  161. package/dist/voice/agent-voice.descriptor.js +79 -0
  162. package/dist/voice/agent-voice.descriptor.js.map +1 -0
  163. package/dist/voice/agent-voice.impl.consumer.d.ts +35 -0
  164. package/dist/voice/agent-voice.impl.consumer.d.ts.map +1 -0
  165. package/dist/voice/agent-voice.impl.consumer.js +50 -0
  166. package/dist/voice/agent-voice.impl.consumer.js.map +1 -0
  167. package/dist/voice/agent-voice.kind.d.ts +67 -0
  168. package/dist/voice/agent-voice.kind.d.ts.map +1 -0
  169. package/dist/voice/agent-voice.kind.js +26 -0
  170. package/dist/voice/agent-voice.kind.js.map +1 -0
  171. package/dist/voice/agent-voice.plugin.d.ts +4 -0
  172. package/dist/voice/agent-voice.plugin.d.ts.map +1 -0
  173. package/dist/voice/agent-voice.plugin.js +18 -0
  174. package/dist/voice/agent-voice.plugin.js.map +1 -0
  175. package/dist/voice/client.d.ts +38 -0
  176. package/dist/voice/client.d.ts.map +1 -0
  177. package/dist/voice/client.js +29 -0
  178. package/dist/voice/client.js.map +1 -0
  179. package/dist/voice/index.d.ts +14 -0
  180. package/dist/voice/index.d.ts.map +1 -0
  181. package/dist/voice/index.js +14 -0
  182. package/dist/voice/index.js.map +1 -0
  183. package/dist/voice/pipeline.d.ts +66 -0
  184. package/dist/voice/pipeline.d.ts.map +1 -0
  185. package/dist/voice/pipeline.js +330 -0
  186. package/dist/voice/pipeline.js.map +1 -0
  187. package/dist/voice/session.d.ts +29 -0
  188. package/dist/voice/session.d.ts.map +1 -0
  189. package/dist/voice/session.js +78 -0
  190. package/dist/voice/session.js.map +1 -0
  191. package/package.json +279 -4
@@ -0,0 +1,82 @@
1
+ /**
2
+ * agent/voice descriptor schema + factory
3
+ *
4
+ * Defines the `agent/voice` runtime kind: a half-duplex (turn-based) voice
5
+ * pipeline that wires three existing seams together —
6
+ *
7
+ * STT (ai/generation transcription) → text → NativeToolsAgentLoop (text-only)
8
+ * → text → TTS (ai/generation tts)
9
+ *
10
+ * The agent loop is left completely unchanged: the voice kind is an
11
+ * orchestrator that converts speech↔text at the edges and delegates the
12
+ * "what should the assistant say" decision to the loop. `interruptible` is
13
+ * fixed to `false` this round — barge-in/full-duplex is a follow-up.
14
+ *
15
+ * Provider ids reference `ai/generation` providers (STT:
16
+ * deepgram/openai-transcription/whisper-cpp/faster-whisper; TTS:
17
+ * elevenlabs/openai-tts/bark/coqui-tts). The kind does NOT call any cloud AI
18
+ * directly — it resolves providers through the runtime's generation seam.
19
+ *
20
+ * This file is metadata-only (zod + runtime descriptor schema) and safe to
21
+ * import anywhere, including workerd.
22
+ */
23
+ import * as z from 'zod/v4';
24
+ export declare const VOICE_KIND_ID: "agent/voice";
25
+ /** PCM/container formats the pipeline accepts on the wire. Mirrors the voice-conversation recipe. */
26
+ export declare const VOICE_AUDIO_FORMATS: readonly ["pcm", "wav", "mp3", "opus", "aac", "flac", "webm"];
27
+ export declare const VoiceAudioFormatSchema: z.ZodEnum<{
28
+ pcm: "pcm";
29
+ wav: "wav";
30
+ mp3: "mp3";
31
+ opus: "opus";
32
+ aac: "aac";
33
+ flac: "flac";
34
+ webm: "webm";
35
+ }>;
36
+ export type VoiceAudioFormat = z.infer<typeof VoiceAudioFormatSchema>;
37
+ export declare const AgentVoiceDescriptorSchema: z.ZodObject<{
38
+ id: z.ZodString;
39
+ name: z.ZodOptional<z.ZodString>;
40
+ description: z.ZodOptional<z.ZodString>;
41
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
42
+ hardware: z.ZodOptional<z.ZodArray<z.ZodString>>;
43
+ enabled: z.ZodOptional<z.ZodBoolean>;
44
+ capabilityId: z.ZodOptional<z.ZodString>;
45
+ requiredContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
46
+ optionalContext: z.ZodOptional<z.ZodArray<z.ZodString>>;
47
+ config: z.ZodOptional<z.ZodUnknown>;
48
+ retention: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
49
+ maxAgeDays: z.ZodOptional<z.ZodNumber>;
50
+ maxEntries: z.ZodOptional<z.ZodNumber>;
51
+ maxBytes: z.ZodOptional<z.ZodNumber>;
52
+ cascadeFrom: z.ZodOptional<z.ZodString>;
53
+ ageField: z.ZodOptional<z.ZodString>;
54
+ reason: z.ZodString;
55
+ enforcedBy: z.ZodOptional<z.ZodString>;
56
+ }, z.core.$strip>]>>;
57
+ kind: z.ZodLiteral<"agent/voice">;
58
+ sttProviderId: z.ZodString;
59
+ sttModelId: z.ZodOptional<z.ZodString>;
60
+ ttsProviderId: z.ZodString;
61
+ ttsModelId: z.ZodOptional<z.ZodString>;
62
+ agentLoopId: z.ZodDefault<z.ZodString>;
63
+ sampleRate: z.ZodDefault<z.ZodNumber>;
64
+ audioFormat: z.ZodDefault<z.ZodEnum<{
65
+ pcm: "pcm";
66
+ wav: "wav";
67
+ mp3: "mp3";
68
+ opus: "opus";
69
+ aac: "aac";
70
+ flac: "flac";
71
+ webm: "webm";
72
+ }>>;
73
+ turnTimeoutMs: z.ZodDefault<z.ZodNumber>;
74
+ silenceTimeoutMs: z.ZodDefault<z.ZodNumber>;
75
+ silenceThreshold: z.ZodDefault<z.ZodNumber>;
76
+ interruptible: z.ZodDefault<z.ZodLiteral<false>>;
77
+ priority: z.ZodDefault<z.ZodNumber>;
78
+ }, z.core.$strip>;
79
+ export type AgentVoiceDescriptor = z.infer<typeof AgentVoiceDescriptorSchema>;
80
+ /** Author an `agent/voice` descriptor without restating the kind id. */
81
+ export declare function createAgentVoiceDescriptor(options: Omit<z.input<typeof AgentVoiceDescriptorSchema>, 'kind'>): AgentVoiceDescriptor;
82
+ //# sourceMappingURL=agent-voice.descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-voice.descriptor.d.ts","sourceRoot":"","sources":["../../src/voice/agent-voice.descriptor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,eAAO,MAAM,aAAa,EAAG,aAAsB,CAAC;AAEpD,qGAAqG;AACrG,eAAO,MAAM,mBAAmB,+DAAgE,CAAC;AACjG,eAAO,MAAM,sBAAsB;;;;;;;;EAA8B,CAAC;AAClE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoDrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,wEAAwE;AACxE,wBAAgB,0BAA0B,CACzC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,EAAE,MAAM,CAAC,GAC/D,oBAAoB,CAKtB"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * agent/voice descriptor schema + factory
3
+ *
4
+ * Defines the `agent/voice` runtime kind: a half-duplex (turn-based) voice
5
+ * pipeline that wires three existing seams together —
6
+ *
7
+ * STT (ai/generation transcription) → text → NativeToolsAgentLoop (text-only)
8
+ * → text → TTS (ai/generation tts)
9
+ *
10
+ * The agent loop is left completely unchanged: the voice kind is an
11
+ * orchestrator that converts speech↔text at the edges and delegates the
12
+ * "what should the assistant say" decision to the loop. `interruptible` is
13
+ * fixed to `false` this round — barge-in/full-duplex is a follow-up.
14
+ *
15
+ * Provider ids reference `ai/generation` providers (STT:
16
+ * deepgram/openai-transcription/whisper-cpp/faster-whisper; TTS:
17
+ * elevenlabs/openai-tts/bark/coqui-tts). The kind does NOT call any cloud AI
18
+ * directly — it resolves providers through the runtime's generation seam.
19
+ *
20
+ * This file is metadata-only (zod + runtime descriptor schema) and safe to
21
+ * import anywhere, including workerd.
22
+ */
23
+ import * as z from 'zod/v4';
24
+ import { RuntimeDescriptorSchema } from '@vibesdotdev/kernel/schemas/descriptor';
25
+ export const VOICE_KIND_ID = 'agent/voice';
26
+ /** PCM/container formats the pipeline accepts on the wire. Mirrors the voice-conversation recipe. */
27
+ export const VOICE_AUDIO_FORMATS = ['pcm', 'wav', 'mp3', 'opus', 'aac', 'flac', 'webm'];
28
+ export const VoiceAudioFormatSchema = z.enum(VOICE_AUDIO_FORMATS);
29
+ export const AgentVoiceDescriptorSchema = RuntimeDescriptorSchema.extend({
30
+ kind: z.literal(VOICE_KIND_ID),
31
+ /** ai/generation provider id used for speech→text. */
32
+ sttProviderId: z.string().min(1),
33
+ /** Transcription model id for the STT provider. */
34
+ sttModelId: z.string().min(1).optional(),
35
+ /** ai/generation provider id used for text→speech. */
36
+ ttsProviderId: z.string().min(1),
37
+ /** TTS model id for the TTS provider. */
38
+ ttsModelId: z.string().min(1).optional(),
39
+ /**
40
+ * Agent loop id that drives the text turn. Defaults to the canonical
41
+ * native function loop descriptor. The loop runs text-only and is never
42
+ * modified by the voice kind.
43
+ */
44
+ agentLoopId: z.string().min(1).default('native-function-loop'),
45
+ /** Sample rate of the inbound/outbound PCM stream (Hz). */
46
+ sampleRate: z.number().int().positive().default(16_000),
47
+ /** Wire audio format for the turn frames. */
48
+ audioFormat: VoiceAudioFormatSchema.default('pcm'),
49
+ /**
50
+ * How long the server waits for a turn to complete (silence-terminated
51
+ * utterance → STT → agent → TTS) before timing out. Half-duplex: one turn
52
+ * at a time.
53
+ */
54
+ turnTimeoutMs: z.number().int().positive().default(60_000),
55
+ /**
56
+ * Trailing silence (ms) that terminates an utterance. Server-side silence
57
+ * detection segments the inbound stream into turns.
58
+ */
59
+ silenceTimeoutMs: z.number().int().positive().default(1_200),
60
+ /**
61
+ * Amplitude below which a PCM frame counts as silence (0..1 normalized
62
+ * RMS). Tuned conservatively for 16-bit PCM.
63
+ */
64
+ silenceThreshold: z.number().min(0).max(1).default(0.02),
65
+ /**
66
+ * Fixed `false` this round — half-duplex only. A future full-duplex impl
67
+ * would set this true and add barge-in.
68
+ */
69
+ interruptible: z.literal(false).default(false),
70
+ priority: z.number().int().default(100)
71
+ });
72
+ /** Author an `agent/voice` descriptor without restating the kind id. */
73
+ export function createAgentVoiceDescriptor(options) {
74
+ return AgentVoiceDescriptorSchema.parse({
75
+ ...options,
76
+ kind: VOICE_KIND_ID
77
+ });
78
+ }
79
+ //# sourceMappingURL=agent-voice.descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-voice.descriptor.js","sourceRoot":"","sources":["../../src/voice/agent-voice.descriptor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAEjF,MAAM,CAAC,MAAM,aAAa,GAAG,aAAsB,CAAC;AAEpD,qGAAqG;AACrG,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AACjG,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;AAGlE,MAAM,CAAC,MAAM,0BAA0B,GAAG,uBAAuB,CAAC,MAAM,CAAC;IACxE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAE9B,sDAAsD;IACtD,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAChC,mDAAmD;IACnD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAExC,sDAAsD;IACtD,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAChC,yCAAyC;IACzC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAExC;;;;OAIG;IACH,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC;IAE9D,2DAA2D;IAC3D,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;IAEvD,6CAA6C;IAC7C,WAAW,EAAE,sBAAsB,CAAC,OAAO,CAAC,KAAK,CAAC;IAElD;;;;OAIG;IACH,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;IAE1D;;;OAGG;IACH,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAE5D;;;OAGG;IACH,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IAExD;;;OAGG;IACH,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IAE9C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC;CACvC,CAAC,CAAC;AAIH,wEAAwE;AACxE,MAAM,UAAU,0BAA0B,CACzC,OAAiE;IAEjE,OAAO,0BAA0B,CAAC,KAAK,CAAC;QACvC,GAAG,OAAO;QACV,IAAI,EAAE,aAAa;KACnB,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * agent/voice — local (consumer) implementation.
3
+ *
4
+ * `hardware:['consumer']`. Holds the validated descriptor and exposes a
5
+ * half-duplex *session* that the transport drives:
6
+ *
7
+ * - `pushFrame(pcm)` — feed an inbound PCM frame; server-side silence
8
+ * detection segments turns. When an utterance completes, the session runs
9
+ * STT → agent loop → TTS via the injected {@link VoicePipelineDeps} and
10
+ * returns the turn result (transcript + reply text + synthesized audio).
11
+ * - `submitUtterance(audio)` — for transports that pre-segment (e.g. the
12
+ * POST turn endpoint), skip silence detection and run the turn directly.
13
+ *
14
+ * Conversation history is in-memory per session (MVP). The agent loop itself
15
+ * is untouched — the session only converts speech↔text at the edges.
16
+ *
17
+ * workerd-safe: depends on the runtime + ai schemas + the dependency-injected
18
+ * pipeline. No Node-only imports.
19
+ */
20
+ import type { KindContext } from '@vibesdotdev/kernel/schemas/kind';
21
+ import type { RuntimeDescriptor } from '@vibesdotdev/kernel/schemas/descriptor';
22
+ import { type AgentVoiceDescriptor } from './agent-voice.descriptor.ts';
23
+ import type { VoicePipelineDeps } from './pipeline.ts';
24
+ import { VoiceSession } from './session.ts';
25
+ export { VoiceSession } from './session.ts';
26
+ export declare class ConsumerAgentVoice {
27
+ readonly descriptor: AgentVoiceDescriptor;
28
+ /** The resolving runtime owns logging, clocks, cancellation and every turn's bounded wait. */
29
+ private readonly runtime;
30
+ constructor(descriptor: RuntimeDescriptor | AgentVoiceDescriptor, context: KindContext);
31
+ /** Open a half-duplex session bound to the injected STT/agent/TTS stages. */
32
+ createSession(deps: VoicePipelineDeps, systemPrompt?: string): VoiceSession;
33
+ }
34
+ export default ConsumerAgentVoice;
35
+ //# sourceMappingURL=agent-voice.impl.consumer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-voice.impl.consumer.d.ts","sourceRoot":"","sources":["../../src/voice/agent-voice.impl.consumer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAEN,KAAK,oBAAoB,EACzB,MAAM,6BAA6B,CAAC;AAIrC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,qBAAa,kBAAkB;IAC9B,QAAQ,CAAC,UAAU,EAAE,oBAAoB,CAAC;IAC1C,8FAA8F;IAC9F,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAa;gBAEzB,UAAU,EAAE,iBAAiB,GAAG,oBAAoB,EAAE,OAAO,EAAE,WAAW;IAStF,6EAA6E;IAC7E,aAAa,CAAC,IAAI,EAAE,iBAAiB,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,YAAY;CAO3E;AAED,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * agent/voice — local (consumer) implementation.
3
+ *
4
+ * `hardware:['consumer']`. Holds the validated descriptor and exposes a
5
+ * half-duplex *session* that the transport drives:
6
+ *
7
+ * - `pushFrame(pcm)` — feed an inbound PCM frame; server-side silence
8
+ * detection segments turns. When an utterance completes, the session runs
9
+ * STT → agent loop → TTS via the injected {@link VoicePipelineDeps} and
10
+ * returns the turn result (transcript + reply text + synthesized audio).
11
+ * - `submitUtterance(audio)` — for transports that pre-segment (e.g. the
12
+ * POST turn endpoint), skip silence detection and run the turn directly.
13
+ *
14
+ * Conversation history is in-memory per session (MVP). The agent loop itself
15
+ * is untouched — the session only converts speech↔text at the edges.
16
+ *
17
+ * workerd-safe: depends on the runtime + ai schemas + the dependency-injected
18
+ * pipeline. No Node-only imports.
19
+ */
20
+ import {} from '@vibesdotdev/kernel';
21
+ import { AgentVoiceDescriptorSchema } from "./agent-voice.descriptor.js";
22
+ import { tryGetVibesClient } from '@vibesdotdev/kernel/client';
23
+ import { CapabilityError } from '@vibesdotdev/kernel';
24
+ import { VoiceClient, voiceClientDescriptor } from "./client.js";
25
+ import { VoiceSession } from "./session.js";
26
+ export { VoiceSession } from "./session.js";
27
+ export class ConsumerAgentVoice {
28
+ descriptor;
29
+ /** The resolving runtime owns logging, clocks, cancellation and every turn's bounded wait. */
30
+ runtime;
31
+ constructor(descriptor, context) {
32
+ // Defensive parse so a hand-authored descriptor still validates here even
33
+ // if it skipped the factory. Constructor shape `(descriptor, context)`
34
+ // matches the kind's default-implementation contract so the runtime can
35
+ // build this either via the loader or the kind default.
36
+ this.descriptor = AgentVoiceDescriptorSchema.parse(descriptor);
37
+ this.runtime = context.runtime;
38
+ }
39
+ /** Open a half-duplex session bound to the injected STT/agent/TTS stages. */
40
+ createSession(deps, systemPrompt) {
41
+ const client = tryGetVibesClient(voiceClientDescriptor.id, this.runtime);
42
+ if (!client)
43
+ throw new CapabilityError('The voice runtime is unavailable.', 'UNAVAILABLE', {
44
+ reason: 'voice-session-closed', retryable: false
45
+ });
46
+ return client.createSession(this.descriptor, deps, systemPrompt);
47
+ }
48
+ }
49
+ export default ConsumerAgentVoice;
50
+ //# sourceMappingURL=agent-voice.impl.consumer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-voice.impl.consumer.js","sourceRoot":"","sources":["../../src/voice/agent-voice.impl.consumer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAmB,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EACN,0BAA0B,EAE1B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,OAAO,kBAAkB;IACrB,UAAU,CAAuB;IAC1C,8FAA8F;IAC7E,OAAO,CAAa;IAErC,YAAY,UAAoD,EAAE,OAAoB;QACrF,0EAA0E;QAC1E,uEAAuE;QACvE,wEAAwE;QACxE,wDAAwD;QACxD,IAAI,CAAC,UAAU,GAAG,0BAA0B,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC/D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAChC,CAAC;IAED,6EAA6E;IAC7E,aAAa,CAAC,IAAuB,EAAE,YAAqB;QAC3D,MAAM,MAAM,GAAG,iBAAiB,CAAc,qBAAqB,CAAC,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACtF,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,eAAe,CAAC,mCAAmC,EAAE,aAAa,EAAE;gBAC1F,MAAM,EAAE,sBAAsB,EAAE,SAAS,EAAE,KAAK;aAChD,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;IAClE,CAAC;CACD;AAED,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * `agent/voice` runtime kind descriptor record.
3
+ *
4
+ * Plain `RuntimeKindDescriptorRecord` registered via the agent-voice plugin's
5
+ * `kinds:[...]` — mirrors `agents/src/runtime-kinds.ts`. The kind has
6
+ * a `defaultImplementation` that simply parses + holds the descriptor (the
7
+ * live behavior is in the consumer impl, registered as a loader with
8
+ * `hardware:['consumer']`). Resolution is the runtime default (hardware +
9
+ * priority); no custom resolver is needed.
10
+ */
11
+ import type { KindContext } from '@vibesdotdev/kernel/schemas/kind';
12
+ import type { RuntimeDescriptor } from '@vibesdotdev/kernel/schemas/descriptor';
13
+ import { type AgentVoiceDescriptor } from './agent-voice.descriptor.ts';
14
+ declare class DefaultAgentVoice {
15
+ readonly descriptor: AgentVoiceDescriptor;
16
+ constructor(descriptor: RuntimeDescriptor, _context: KindContext);
17
+ }
18
+ export declare const agentVoiceKind: {
19
+ id: "agent/voice";
20
+ descriptorSchema: import("zod/v4").ZodObject<{
21
+ id: import("zod/v4").ZodString;
22
+ name: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
23
+ description: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
24
+ tags: import("zod/v4").ZodOptional<import("zod/v4").ZodArray<import("zod/v4").ZodString>>;
25
+ hardware: import("zod/v4").ZodOptional<import("zod/v4").ZodArray<import("zod/v4").ZodString>>;
26
+ enabled: import("zod/v4").ZodOptional<import("zod/v4").ZodBoolean>;
27
+ capabilityId: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
28
+ requiredContext: import("zod/v4").ZodOptional<import("zod/v4").ZodArray<import("zod/v4").ZodString>>;
29
+ optionalContext: import("zod/v4").ZodOptional<import("zod/v4").ZodArray<import("zod/v4").ZodString>>;
30
+ config: import("zod/v4").ZodOptional<import("zod/v4").ZodUnknown>;
31
+ retention: import("zod/v4").ZodOptional<import("zod/v4").ZodUnion<readonly [import("zod/v4").ZodString, import("zod/v4").ZodObject<{
32
+ maxAgeDays: import("zod/v4").ZodOptional<import("zod/v4").ZodNumber>;
33
+ maxEntries: import("zod/v4").ZodOptional<import("zod/v4").ZodNumber>;
34
+ maxBytes: import("zod/v4").ZodOptional<import("zod/v4").ZodNumber>;
35
+ cascadeFrom: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
36
+ ageField: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
37
+ reason: import("zod/v4").ZodString;
38
+ enforcedBy: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
39
+ }, import("zod/v4/core").$strip>]>>;
40
+ kind: import("zod/v4").ZodLiteral<"agent/voice">;
41
+ sttProviderId: import("zod/v4").ZodString;
42
+ sttModelId: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
43
+ ttsProviderId: import("zod/v4").ZodString;
44
+ ttsModelId: import("zod/v4").ZodOptional<import("zod/v4").ZodString>;
45
+ agentLoopId: import("zod/v4").ZodDefault<import("zod/v4").ZodString>;
46
+ sampleRate: import("zod/v4").ZodDefault<import("zod/v4").ZodNumber>;
47
+ audioFormat: import("zod/v4").ZodDefault<import("zod/v4").ZodEnum<{
48
+ pcm: "pcm";
49
+ wav: "wav";
50
+ mp3: "mp3";
51
+ opus: "opus";
52
+ aac: "aac";
53
+ flac: "flac";
54
+ webm: "webm";
55
+ }>>;
56
+ turnTimeoutMs: import("zod/v4").ZodDefault<import("zod/v4").ZodNumber>;
57
+ silenceTimeoutMs: import("zod/v4").ZodDefault<import("zod/v4").ZodNumber>;
58
+ silenceThreshold: import("zod/v4").ZodDefault<import("zod/v4").ZodNumber>;
59
+ interruptible: import("zod/v4").ZodDefault<import("zod/v4").ZodLiteral<false>>;
60
+ priority: import("zod/v4").ZodDefault<import("zod/v4").ZodNumber>;
61
+ }, import("zod/v4/core").$strip>;
62
+ defaultImplementation: typeof DefaultAgentVoice;
63
+ resolve: (candidates: RuntimeDescriptor[]) => RuntimeDescriptor | undefined;
64
+ contexts: never[];
65
+ };
66
+ export default agentVoiceKind;
67
+ //# sourceMappingURL=agent-voice.kind.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-voice.kind.d.ts","sourceRoot":"","sources":["../../src/voice/agent-voice.kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAGN,KAAK,oBAAoB,EACzB,MAAM,6BAA6B,CAAC;AAErC,cAAM,iBAAiB;IACtB,QAAQ,CAAC,UAAU,EAAE,oBAAoB,CAAC;gBAC9B,UAAU,EAAE,iBAAiB,EAAE,QAAQ,EAAE,WAAW;CAGhE;AAED,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAIJ,iBAAiB,EAAE,KAAG,iBAAiB,GAAG,SAAS;;CAEzE,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * `agent/voice` runtime kind descriptor record.
3
+ *
4
+ * Plain `RuntimeKindDescriptorRecord` registered via the agent-voice plugin's
5
+ * `kinds:[...]` — mirrors `agents/src/runtime-kinds.ts`. The kind has
6
+ * a `defaultImplementation` that simply parses + holds the descriptor (the
7
+ * live behavior is in the consumer impl, registered as a loader with
8
+ * `hardware:['consumer']`). Resolution is the runtime default (hardware +
9
+ * priority); no custom resolver is needed.
10
+ */
11
+ import { AgentVoiceDescriptorSchema, VOICE_KIND_ID } from "./agent-voice.descriptor.js";
12
+ class DefaultAgentVoice {
13
+ descriptor;
14
+ constructor(descriptor, _context) {
15
+ this.descriptor = AgentVoiceDescriptorSchema.parse(descriptor);
16
+ }
17
+ }
18
+ export const agentVoiceKind = {
19
+ id: VOICE_KIND_ID,
20
+ descriptorSchema: AgentVoiceDescriptorSchema,
21
+ defaultImplementation: DefaultAgentVoice,
22
+ resolve: (candidates) => candidates[0],
23
+ contexts: []
24
+ };
25
+ export default agentVoiceKind;
26
+ //# sourceMappingURL=agent-voice.kind.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-voice.kind.js","sourceRoot":"","sources":["../../src/voice/agent-voice.kind.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EACN,0BAA0B,EAC1B,aAAa,EAEb,MAAM,6BAA6B,CAAC;AAErC,MAAM,iBAAiB;IACb,UAAU,CAAuB;IAC1C,YAAY,UAA6B,EAAE,QAAqB;QAC/D,IAAI,CAAC,UAAU,GAAG,0BAA0B,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAChE,CAAC;CACD;AAED,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B,EAAE,EAAE,aAAa;IACjB,gBAAgB,EAAE,0BAA0B;IAC5C,qBAAqB,EAAE,iBAAiB;IACxC,OAAO,EAAE,CAAC,UAA+B,EAAiC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAC1F,QAAQ,EAAE,EAAE;CACZ,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,4 @@
1
+ /** Universal voice kind and semantic client; consumer loaders have their own slice. */
2
+ export declare const agentVoicePlugin: import("@vibesdotdev/kernel").RuntimePlugin;
3
+ export default agentVoicePlugin;
4
+ //# sourceMappingURL=agent-voice.plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-voice.plugin.d.ts","sourceRoot":"","sources":["../../src/voice/agent-voice.plugin.ts"],"names":[],"mappings":"AAKA,uFAAuF;AACvF,eAAO,MAAM,gBAAgB,6CAU3B,CAAC;AAEH,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { createRuntimePlugin, loader } from '@vibesdotdev/kernel';
2
+ import { getVibesClient } from '@vibesdotdev/kernel/client';
3
+ import { agentVoiceKind } from "./agent-voice.kind.js";
4
+ import { voiceClientDescriptor } from "./client.js";
5
+ /** Universal voice kind and semantic client; consumer loaders have their own slice. */
6
+ export const agentVoicePlugin = createRuntimePlugin({
7
+ id: 'agent-voice',
8
+ name: 'Agent Voice',
9
+ dependencies: ['runtime-client'],
10
+ kinds: [agentVoiceKind],
11
+ descriptors: [voiceClientDescriptor],
12
+ loaders: [loader(voiceClientDescriptor.id, { kind: 'runtime/client' }, () => import("./client.js"))],
13
+ async onRegister(runtime) {
14
+ await getVibesClient(voiceClientDescriptor.id, runtime);
15
+ }
16
+ });
17
+ export default agentVoicePlugin;
18
+ //# sourceMappingURL=agent-voice.plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-voice.plugin.js","sourceRoot":"","sources":["../../src/voice/agent-voice.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAoB,MAAM,aAAa,CAAC;AAEtE,uFAAuF;AACvF,MAAM,CAAC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;IACnD,EAAE,EAAE,aAAa;IACjB,IAAI,EAAE,aAAa;IACnB,YAAY,EAAE,CAAC,gBAAgB,CAAC;IAChC,KAAK,EAAE,CAAC,cAAc,CAAC;IACvB,WAAW,EAAE,CAAC,qBAAqB,CAAC;IACpC,OAAO,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;IACpG,KAAK,CAAC,UAAU,CAAC,OAAO;QACvB,MAAM,cAAc,CAAc,qBAAqB,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;CACD,CAAC,CAAC;AAEH,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { BaseRuntimeClient } from '@vibesdotdev/kernel/client';
2
+ import type { AgentVoiceDescriptor } from './agent-voice.descriptor.ts';
3
+ import type { VoicePipelineDeps } from './pipeline.ts';
4
+ import { VoiceSession } from './session.ts';
5
+ export declare const voiceClientDescriptor: {
6
+ id: string;
7
+ kind: "runtime/client";
8
+ name?: string | undefined;
9
+ tags?: string[] | undefined;
10
+ hardware?: string[] | undefined;
11
+ enabled?: boolean | undefined;
12
+ priority?: number | undefined;
13
+ capabilityId?: string | undefined;
14
+ requiredContext?: string[] | undefined;
15
+ optionalContext?: string[] | undefined;
16
+ config?: unknown;
17
+ retention?: string | {
18
+ reason: string;
19
+ maxAgeDays?: number | undefined;
20
+ maxEntries?: number | undefined;
21
+ maxBytes?: number | undefined;
22
+ cascadeFrom?: string | undefined;
23
+ ageField?: string | undefined;
24
+ enforcedBy?: string | undefined;
25
+ } | undefined;
26
+ configManifestId?: string | undefined;
27
+ baseUrl?: string | undefined;
28
+ description?: string | undefined;
29
+ };
30
+ /** Owns voice sessions for one runtime and closes them with that runtime. */
31
+ export declare class VoiceClient extends BaseRuntimeClient {
32
+ private readonly sessions;
33
+ private closed;
34
+ createSession(descriptor: AgentVoiceDescriptor, deps: VoicePipelineDeps, systemPrompt?: string): VoiceSession;
35
+ protected onDispose(): void;
36
+ }
37
+ export default VoiceClient;
38
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/voice/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiC,MAAM,4BAA4B,CAAC;AAE9F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;CAEhC,CAAC;AAEH,6EAA6E;AAC7E,qBAAa,WAAY,SAAQ,iBAAiB;IACjD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA2B;IACpD,OAAO,CAAC,MAAM,CAAS;IAEvB,aAAa,CAAC,UAAU,EAAE,oBAAoB,EAAE,IAAI,EAAE,iBAAiB,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,YAAY;cAW1F,SAAS,IAAI,IAAI;CAKpC;AAED,eAAe,WAAW,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { BaseRuntimeClient, RuntimeClientDescriptorSchema } from '@vibesdotdev/kernel/client';
2
+ import { CapabilityError } from '@vibesdotdev/kernel';
3
+ import { VoiceSession } from "./session.js";
4
+ export const voiceClientDescriptor = RuntimeClientDescriptorSchema.parse({
5
+ id: 'agent-voice', kind: 'runtime/client', name: 'Agent Voice'
6
+ });
7
+ /** Owns voice sessions for one runtime and closes them with that runtime. */
8
+ export class VoiceClient extends BaseRuntimeClient {
9
+ sessions = new Set();
10
+ closed = false;
11
+ createSession(descriptor, deps, systemPrompt) {
12
+ if (this.closed || this.runtime.lifecycle.signal.aborted) {
13
+ throw new CapabilityError('The voice runtime is closed.', 'UNAVAILABLE', {
14
+ reason: 'voice-session-closed', retryable: false
15
+ });
16
+ }
17
+ const session = new VoiceSession(this.runtime, descriptor, deps, systemPrompt, () => this.sessions.delete(session));
18
+ this.sessions.add(session);
19
+ return session;
20
+ }
21
+ onDispose() {
22
+ this.closed = true;
23
+ for (const session of this.sessions)
24
+ session.close();
25
+ this.sessions.clear();
26
+ }
27
+ }
28
+ export default VoiceClient;
29
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/voice/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,CAAC,MAAM,qBAAqB,GAAG,6BAA6B,CAAC,KAAK,CAAC;IACxE,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,aAAa;CAC9D,CAAC,CAAC;AAEH,6EAA6E;AAC7E,MAAM,OAAO,WAAY,SAAQ,iBAAiB;IAChC,QAAQ,GAAG,IAAI,GAAG,EAAgB,CAAC;IAC5C,MAAM,GAAG,KAAK,CAAC;IAEvB,aAAa,CAAC,UAAgC,EAAE,IAAuB,EAAE,YAAqB;QAC7F,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YAC1D,MAAM,IAAI,eAAe,CAAC,8BAA8B,EAAE,aAAa,EAAE;gBACxE,MAAM,EAAE,sBAAsB,EAAE,SAAS,EAAE,KAAK;aAChD,CAAC,CAAC;QACJ,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;QACpH,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC3B,OAAO,OAAO,CAAC;IAChB,CAAC;IAEkB,SAAS;QAC3B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO,CAAC,KAAK,EAAE,CAAC;QACrD,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;CACD;AAED,eAAe,WAAW,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @vibesdotdev/agent-execution/voice
3
+ *
4
+ * Half-duplex voice pipeline for the `agent/voice` runtime kind.
5
+ * STT -> text -> NativeToolsAgentLoop (text-only) -> text -> TTS.
6
+ */
7
+ export { VOICE_KIND_ID, VOICE_AUDIO_FORMATS, VoiceAudioFormatSchema, AgentVoiceDescriptorSchema, createAgentVoiceDescriptor, type VoiceAudioFormat, type AgentVoiceDescriptor } from './agent-voice.descriptor.ts';
8
+ export { VoiceClient, voiceClientDescriptor } from './client.ts';
9
+ export { VoiceSession } from './session.ts';
10
+ export { agentVoiceKind } from './agent-voice.kind.ts';
11
+ export { consumerAgentVoiceDescriptor } from './agent-voice.consumer.descriptor.ts';
12
+ export { agentVoicePlugin, default } from './agent-voice.plugin.ts';
13
+ export { runVoiceTurn, pcm16Rms, SilenceSegmenter, VoiceMetadataSchema, VoiceTurnAudioSchema, VoiceTranscriptSchema, VoiceReplySchema, VoiceSynthesisSchema, VoiceHistoryMessageSchema, VoiceSystemPromptSchema, VoiceTurnResultSchema, VoiceTurnTimingSchema, parseVoiceSystemPrompt, type VoicePipelineDeps, type VoiceMetadata, type VoiceTurnAudio, type VoiceTranscript, type VoiceReply, type VoiceSynthesis, type VoiceHistoryMessage, type VoiceTurnResult } from './pipeline.ts';
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/voice/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACN,aAAa,EACb,mBAAmB,EACnB,sBAAsB,EACtB,0BAA0B,EAC1B,0BAA0B,EAC1B,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EACN,4BAA4B,EAC5B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEpE,OAAO,EACN,YAAY,EACZ,QAAQ,EACR,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,MAAM,eAAe,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @vibesdotdev/agent-execution/voice
3
+ *
4
+ * Half-duplex voice pipeline for the `agent/voice` runtime kind.
5
+ * STT -> text -> NativeToolsAgentLoop (text-only) -> text -> TTS.
6
+ */
7
+ export { VOICE_KIND_ID, VOICE_AUDIO_FORMATS, VoiceAudioFormatSchema, AgentVoiceDescriptorSchema, createAgentVoiceDescriptor } from "./agent-voice.descriptor.js";
8
+ export { VoiceClient, voiceClientDescriptor } from "./client.js";
9
+ export { VoiceSession } from "./session.js";
10
+ export { agentVoiceKind } from "./agent-voice.kind.js";
11
+ export { consumerAgentVoiceDescriptor } from "./agent-voice.consumer.descriptor.js";
12
+ export { agentVoicePlugin, default } from "./agent-voice.plugin.js";
13
+ export { runVoiceTurn, pcm16Rms, SilenceSegmenter, VoiceMetadataSchema, VoiceTurnAudioSchema, VoiceTranscriptSchema, VoiceReplySchema, VoiceSynthesisSchema, VoiceHistoryMessageSchema, VoiceSystemPromptSchema, VoiceTurnResultSchema, VoiceTurnTimingSchema, parseVoiceSystemPrompt } from "./pipeline.js";
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/voice/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACN,aAAa,EACb,mBAAmB,EACnB,sBAAsB,EACtB,0BAA0B,EAC1B,0BAA0B,EAG1B,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EACN,4BAA4B,EAC5B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEpE,OAAO,EACN,YAAY,EACZ,QAAQ,EACR,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EAStB,MAAM,eAAe,CAAC"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Half-duplex voice pipeline — the engine behind the `agent/voice` kind.
3
+ *
4
+ * One *turn* = one user utterance → one assistant reply:
5
+ *
6
+ * audio (PCM/encoded) ──STT──▶ transcript ──agent loop──▶ reply text ──TTS──▶ audio
7
+ *
8
+ * The pipeline is deliberately **dependency-injected**: STT, the text turn
9
+ * (agent loop), and TTS are passed in as async functions. The host (the
10
+ * chat-web voice route) resolves those from the runtime's `ai/generation`
11
+ * providers + the agent loop, so this package stays workerd-safe — it never
12
+ * imports `@vibesdotdev/filesystem`, Playwright, or any Node-only generation
13
+ * executor. It only depends on the runtime + ai *schemas*.
14
+ *
15
+ * Server-side silence detection (`SilenceSegmenter`) lives here so both the
16
+ * WS/POST transport and any future full-duplex transport can reuse the same
17
+ * turn-boundary logic.
18
+ */
19
+ import { type RuntimeRef } from '@vibesdotdev/kernel';
20
+ import { type AgentVoiceDescriptor } from './agent-voice.descriptor.ts';
21
+ import { type VoiceTurnAudio, type VoiceHistoryMessage, type VoiceTurnResult, type VoicePipelineDeps } from '../schemas/voice.ts';
22
+ export { VoiceMetadataSchema, VoiceTurnAudioSchema, VoiceTranscriptSchema, VoiceReplySchema, VoiceSynthesisSchema, VoiceHistoryMessageSchema, VoiceHistorySchema, VoiceAbortSignalSchema, VoiceSystemPromptSchema, VoiceTurnTimingSchema, VoiceTurnResultSchema, VoicePipelineDepsSchema, type VoiceMetadata, type VoiceTurnAudio, type VoiceTranscript, type VoiceReply, type VoiceSynthesis, type VoiceHistoryMessage, type VoiceTurnResult, type VoicePipelineDeps } from '../schemas/voice.ts';
23
+ export declare function parseVoiceSystemPrompt<TInput>(value: TInput): string;
24
+ /**
25
+ * Run a single half-duplex turn under the descriptor's `turnTimeoutMs`, a hard
26
+ * ceiling over the whole STT→agent→TTS chain. The ceiling is the owning
27
+ * runtime's bounded wait (RC07): `runtime` is the runtime the host was handed,
28
+ * so disposing that runtime aborts the turn and
29
+ * no timer outlives it. Every stage receives the one combined signal (the
30
+ * caller's, the runtime's and the deadline). Exceeding the ceiling rejects
31
+ * `CapabilityError` `voice-turn-timeout`.
32
+ */
33
+ export declare function runVoiceTurn(runtime: RuntimeRef, descriptor: AgentVoiceDescriptor, deps: VoicePipelineDeps, audio: VoiceTurnAudio, history: VoiceHistoryMessage[], externalSignal?: AbortSignal): Promise<VoiceTurnResult>;
34
+ /**
35
+ * RMS amplitude of a 16-bit little-endian PCM frame, normalized to 0..1.
36
+ * Used by the silence segmenter. For non-PCM (encoded) frames the caller
37
+ * should not rely on this — silence detection is a PCM-stream concern.
38
+ */
39
+ export declare function pcm16Rms(bytes: Uint8Array): number;
40
+ /**
41
+ * Server-side silence detection that segments an inbound PCM stream into turns.
42
+ *
43
+ * Feed frames as they arrive via {@link push}; when trailing silence exceeds
44
+ * `silenceTimeoutMs` after at least one voiced frame, {@link push} returns the
45
+ * concatenated utterance bytes (and resets). This is the half-duplex turn
46
+ * boundary: one completed utterance → one agent turn.
47
+ */
48
+ export declare class SilenceSegmenter {
49
+ private readonly frames;
50
+ private bytesBuffered;
51
+ private hasVoiced;
52
+ private silenceAccumulatedMs;
53
+ private readonly threshold;
54
+ private readonly silenceTimeoutMs;
55
+ private readonly bytesPerMs;
56
+ constructor(descriptor: Pick<AgentVoiceDescriptor, 'silenceThreshold' | 'silenceTimeoutMs' | 'sampleRate'>);
57
+ /**
58
+ * Push a PCM frame. Returns the completed utterance bytes when trailing
59
+ * silence terminates a turn, otherwise `null`.
60
+ */
61
+ push(frame: Uint8Array): Uint8Array | null;
62
+ /** Force-close the current utterance (e.g. transport closed). */
63
+ flush(): Uint8Array | null;
64
+ private reset;
65
+ }
66
+ //# sourceMappingURL=pipeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/voice/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAMN,KAAK,UAAU,EAEf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEN,KAAK,oBAAoB,EACzB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EASN,KAAK,cAAc,EAInB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,MAAM,qBAAqB,CAAC;AAE7B,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAWpE;AAsCD;;;;;;;;GAQG;AACH,wBAAsB,YAAY,CACjC,OAAO,EAAE,UAAU,EACnB,UAAU,EAAE,oBAAoB,EAChC,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,mBAAmB,EAAE,EAC9B,cAAc,CAAC,EAAE,WAAW,GAC1B,OAAO,CAAC,eAAe,CAAC,CA0I1B;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAElD;AAcD;;;;;;;GAOG;AACH,qBAAa,gBAAgB;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAC3C,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,oBAAoB,CAAK;IACjC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;IAC1C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;gBAExB,UAAU,EAAE,IAAI,CAAC,oBAAoB,EAAE,kBAAkB,GAAG,kBAAkB,GAAG,YAAY,CAAC;IAwB1G;;;OAGG;IACH,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI;IA0B1C,iEAAiE;IACjE,KAAK,IAAI,UAAU,GAAG,IAAI;IAe1B,OAAO,CAAC,KAAK;CAMb"}