@absolutejs/voice 0.0.4 → 0.0.5

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/README.md CHANGED
@@ -62,12 +62,10 @@ app.use(
62
62
  voice({
63
63
  path: '/voice/intake',
64
64
  htmx: {
65
- render: {
66
- result: ({ result }) =>
67
- result
68
- ? `<pre>${JSON.stringify(result, null, 2)}</pre>`
69
- : '<p>No structured result yet.</p>'
70
- }
65
+ result: ({ result }) =>
66
+ result
67
+ ? `<pre>${JSON.stringify(result, null, 2)}</pre>`
68
+ : '<p>No structured result yet.</p>'
71
69
  },
72
70
  onComplete: async () => {},
73
71
  onTurn: async ({ turn }) => ({
package/dist/index.js CHANGED
@@ -680,7 +680,7 @@ var voice = (config) => {
680
680
  };
681
681
  const htmxConfig = typeof config.htmx === "object" ? config.htmx : undefined;
682
682
  const htmxRoute = htmxConfig?.route ?? `${config.path}/htmx/session`;
683
- const htmxRenderers = resolveVoiceHTMXRenderers(htmxConfig?.render);
683
+ const htmxRenderers = resolveVoiceHTMXRenderers(htmxConfig);
684
684
  const htmxTargets = resolveVoiceHTMXTargets(htmxConfig?.targets);
685
685
  const htmxRoutes = () => {
686
686
  if (!config.htmx) {
package/dist/types.d.ts CHANGED
@@ -182,7 +182,7 @@ export type VoiceRouteConfig<TContext = unknown, TSession extends VoiceSessionRe
182
182
  onTurn: (input: {
183
183
  context: TContext;
184
184
  session: TSession;
185
- turn: VoiceTurnRecord<TResult>;
185
+ turn: VoiceTurnRecord;
186
186
  api: VoiceSessionHandle<TContext, TSession, TResult>;
187
187
  }) => Promise<VoiceRouteResult<TResult> | void> | VoiceRouteResult<TResult> | void;
188
188
  onComplete: (input: {
@@ -306,8 +306,7 @@ export type VoiceHTMXTargets = {
306
306
  status: string;
307
307
  turns: string;
308
308
  };
309
- export type VoiceHTMXConfig<TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
310
- render?: VoiceHTMXRenderConfig<TSession, TResult>;
309
+ export type VoiceHTMXConfig<TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = VoiceHTMXRenderConfig<TSession, TResult> & {
311
310
  route?: string;
312
311
  targets?: Partial<VoiceHTMXTargets>;
313
312
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",