@mastra/voice-openai-realtime 0.1.0 → 0.1.1-alpha.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.
@@ -1,23 +1,23 @@
1
1
 
2
- > @mastra/voice-openai-realtime@0.1.0-alpha.3 build /home/runner/work/mastra/mastra/voice/openai-realtime-api
2
+ > @mastra/voice-openai-realtime@0.1.1-alpha.2 build /home/runner/work/mastra/mastra/voice/openai-realtime-api
3
3
  > tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake
4
4
 
5
5
  CLI Building entry: src/index.ts
6
6
  CLI Using tsconfig: tsconfig.json
7
7
  CLI tsup v8.4.0
8
8
  TSC Build start
9
- TSC ⚡️ Build success in 7321ms
9
+ TSC ⚡️ Build success in 9370ms
10
10
  DTS Build start
11
11
  CLI Target: es2022
12
12
  Analysis will use the bundled TypeScript version 5.8.2
13
13
  Writing package typings: /home/runner/work/mastra/mastra/voice/openai-realtime-api/dist/_tsup-dts-rollup.d.ts
14
14
  Analysis will use the bundled TypeScript version 5.8.2
15
15
  Writing package typings: /home/runner/work/mastra/mastra/voice/openai-realtime-api/dist/_tsup-dts-rollup.d.cts
16
- DTS ⚡️ Build success in 10514ms
16
+ DTS ⚡️ Build success in 10512ms
17
17
  CLI Cleaning output folder
18
18
  ESM Build start
19
19
  CJS Build start
20
- ESM dist/index.js 18.38 KB
21
- ESM ⚡️ Build success in 841ms
22
- CJS dist/index.cjs 18.44 KB
23
- CJS ⚡️ Build success in 843ms
20
+ CJS dist/index.cjs 18.50 KB
21
+ CJS ⚡️ Build success in 817ms
22
+ ESM dist/index.js 18.44 KB
23
+ ESM ⚡️ Build success in 819ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # @mastra/voice-openai-realtime
2
2
 
3
+ ## 0.1.1-alpha.2
4
+
5
+ ### Patch Changes
6
+
7
+ - c2ebff3: Update dependencies
8
+ - Updated dependencies [56c31b7]
9
+ - Updated dependencies [dbbbf80]
10
+ - Updated dependencies [99d43b9]
11
+ - @mastra/core@0.8.0-alpha.2
12
+
13
+ ## 0.1.1-alpha.1
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [619c39d]
18
+ - Updated dependencies [fe56be0]
19
+ - Updated dependencies [a0967a0]
20
+ - Updated dependencies [fca3b21]
21
+ - Updated dependencies [0118361]
22
+ - Updated dependencies [619c39d]
23
+ - @mastra/core@0.8.0-alpha.1
24
+
25
+ ## 0.1.1-alpha.0
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies [107bcfe]
30
+ - Updated dependencies [5b4e19f]
31
+ - Updated dependencies [7599d77]
32
+ - Updated dependencies [cafae83]
33
+ - Updated dependencies [8076ecf]
34
+ - Updated dependencies [304397c]
35
+ - @mastra/core@0.7.1-alpha.0
36
+
3
37
  ## 0.1.0
4
38
 
