🎯 Major improvements to MissionControl component: - Always keep input field visible and functional after AI responses - Auto-clear input after submitting questions for better UX - Add dynamic visual indicators (first question vs follow-up) - Improve response layout with clear separation and hints - Enable proper chat-like experience for continuous learning 🌟 Additional enhancements: - Better language-specific messaging throughout interface - Clearer visual hierarchy between input and response areas - Intuitive flow that guides users to ask follow-up questions - Maintains responsive design and accessibility 🔧 Technical changes: - Enhanced MissionControl state management - Improved component layout and styling - Better TypeScript integration across components - Updated tsconfig for stricter type checking
55 lines
2.4 KiB
JavaScript
55 lines
2.4 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.parseObjectDef = void 0;
|
|
const parseDef_1 = require("../parseDef.js");
|
|
function decideAdditionalProperties(def, refs) {
|
|
if (refs.removeAdditionalStrategy === 'strict') {
|
|
return def.catchall._def.typeName === 'ZodNever' ?
|
|
def.unknownKeys !== 'strict'
|
|
: (0, parseDef_1.parseDef)(def.catchall._def, {
|
|
...refs,
|
|
currentPath: [...refs.currentPath, 'additionalProperties'],
|
|
}) ?? true;
|
|
}
|
|
else {
|
|
return def.catchall._def.typeName === 'ZodNever' ?
|
|
def.unknownKeys === 'passthrough'
|
|
: (0, parseDef_1.parseDef)(def.catchall._def, {
|
|
...refs,
|
|
currentPath: [...refs.currentPath, 'additionalProperties'],
|
|
}) ?? true;
|
|
}
|
|
}
|
|
function parseObjectDef(def, refs) {
|
|
const result = {
|
|
type: 'object',
|
|
...Object.entries(def.shape()).reduce((acc, [propName, propDef]) => {
|
|
if (propDef === undefined || propDef._def === undefined)
|
|
return acc;
|
|
const propertyPath = [...refs.currentPath, 'properties', propName];
|
|
const parsedDef = (0, parseDef_1.parseDef)(propDef._def, {
|
|
...refs,
|
|
currentPath: propertyPath,
|
|
propertyPath,
|
|
});
|
|
if (parsedDef === undefined)
|
|
return acc;
|
|
if (refs.openaiStrictMode && propDef.isOptional() && !propDef.isNullable()) {
|
|
console.warn(`Zod field at \`${propertyPath.join('/')}\` uses \`.optional()\` without \`.nullable()\` which is not supported by the API. See: https://platform.openai.com/docs/guides/structured-outputs?api-mode=responses#all-fields-must-be-required\nThis will become an error in a future version of the SDK.`);
|
|
}
|
|
return {
|
|
properties: {
|
|
...acc.properties,
|
|
[propName]: parsedDef,
|
|
},
|
|
required: propDef.isOptional() && !refs.openaiStrictMode ? acc.required : [...acc.required, propName],
|
|
};
|
|
}, { properties: {}, required: [] }),
|
|
additionalProperties: decideAdditionalProperties(def, refs),
|
|
};
|
|
if (!result.required.length)
|
|
delete result.required;
|
|
return result;
|
|
}
|
|
exports.parseObjectDef = parseObjectDef;
|
|
//# sourceMappingURL=object.js.map
|