Fix chat interface - restore continuous conversation flow

🎯 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
This commit is contained in:
rwiegand
2025-07-14 12:39:05 +02:00
parent b31492a354
commit f893530471
1798 changed files with 25329 additions and 92638 deletions

View File

@@ -1,8 +1,18 @@
"use strict";
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
};
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var _ResponseStream_instances, _ResponseStream_params, _ResponseStream_currentResponseSnapshot, _ResponseStream_finalResponse, _ResponseStream_beginRequest, _ResponseStream_addEvent, _ResponseStream_endRequest, _ResponseStream_accumulateResponse;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ResponseStream = void 0;
const tslib_1 = require("../../internal/tslib.js");
const error_1 = require("../../error.js");
const EventStream_1 = require("../EventStream.js");
const ResponsesParser_1 = require("../ResponsesParser.js");
@@ -13,7 +23,7 @@ class ResponseStream extends EventStream_1.EventStream {
_ResponseStream_params.set(this, void 0);
_ResponseStream_currentResponseSnapshot.set(this, void 0);
_ResponseStream_finalResponse.set(this, void 0);
tslib_1.__classPrivateFieldSet(this, _ResponseStream_params, params, "f");
__classPrivateFieldSet(this, _ResponseStream_params, params, "f");
}
static createResponse(client, params, options) {
const runner = new ResponseStream(params);
@@ -30,7 +40,7 @@ class ResponseStream extends EventStream_1.EventStream {
this.controller.abort();
signal.addEventListener('abort', () => this.controller.abort());
}
tslib_1.__classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_beginRequest).call(this);
__classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_beginRequest).call(this);
let stream;
let starting_after = null;
if ('response_id' in params) {
@@ -42,17 +52,17 @@ class ResponseStream extends EventStream_1.EventStream {
}
this._connected();
for await (const event of stream) {
tslib_1.__classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_addEvent).call(this, event, starting_after);
__classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_addEvent).call(this, event, starting_after);
}
if (stream.controller.signal?.aborted) {
throw new error_1.APIUserAbortError();
}
return tslib_1.__classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_endRequest).call(this);
return __classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_endRequest).call(this);
}
[(_ResponseStream_params = new WeakMap(), _ResponseStream_currentResponseSnapshot = new WeakMap(), _ResponseStream_finalResponse = new WeakMap(), _ResponseStream_instances = new WeakSet(), _ResponseStream_beginRequest = function _ResponseStream_beginRequest() {
if (this.ended)
return;
tslib_1.__classPrivateFieldSet(this, _ResponseStream_currentResponseSnapshot, undefined, "f");
__classPrivateFieldSet(this, _ResponseStream_currentResponseSnapshot, undefined, "f");
}, _ResponseStream_addEvent = function _ResponseStream_addEvent(event, starting_after) {
if (this.ended)
return;
@@ -61,7 +71,7 @@ class ResponseStream extends EventStream_1.EventStream {
this._emit(name, event);
}
};
const response = tslib_1.__classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_accumulateResponse).call(this, event);
const response = __classPrivateFieldGet(this, _ResponseStream_instances, "m", _ResponseStream_accumulateResponse).call(this, event);
maybeEmit('event', event);
switch (event.type) {
case 'response.output_text.delta': {
@@ -105,21 +115,21 @@ class ResponseStream extends EventStream_1.EventStream {
if (this.ended) {
throw new error_1.OpenAIError(`stream has ended, this shouldn't happen`);
}
const snapshot = tslib_1.__classPrivateFieldGet(this, _ResponseStream_currentResponseSnapshot, "f");
const snapshot = __classPrivateFieldGet(this, _ResponseStream_currentResponseSnapshot, "f");
if (!snapshot) {
throw new error_1.OpenAIError(`request ended without sending any events`);
}
tslib_1.__classPrivateFieldSet(this, _ResponseStream_currentResponseSnapshot, undefined, "f");
const parsedResponse = finalizeResponse(snapshot, tslib_1.__classPrivateFieldGet(this, _ResponseStream_params, "f"));
tslib_1.__classPrivateFieldSet(this, _ResponseStream_finalResponse, parsedResponse, "f");
__classPrivateFieldSet(this, _ResponseStream_currentResponseSnapshot, undefined, "f");
const parsedResponse = finalizeResponse(snapshot, __classPrivateFieldGet(this, _ResponseStream_params, "f"));
__classPrivateFieldSet(this, _ResponseStream_finalResponse, parsedResponse, "f");
return parsedResponse;
}, _ResponseStream_accumulateResponse = function _ResponseStream_accumulateResponse(event) {
let snapshot = tslib_1.__classPrivateFieldGet(this, _ResponseStream_currentResponseSnapshot, "f");
let snapshot = __classPrivateFieldGet(this, _ResponseStream_currentResponseSnapshot, "f");
if (!snapshot) {
if (event.type !== 'response.created') {
throw new error_1.OpenAIError(`When snapshot hasn't been set yet, expected 'response.created' event, got ${event.type}`);
}
snapshot = tslib_1.__classPrivateFieldSet(this, _ResponseStream_currentResponseSnapshot, event.response, "f");
snapshot = __classPrivateFieldSet(this, _ResponseStream_currentResponseSnapshot, event.response, "f");
return snapshot;
}
switch (event.type) {
@@ -165,7 +175,7 @@ class ResponseStream extends EventStream_1.EventStream {
break;
}
case 'response.completed': {
tslib_1.__classPrivateFieldSet(this, _ResponseStream_currentResponseSnapshot, event.response, "f");
__classPrivateFieldSet(this, _ResponseStream_currentResponseSnapshot, event.response, "f");
break;
}
}
@@ -227,7 +237,7 @@ class ResponseStream extends EventStream_1.EventStream {
*/
async finalResponse() {
await this.done();
const response = tslib_1.__classPrivateFieldGet(this, _ResponseStream_finalResponse, "f");
const response = __classPrivateFieldGet(this, _ResponseStream_finalResponse, "f");
if (!response)
throw new error_1.OpenAIError('stream ended without producing a ChatCompletion');
return response;