@mux/ai 0.12.0 → 0.12.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.
@@ -43,8 +43,8 @@ interface Question {
43
43
  interface QuestionAnswer {
44
44
  /** The original question */
45
45
  question: string;
46
- /** Answer selected from the allowed options. Undefined when skipped. */
47
- answer?: string;
46
+ /** Answer selected from the allowed options. Null when skipped. */
47
+ answer: string | null;
48
48
  /** Confidence score between 0 and 1. Always 0 when skipped. */
49
49
  confidence: number;
50
50
  /** Reasoning explaining the answer, or why the question was skipped */
@@ -87,22 +87,22 @@ interface AskQuestionsResult {
87
87
  /** Zod schema for a single answer (matches the public QuestionAnswer interface). */
88
88
  declare const questionAnswerSchema: z.ZodObject<{
89
89
  question: z.ZodString;
90
- answer: z.ZodOptional<z.ZodString>;
90
+ answer: z.ZodNullable<z.ZodString>;
91
91
  confidence: z.ZodNumber;
92
92
  reasoning: z.ZodString;
93
93
  skipped: z.ZodBoolean;
94
94
  }, "strip", z.ZodTypeAny, {
95
95
  question: string;
96
+ answer: string | null;
96
97
  confidence: number;
97
98
  reasoning: string;
98
99
  skipped: boolean;
99
- answer?: string | undefined;
100
100
  }, {
101
101
  question: string;
102
+ answer: string | null;
102
103
  confidence: number;
103
104
  reasoning: string;
104
105
  skipped: boolean;
105
- answer?: string | undefined;
106
106
  }>;
107
107
  type QuestionAnswerType = z.infer<typeof questionAnswerSchema>;
108
108
  declare function createAskQuestionsSchema(allowedAnswers: [string, ...string[]]): z.ZodObject<{
package/dist/index.d.ts CHANGED
@@ -2,14 +2,14 @@ import { W as WorkflowCredentials, S as StoragePutObjectInput, a as StoragePresi
2
2
  export { A as AssetTextTrack, C as ChunkEmbedding, b as ChunkingStrategy, E as Encrypted, c as EncryptedPayload, I as ImageSubmissionMode, M as MuxAIOptions, d as MuxAsset, P as PlaybackAsset, e as PlaybackPolicy, f as StorageAdapter, T as TextChunk, g as TokenChunkingConfig, h as TokenUsage, i as ToneType, U as UsageMetadata, V as VTTChunkingConfig, j as VideoEmbeddingsResult, k as WorkflowCredentialsInput, l as WorkflowMuxClient, m as decryptFromWorkflow, n as encryptForWorkflow } from './types-BRbaGW3t.js';
3
3
  import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from '@workflow/serde';
4
4
  export { i as primitives } from './index-DLhfJsOd.js';
5
- export { i as workflows } from './index-DyzifniY.js';
5
+ export { i as workflows } from './index-B6IY5dhq.js';
6
6
  import '@mux/mux-node';
7
7
  import 'zod';
8
8
  import '@ai-sdk/anthropic';
9
9
  import '@ai-sdk/google';
10
10
  import '@ai-sdk/openai';
11
11
 
12
- var version = "0.12.0";
12
+ var version = "0.12.1";
13
13
 
14
14
  /**
15
15
  * A function that returns workflow credentials, either synchronously or asynchronously.
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ var __export = (target, all) => {
5
5
  };
6
6
 
7
7
  // package.json
8
- var version = "0.12.0";
8
+ var version = "0.12.1";
9
9
 
10
10
  // src/env.ts
11
11
  import { z } from "zod";
@@ -2241,7 +2241,7 @@ async function withRetry(fn, {
2241
2241
  // src/workflows/ask-questions.ts
2242
2242
  var questionAnswerSchema = z2.object({
2243
2243
  question: z2.string(),
2244
- answer: z2.string().optional(),
2244
+ answer: z2.string().nullable(),
2245
2245
  confidence: z2.number(),
2246
2246
  reasoning: z2.string(),
2247
2247
  skipped: z2.boolean()
@@ -2519,7 +2519,7 @@ async function askQuestions(assetId, questions, options) {
2519
2519
  confidence: isSkipped ? 0 : Math.min(1, Math.max(0, raw.confidence)),
2520
2520
  reasoning: raw.reasoning,
2521
2521
  skipped: isSkipped,
2522
- ...isSkipped ? {} : { answer: raw.answer }
2522
+ answer: isSkipped ? null : raw.answer
2523
2523
  };
2524
2524
  });
2525
2525
  return {