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,12 +1,11 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../../core/resource.mjs";
import * as StepsAPI from "./steps.mjs";
import { Steps, } from "./steps.mjs";
import { CursorPage } from "../../../../core/pagination.mjs";
import { buildHeaders } from "../../../../internal/headers.mjs";
import { APIResource } from "../../../../resource.mjs";
import { isRequestOptions } from "../../../../core.mjs";
import { AssistantStream } from "../../../../lib/AssistantStream.mjs";
import { sleep } from "../../../../internal/utils/sleep.mjs";
import { path } from "../../../../internal/utils/path.mjs";
import { sleep } from "../../../../core.mjs";
import * as StepsAPI from "./steps.mjs";
import { RunStepsPage, Steps, } from "./steps.mjs";
import { CursorPage } from "../../../../pagination.mjs";
/**
* @deprecated The Assistants API is deprecated in favor of the Responses API
*/
@@ -15,13 +14,13 @@ export class Runs extends APIResource {
super(...arguments);
this.steps = new StepsAPI.Steps(this._client);
}
create(threadID, params, options) {
create(threadId, params, options) {
const { include, ...body } = params;
return this._client.post(path `/threads/${threadID}/runs`, {
return this._client.post(`/threads/${threadId}/runs`, {
query: { include },
body,
...options,
headers: buildHeaders([{ 'OpenAI-Beta': 'assistants=v2' }, options?.headers]),
headers: { 'OpenAI-Beta': 'assistants=v2', ...options?.headers },
stream: params.stream ?? false,
});
}
@@ -30,11 +29,10 @@ export class Runs extends APIResource {
*
* @deprecated The Assistants API is deprecated in favor of the Responses API
*/
retrieve(runID, params, options) {
const { thread_id } = params;
return this._client.get(path `/threads/${thread_id}/runs/${runID}`, {
retrieve(threadId, runId, options) {
return this._client.get(`/threads/${threadId}/runs/${runId}`, {
...options,
headers: buildHeaders([{ 'OpenAI-Beta': 'assistants=v2' }, options?.headers]),
headers: { 'OpenAI-Beta': 'assistants=v2', ...options?.headers },
});
}
/**
@@ -42,24 +40,21 @@ export class Runs extends APIResource {
*
* @deprecated The Assistants API is deprecated in favor of the Responses API
*/
update(runID, params, options) {
const { thread_id, ...body } = params;
return this._client.post(path `/threads/${thread_id}/runs/${runID}`, {
update(threadId, runId, body, options) {
return this._client.post(`/threads/${threadId}/runs/${runId}`, {
body,
...options,
headers: buildHeaders([{ 'OpenAI-Beta': 'assistants=v2' }, options?.headers]),
headers: { 'OpenAI-Beta': 'assistants=v2', ...options?.headers },
});
}
/**
* Returns a list of runs belonging to a thread.
*
* @deprecated The Assistants API is deprecated in favor of the Responses API
*/
list(threadID, query = {}, options) {
return this._client.getAPIList(path `/threads/${threadID}/runs`, (CursorPage), {
list(threadId, query = {}, options) {
if (isRequestOptions(query)) {
return this.list(threadId, {}, query);
}
return this._client.getAPIList(`/threads/${threadId}/runs`, RunsPage, {
query,
...options,
headers: buildHeaders([{ 'OpenAI-Beta': 'assistants=v2' }, options?.headers]),
headers: { 'OpenAI-Beta': 'assistants=v2', ...options?.headers },
});
}
/**
@@ -67,11 +62,10 @@ export class Runs extends APIResource {
*
* @deprecated The Assistants API is deprecated in favor of the Responses API
*/
cancel(runID, params, options) {
const { thread_id } = params;
return this._client.post(path `/threads/${thread_id}/runs/${runID}/cancel`, {
cancel(threadId, runId, options) {
return this._client.post(`/threads/${threadId}/runs/${runId}/cancel`, {
...options,
headers: buildHeaders([{ 'OpenAI-Beta': 'assistants=v2' }, options?.headers]),
headers: { 'OpenAI-Beta': 'assistants=v2', ...options?.headers },
});
}
/**
@@ -81,7 +75,7 @@ export class Runs extends APIResource {
*/
async createAndPoll(threadId, body, options) {
const run = await this.create(threadId, body, options);
return await this.poll(run.id, { thread_id: threadId }, options);
return await this.poll(threadId, run.id, options);
}
/**
* Create a Run stream
@@ -96,16 +90,13 @@ export class Runs extends APIResource {
* information on Run lifecycles can be found here:
* https://platform.openai.com/docs/assistants/how-it-works/runs-and-run-steps
*/
async poll(runId, params, options) {
const headers = buildHeaders([
options?.headers,
{
'X-Stainless-Poll-Helper': 'true',
'X-Stainless-Custom-Poll-Interval': options?.pollIntervalMs?.toString() ?? undefined,
},
]);
async poll(threadId, runId, options) {
const headers = { ...options?.headers, 'X-Stainless-Poll-Helper': 'true' };
if (options?.pollIntervalMs) {
headers['X-Stainless-Custom-Poll-Interval'] = options.pollIntervalMs.toString();
}
while (true) {
const { data: run, response } = await this.retrieve(runId, params, {
const { data: run, response } = await this.retrieve(threadId, runId, {
...options,
headers: { ...options?.headers, ...headers },
}).withResponse();
@@ -146,13 +137,12 @@ export class Runs extends APIResource {
stream(threadId, body, options) {
return AssistantStream.createAssistantStream(threadId, this._client.beta.threads.runs, body, options);
}
submitToolOutputs(runID, params, options) {
const { thread_id, ...body } = params;
return this._client.post(path `/threads/${thread_id}/runs/${runID}/submit_tool_outputs`, {
submitToolOutputs(threadId, runId, body, options) {
return this._client.post(`/threads/${threadId}/runs/${runId}/submit_tool_outputs`, {
body,
...options,
headers: buildHeaders([{ 'OpenAI-Beta': 'assistants=v2' }, options?.headers]),
stream: params.stream ?? false,
headers: { 'OpenAI-Beta': 'assistants=v2', ...options?.headers },
stream: body.stream ?? false,
});
}
/**
@@ -160,18 +150,22 @@ export class Runs extends APIResource {
* More information on Run lifecycles can be found here:
* https://platform.openai.com/docs/assistants/how-it-works/runs-and-run-steps
*/
async submitToolOutputsAndPoll(runId, params, options) {
const run = await this.submitToolOutputs(runId, params, options);
return await this.poll(run.id, params, options);
async submitToolOutputsAndPoll(threadId, runId, body, options) {
const run = await this.submitToolOutputs(threadId, runId, body, options);
return await this.poll(threadId, run.id, options);
}
/**
* Submit the tool outputs from a previous run and stream the run to a terminal
* state. More information on Run lifecycles can be found here:
* https://platform.openai.com/docs/assistants/how-it-works/runs-and-run-steps
*/
submitToolOutputsStream(runId, params, options) {
return AssistantStream.createToolAssistantStream(runId, this._client.beta.threads.runs, params, options);
submitToolOutputsStream(threadId, runId, body, options) {
return AssistantStream.createToolAssistantStream(threadId, runId, this._client.beta.threads.runs, body, options);
}
}
export class RunsPage extends CursorPage {
}
Runs.RunsPage = RunsPage;
Runs.Steps = Steps;
Runs.RunStepsPage = RunStepsPage;
//# sourceMappingURL=runs.mjs.map