5
39
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -12,14 +12,14 @@ var transformTools = (tools) => {
12
12
  for (const [name, tool] of Object.entries(tools || {})) {
13
13
  let parameters;
14
14
  if ("inputSchema" in tool && tool.inputSchema) {
15
- if (typeof tool.inputSchema === "object" && tool.inputSchema._def && tool.inputSchema._def.typeName === "ZodObject") {
15
+ if (isZodObject(tool.inputSchema)) {
16
16
  parameters = zodToJsonSchema.zodToJsonSchema(tool.inputSchema);
17
17
  delete parameters.$schema;
18
18
  } else {
19
19
  parameters = tool.inputSchema;
20
20
  }
21
21
  } else if ("parameters" in tool) {
22
- if (typeof tool.parameters === "object" && tool.parameters._def && tool.parameters._def.typeName === "ZodObject") {
22
+ if (isZodObject(tool.parameters)) {
23
23
  parameters = zodToJsonSchema.zodToJsonSchema(tool.parameters);
24
24
  delete parameters.$schema;
25
25
  } else {
@@ -65,6 +65,9 @@ var transformTools = (tools) => {
65
65
  var isReadableStream = (obj) => {
66
66
  return obj && obj instanceof stream.Readable && typeof obj.read === "function" && typeof obj.pipe === "function" && obj.readable === true;
67
67
  };
68
+ function isZodObject(schema) {
69
+ return !!schema && typeof schema === "object" && "_def" in schema && schema._def && typeof schema._def === "object" && "typeName" in schema._def && schema._def.typeName === "ZodObject";
70
+ }
68
71
 
69
72
  // src/index.ts
70
73
  var DEFAULT_VOICE = "alloy";
package/dist/index.js CHANGED
@@ -10,14 +10,14 @@ var transformTools = (tools) => {
10
10
  for (const [name, tool] of Object.entries(tools || {})) {
11
11
  let parameters;
12
12
  if ("inputSchema" in tool && tool.inputSchema) {
13
- if (typeof tool.inputSchema === "object" && tool.inputSchema._def && tool.inputSchema._def.typeName === "ZodObject") {
13
+ if (isZodObject(tool.inputSchema)) {
14
14
  parameters = zodToJsonSchema(tool.inputSchema);
15
15
  delete parameters.$schema;
16
16
  } else {
17
17
  parameters = tool.inputSchema;
18
18
  }
19
19
  } else if ("parameters" in tool) {
20
- if (typeof tool.parameters === "object" && tool.parameters._def && tool.parameters._def.typeName === "ZodObject") {
20
+ if (isZodObject(tool.parameters)) {
21
21
  parameters = zodToJsonSchema(tool.parameters);
22
22
  delete parameters.$schema;
23
23
  } else {
@@ -63,6 +63,9 @@ var transformTools = (tools) => {
63
63
  var isReadableStream = (obj) => {
64
64
  return obj && obj instanceof Readable && typeof obj.read === "function" && typeof obj.pipe === "function" && obj.readable === true;
65
65
  };
66
+ function isZodObject(schema) {
67
+ return !!schema && typeof schema === "object" && "_def" in schema && schema._def && typeof schema._def === "object" && "typeName" in schema._def && schema._def.typeName === "ZodObject";
68
+ }
66
69
 
67
70
  // src/index.ts
68
71
  var DEFAULT_VOICE = "alloy";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/voice-openai-realtime",
3
- "version": "0.1.0",
3
+ "version": "0.1.1-alpha.2",
4
4
  "description": "Mastra OpenAI Realtime API integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -21,16 +21,16 @@
21
21
  "dependencies": {
22
22
  "openai-realtime-api": "^1.0.7",
23
23
  "ws": "^8.18.1",
24
- "zod-to-json-schema": "^3.24.1",
25
- "@mastra/core": "^0.7.0"
24
+ "zod-to-json-schema": "^3.24.5",
25
+ "@mastra/core": "^0.8.0-alpha.2"
26
26
  },
27
27
  "devDependencies": {
28
- "@microsoft/api-extractor": "^7.49.2",
28
+ "@microsoft/api-extractor": "^7.52.2",
29
29
  "@types/node": "^22.13.1",
30
30
  "@types/ws": "^8.18.0",
31
31
  "eslint": "^9.23.0",
32
- "tsup": "^8.3.6",
33
- "typescript": "^5.7.3",
32
+ "tsup": "^8.4.0",
33
+ "typescript": "^5.8.2",
34
34
  "vitest": "^2.1.9",
35
35
  "@internal/lint": "0.0.1"
36
36
  },
package/src/utils.ts CHANGED
@@ -11,22 +11,14 @@ export const transformTools = (tools?: TTools) => {
11
11
  let parameters: { [key: string]: any };
12
12
 
13
13
  if ('inputSchema' in tool && tool.inputSchema) {
14
- if (
15
- typeof tool.inputSchema === 'object' &&
16
- tool.inputSchema._def &&
17
- tool.inputSchema._def.typeName === 'ZodObject'
18
- ) {
14
+ if (isZodObject(tool.inputSchema)) {
19
15
  parameters = zodToJsonSchema(tool.inputSchema);
20
16
  delete parameters.$schema;
21
17
  } else {
22
18
  parameters = tool.inputSchema;
23
19
  }
24
20
  } else if ('parameters' in tool) {
25
- if (
26
- typeof tool.parameters === 'object' &&
27
- tool.parameters._def &&
28
- tool.parameters._def.typeName === 'ZodObject'
29
- ) {
21
+ if (isZodObject(tool.parameters)) {
30
22
  parameters = zodToJsonSchema(tool.parameters);
31
23
  delete parameters.$schema;
32
24
  } else {
@@ -86,3 +78,15 @@ export const isReadableStream = (obj: unknown) => {
86
78
  obj.readable === true
87
79
  );
88
80
  };
81
+
82
+ function isZodObject(schema: unknown) {
83
+ return (
84
+ !!schema &&
85
+ typeof schema === 'object' &&
86
+ '_def' in schema &&
87
+ schema._def &&
88
+ typeof schema._def === 'object' &&
89
+ 'typeName' in schema._def &&
90
+ schema._def.typeName === 'ZodObject'
91
+ );
92
+ }