@lambforge/agent-chat 0.0.8 → 0.0.9
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/README.md +7 -0
- package/dist/agent-chat.js +15 -15
- package/dist/agent-chat.js.map +3 -3
- package/dist/index.cjs +28 -1
- package/dist/index.cjs.map +3 -3
- package/dist/index.mjs +28 -1
- package/dist/index.mjs.map +3 -3
- package/package.json +3 -3
- package/types/index.d.ts +4 -0
package/dist/index.mjs
CHANGED
|
@@ -3178,6 +3178,7 @@ function withEvent(s9, event) {
|
|
|
3178
3178
|
};
|
|
3179
3179
|
}
|
|
3180
3180
|
if (event.type === "delta") return withDelta({ ...s9, conversationId }, event);
|
|
3181
|
+
if (event.type === "step") return withStep({ ...s9, conversationId }, event);
|
|
3181
3182
|
if (event.type !== "message" || !event.data?.id) return { ...s9, conversationId };
|
|
3182
3183
|
const message = toMessage(event.data);
|
|
3183
3184
|
if (s9.messages.some((m4) => m4.id === message.id)) return { ...s9, conversationId };
|
|
@@ -3188,6 +3189,13 @@ function withEvent(s9, event) {
|
|
|
3188
3189
|
const live = message.role === "assistant" ? null : s9.live;
|
|
3189
3190
|
return { ...s9, conversationId, messages, live };
|
|
3190
3191
|
}
|
|
3192
|
+
function withStep(s9, event) {
|
|
3193
|
+
if (!s9.answering || s9.notice?.kind !== "busy" || s9.notice.what !== "thinking") return s9;
|
|
3194
|
+
const n11 = Number(event.data?.step) || 0;
|
|
3195
|
+
if (s9.notice.step && n11 < s9.notice.step.n) return s9;
|
|
3196
|
+
const tool = typeof event.data?.tool === "string" && event.data.tool ? event.data.tool : null;
|
|
3197
|
+
return { ...s9, notice: { ...s9.notice, step: { n: n11, tool } } };
|
|
3198
|
+
}
|
|
3191
3199
|
function withDelta(s9, event) {
|
|
3192
3200
|
if (!s9.answering || !event.runId) return s9;
|
|
3193
3201
|
const segment = Number(event.data?.segment) || 0;
|
|
@@ -3242,6 +3250,8 @@ var en = {
|
|
|
3242
3250
|
send: "Send",
|
|
3243
3251
|
stop: "Stop",
|
|
3244
3252
|
thinking: "Thinking",
|
|
3253
|
+
checking: "Checking the data",
|
|
3254
|
+
lookingAt: "Looking at",
|
|
3245
3255
|
connecting: "Connecting",
|
|
3246
3256
|
pickAgent: "Assistant",
|
|
3247
3257
|
usedTools: "Used",
|
|
@@ -3263,6 +3273,9 @@ var en = {
|
|
|
3263
3273
|
"session-expired": "Your session ended - reload the page.",
|
|
3264
3274
|
"credential-expired": "Please sign in again.",
|
|
3265
3275
|
aborted: "Stopped.",
|
|
3276
|
+
timeout: "The answer took too long - try again or ask something shorter.",
|
|
3277
|
+
"embeddings-off": "Something went wrong - try again.",
|
|
3278
|
+
"embeddings-cap-reached": "Something went wrong - try again.",
|
|
3266
3279
|
internal: "Something went wrong - try again.",
|
|
3267
3280
|
unauthorized: "This chat is not allowed here.",
|
|
3268
3281
|
"bad-request": "That did not work - try again.",
|
|
@@ -3286,6 +3299,8 @@ var bg = {
|
|
|
3286
3299
|
send: "\u0418\u0437\u043F\u0440\u0430\u0442\u0438",
|
|
3287
3300
|
stop: "\u0421\u043F\u0440\u0438",
|
|
3288
3301
|
thinking: "\u041C\u0438\u0441\u043B\u044F",
|
|
3302
|
+
checking: "\u041F\u0440\u043E\u0432\u0435\u0440\u044F\u0432\u0430\u043C \u0434\u0430\u043D\u043D\u0438\u0442\u0435",
|
|
3303
|
+
lookingAt: "\u0413\u043B\u0435\u0434\u0430\u043C",
|
|
3289
3304
|
connecting: "\u0421\u0432\u044A\u0440\u0437\u0432\u0430\u043D\u0435",
|
|
3290
3305
|
pickAgent: "\u0410\u0441\u0438\u0441\u0442\u0435\u043D\u0442",
|
|
3291
3306
|
usedTools: "\u0418\u0437\u043F\u043E\u043B\u0437\u0432\u0430\u043D\u043E",
|
|
@@ -3307,6 +3322,9 @@ var bg = {
|
|
|
3307
3322
|
"session-expired": "\u0421\u0435\u0441\u0438\u044F\u0442\u0430 \u0438\u0437\u0442\u0435\u0447\u0435 - \u043F\u0440\u0435\u0437\u0430\u0440\u0435\u0434\u0435\u0442\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430\u0442\u0430.",
|
|
3308
3323
|
"credential-expired": "\u041C\u043E\u043B\u044F, \u0432\u043B\u0435\u0437\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E.",
|
|
3309
3324
|
aborted: "\u0421\u043F\u0440\u044F\u043D\u043E.",
|
|
3325
|
+
timeout: "\u041E\u0442\u0433\u043E\u0432\u043E\u0440\u044A\u0442 \u043E\u0442\u043D\u0435 \u0442\u0432\u044A\u0440\u0434\u0435 \u0434\u044A\u043B\u0433\u043E - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E \u0438\u043B\u0438 \u043F\u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043F\u043E-\u043A\u0440\u0430\u0442\u043A\u043E.",
|
|
3326
|
+
"embeddings-off": "\u041D\u0435\u0449\u043E \u0441\u0435 \u043E\u0431\u044A\u0440\u043A\u0430 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E.",
|
|
3327
|
+
"embeddings-cap-reached": "\u041D\u0435\u0449\u043E \u0441\u0435 \u043E\u0431\u044A\u0440\u043A\u0430 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E.",
|
|
3310
3328
|
internal: "\u041D\u0435\u0449\u043E \u0441\u0435 \u043E\u0431\u044A\u0440\u043A\u0430 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E.",
|
|
3311
3329
|
unauthorized: "\u0422\u043E\u0437\u0438 \u0447\u0430\u0442 \u043D\u0435 \u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D \u0442\u0443\u043A.",
|
|
3312
3330
|
"bad-request": "\u041D\u0435 \u0441\u0435 \u043F\u043E\u043B\u0443\u0447\u0438 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E.",
|
|
@@ -3855,7 +3873,11 @@ var LambforgeAgentChat = class extends import_lit_html19.LitElement {
|
|
|
3855
3873
|
noticeText(notice) {
|
|
3856
3874
|
if (!notice) return "";
|
|
3857
3875
|
const t9 = this.t;
|
|
3858
|
-
if (notice.kind === "busy")
|
|
3876
|
+
if (notice.kind === "busy") {
|
|
3877
|
+
const step = notice.what === "thinking" ? notice.step : void 0;
|
|
3878
|
+
if (!step) return t9[notice.what];
|
|
3879
|
+
return `${t9[notice.what]} - ${step.tool ? `${t9.lookingAt}: ${toolLabel(step.tool)}` : t9.checking}`;
|
|
3880
|
+
}
|
|
3859
3881
|
if (notice.kind === "info") return t9.errors.aborted;
|
|
3860
3882
|
return t9.errors[notice.code] ?? t9.errors.default;
|
|
3861
3883
|
}
|
|
@@ -4128,6 +4150,11 @@ LambforgeAgentChat = __decorateClass([
|
|
|
4128
4150
|
}
|
|
4129
4151
|
})
|
|
4130
4152
|
], LambforgeAgentChat);
|
|
4153
|
+
function toolLabel(name) {
|
|
4154
|
+
const bare = String(name).split("__").pop() ?? "";
|
|
4155
|
+
const words = bare.replace(/[_-]+/g, " ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").trim().toLowerCase();
|
|
4156
|
+
return words ? words[0].toUpperCase() + words.slice(1) : "";
|
|
4157
|
+
}
|
|
4131
4158
|
export {
|
|
4132
4159
|
ChatEffects,
|
|
4133
4160
|
ChatStore,
|