@base44-preview/platform 0.3.0-pr.338.12ff73f → 0.3.0-pr.339.c920557
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.
package/dist/react/chat-items.js
CHANGED
|
@@ -67,16 +67,16 @@ function toStep(toolCall, answerToolCall) {
|
|
|
67
67
|
id: toolCall.id,
|
|
68
68
|
tool: toolName,
|
|
69
69
|
files,
|
|
70
|
-
label: stepLabel(toolName, files, summary, display),
|
|
70
|
+
label: stepLabel(toolName, files, summary, display, status),
|
|
71
71
|
status,
|
|
72
72
|
...(question && { question }),
|
|
73
73
|
...(answered && { answered }),
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
// Base44's own description of the step reads best; then the entity it touched; then the files.
|
|
77
|
-
function stepLabel(toolName, files, summary, display) {
|
|
77
|
+
function stepLabel(toolName, files, summary, display, status) {
|
|
78
78
|
if (summary)
|
|
79
|
-
return summary;
|
|
79
|
+
return summaryForStatus(summary, status);
|
|
80
80
|
const entityName = display === null || display === void 0 ? void 0 : display.entity_name;
|
|
81
81
|
if (entityName) {
|
|
82
82
|
const recordCount = display === null || display === void 0 ? void 0 : display.record_count;
|
|
@@ -84,6 +84,15 @@ function stepLabel(toolName, files, summary, display) {
|
|
|
84
84
|
}
|
|
85
85
|
return [toolName, ...files].join(" ");
|
|
86
86
|
}
|
|
87
|
+
// The AI often writes a summary as "present | past", such as "Looking at your app | Looked at your
|
|
88
|
+
// app". Like Base44's builder, a step still going shows the first half and a finished one the last.
|
|
89
|
+
function summaryForStatus(summary, status) {
|
|
90
|
+
const halves = summary.split("|").map(half => half.trim()).filter(Boolean);
|
|
91
|
+
if (halves.length < 2)
|
|
92
|
+
return summary.trim();
|
|
93
|
+
const isGoing = status === "running" || status === "waiting";
|
|
94
|
+
return isGoing ? halves[0] : halves[halves.length - 1];
|
|
95
|
+
}
|
|
87
96
|
// What the user answered on a choice, each answer next to the question it answers.
|
|
88
97
|
function answersOf(toolCall) {
|
|
89
98
|
var _a, _b, _c;
|
|
@@ -32,7 +32,7 @@ export interface ToolCallAnswer {
|
|
|
32
32
|
*
|
|
33
33
|
* Base44 keeps the Send chat message and Submit tool-call input requests open until the AI
|
|
34
34
|
* finishes the turn. Resolve your call once Base44 accepts the request, not when it returns. The
|
|
35
|
-
* chat follows the rest live. A rejected promise from any call sets
|
|
35
|
+
* chat follows the rest live. A rejected promise from any call sets {@link Base44Chat.error}.
|
|
36
36
|
*
|
|
37
37
|
* @example
|
|
38
38
|
* ```typescript
|
|
@@ -141,10 +141,10 @@ export interface ChatAnswer {
|
|
|
141
141
|
* An open question, with the actions that answer this question and no other.
|
|
142
142
|
*
|
|
143
143
|
* Each kind carries only the actions that make sense for it, and every kind can be declined. The
|
|
144
|
-
* actions never throw. A failure sets
|
|
144
|
+
* actions never throw. A failure sets {@link Base44Chat.error}, and the question opens again.
|
|
145
145
|
*
|
|
146
146
|
* The chat declines a question kind this release doesn't know, once per tool call, when Base44
|
|
147
|
-
* names that kind on the last assistant message. If the decline fails,
|
|
147
|
+
* names that kind on the last assistant message. If the decline fails, {@link Base44Chat.error} says
|
|
148
148
|
* so, and the chat tries again after it reconnects.
|
|
149
149
|
*/
|
|
150
150
|
export type ChatQuestion = ChoiceQuestion | SecretsQuestion | ApprovalQuestion;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@base44-preview/platform",
|
|
3
|
-
"version": "0.3.0-pr.
|
|
3
|
+
"version": "0.3.0-pr.339.c920557",
|
|
4
4
|
"description": "Base44 Platform SDK for white-label platforms: a browser client for watching the builder and a server entrypoint for webhooks",
|
|
5
5
|
"main": "dist/client/index.js",
|
|
6
6
|
"types": "dist/client/index.d.ts",
|