juneau 0.13.2 → 0.14.0
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/core/history.d.ts +6 -1
- package/dist/core/history.d.ts.map +1 -1
- package/dist/core/types.d.ts +34 -4
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index.cjs +25 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -24
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type { AiMessage, AiMessageRole, AiMessagePart, AiCustomPart, AiTextPart, AiTablePart as AiTablePartType, AiProposalPart, AiProposal, AiProposalResolution, AiChatSummary, AiSerializedMessage, AiActivityPart as AiActivityPartType, AiActivityStatus, AiErrorPart, AiEntity, AiEntityField, AiEntityBadgeTone, AiEntityPart as AiEntityPartType, AiEntityListPart as AiEntityListPartType, AiBackendAdapter, AiAdapterInput, AiStreamEvent, AiStreamTextEvent, AiStreamPartEvent, AiStreamDoneEvent, AiStreamErrorEvent, JuneauWireEvent, JuneauWireText, JuneauWireActivity, JuneauWirePart, JuneauWireDone, JuneauWireError, } from './core/types';
|
|
1
|
+
export type { AiMessage, AiMessageRole, AiMessagePart, AiCustomPart, AiTextPart, AiTablePart as AiTablePartType, AiProposalPart, AiProposal, AiProposalResolution, AiChatSummary, AiSerializedMessage, AiActivityPart as AiActivityPartType, AiActivityStatus, AiErrorPart, AiEntity, AiEntityField, AiEntityBadgeTone, AiEntityPart as AiEntityPartType, AiEntityListPart as AiEntityListPartType, AiChartPart, AiChartSeries, AiChartPoint, AiChartValueFormat, AiBackendAdapter, AiAdapterInput, AiStreamEvent, AiStreamTextEvent, AiStreamPartEvent, AiStreamDoneEvent, AiStreamErrorEvent, JuneauWireEvent, JuneauWireText, JuneauWireActivity, JuneauWirePart, JuneauWireDone, JuneauWireError, } from './core/types';
|
|
2
2
|
export { consumeStream, delay, getMessageText, serializeMessages } from './core/stream';
|
|
3
|
-
export { serializeForStorage, deserializeMessages, trimHistory, trimChats, isProposalPart } from './core/history';
|
|
3
|
+
export { serializeForStorage, deserializeMessages, trimHistory, trimChats, isProposalPart, isChartPart } from './core/history';
|
|
4
4
|
export { mockAdapter } from './adapters/mockAdapter';
|
|
5
5
|
export { createSseAdapter } from './adapters/createSseAdapter';
|
|
6
6
|
export type { SseAdapterOptions, SseEventParser } from './adapters/createSseAdapter';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,SAAS,EACT,aAAa,EACb,aAAa,EACb,YAAY,EACZ,UAAU,EACV,WAAW,IAAI,eAAe,EAC9B,cAAc,EACd,UAAU,EACV,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,cAAc,IAAI,kBAAkB,EACpC,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,aAAa,EACb,iBAAiB,EACjB,YAAY,IAAI,gBAAgB,EAChC,gBAAgB,IAAI,oBAAoB,EACxC,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAElB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,eAAe,GAChB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,SAAS,EACT,aAAa,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AAM,qCAAqC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -14,8 +14,11 @@ async function Nn(e, n, t) {
|
|
|
14
14
|
function zr(e) {
|
|
15
15
|
return e.type === "proposal";
|
|
16
16
|
}
|
|
17
|
-
const el = 1;
|
|
18
17
|
function Jh(e) {
|
|
18
|
+
return e.type === "chart" && Array.isArray(e.series);
|
|
19
|
+
}
|
|
20
|
+
const el = 1;
|
|
21
|
+
function Kh(e) {
|
|
19
22
|
return e.map((n) => ({
|
|
20
23
|
...n,
|
|
21
24
|
v: el,
|
|
@@ -26,7 +29,7 @@ function Jh(e) {
|
|
|
26
29
|
function tl(e) {
|
|
27
30
|
return zr(e) && !e.proposal.resolved ? { ...e, proposal: { ...e.proposal, resolved: "expired" } } : e;
|
|
28
31
|
}
|
|
29
|
-
function
|
|
32
|
+
function Zh(e) {
|
|
30
33
|
return e.map(({ v: n, ...t }) => ({
|
|
31
34
|
...t,
|
|
32
35
|
createdAt: new Date(t.createdAt)
|
|
@@ -39,10 +42,10 @@ function nl(e, n) {
|
|
|
39
42
|
t++;
|
|
40
43
|
return e.slice(t);
|
|
41
44
|
}
|
|
42
|
-
function
|
|
45
|
+
function ed(e, n) {
|
|
43
46
|
return n <= 0 || e.length <= n ? [...e].sort(Mn) : [...e].sort(Mn).slice(0, n);
|
|
44
47
|
}
|
|
45
|
-
const Mn = (e, n) => n.updatedAt.getTime() - e.updatedAt.getTime(),
|
|
48
|
+
const Mn = (e, n) => n.updatedAt.getTime() - e.updatedAt.getTime(), td = {
|
|
46
49
|
async *sendMessage(e) {
|
|
47
50
|
const n = [...e.messages].reverse().find((r) => r.role === "user"), t = n ? Zi(n).toLowerCase() : "";
|
|
48
51
|
t.includes("activity") || t.includes("progress") || t.includes("document") || t.includes("dokument") ? yield* rl() : t.includes("table") || t.includes("data") || t.includes("list") || t.includes("show") ? yield* il() : t.includes("proposal") || t.includes("suggest") || t.includes("recommend") ? yield* ll() : t.includes("entity") || t.includes("card") || t.includes("detail") || t.includes("find") ? yield* ol() : t.includes("help") || t.includes("what can") || t.includes("how do") ? yield* al() : t.includes("error") || t.includes("fail") || t.includes("break") ? yield* sl() : yield* ul(t);
|
|
@@ -240,7 +243,7 @@ function Pr(e) {
|
|
|
240
243
|
return [];
|
|
241
244
|
}
|
|
242
245
|
}
|
|
243
|
-
function
|
|
246
|
+
function nd(e, n = {}) {
|
|
244
247
|
const {
|
|
245
248
|
method: t = "POST",
|
|
246
249
|
headers: r = {},
|
|
@@ -319,7 +322,7 @@ const fl = (e) => {
|
|
|
319
322
|
return [];
|
|
320
323
|
}
|
|
321
324
|
};
|
|
322
|
-
function
|
|
325
|
+
function rd(e, n = {}) {
|
|
323
326
|
const {
|
|
324
327
|
method: t = "POST",
|
|
325
328
|
headers: r = {},
|
|
@@ -608,7 +611,7 @@ function ze() {
|
|
|
608
611
|
const gl = "_root_14q8g_1", yl = {
|
|
609
612
|
root: gl
|
|
610
613
|
};
|
|
611
|
-
function
|
|
614
|
+
function id({ children: e, theme: n, labels: t, defaultTitle: r, className: i, style: o }) {
|
|
612
615
|
const l = {
|
|
613
616
|
...Lr,
|
|
614
617
|
...r ? { sidebarTitle: r } : {},
|
|
@@ -681,10 +684,10 @@ function xl() {
|
|
|
681
684
|
);
|
|
682
685
|
return e;
|
|
683
686
|
}
|
|
684
|
-
function
|
|
687
|
+
function ld() {
|
|
685
688
|
return sn(cn);
|
|
686
689
|
}
|
|
687
|
-
function
|
|
690
|
+
function od({
|
|
688
691
|
adapter: e,
|
|
689
692
|
context: n,
|
|
690
693
|
onProposalConfirm: t,
|
|
@@ -710,7 +713,7 @@ function ld({
|
|
|
710
713
|
);
|
|
711
714
|
return /* @__PURE__ */ x(cn.Provider, { value: h, children: a });
|
|
712
715
|
}
|
|
713
|
-
const
|
|
716
|
+
const ad = {
|
|
714
717
|
sidebarTitle: "AI Asistent",
|
|
715
718
|
clearConversation: "Vymazat konverzaci",
|
|
716
719
|
resetConversation: "Resetovat konverzaci",
|
|
@@ -10122,7 +10125,7 @@ const Bh = "_sidebar_17ski_1", $h = "_minimized_17ski_20", Ar = {
|
|
|
10122
10125
|
sidebar: Bh,
|
|
10123
10126
|
minimized: $h
|
|
10124
10127
|
};
|
|
10125
|
-
function
|
|
10128
|
+
function sd({
|
|
10126
10129
|
title: e,
|
|
10127
10130
|
icon: n,
|
|
10128
10131
|
assistantIcon: t,
|
|
@@ -10213,7 +10216,7 @@ const Hh = "_list_180ms_1", Vh = "_item_180ms_10", qh = "_chat_180ms_16", Uh = "
|
|
|
10213
10216
|
delete: "_delete_180ms_56",
|
|
10214
10217
|
empty: Qh
|
|
10215
10218
|
};
|
|
10216
|
-
function
|
|
10219
|
+
function ud({ chats: e, onSelect: n, activeChatId: t, onDelete: r }) {
|
|
10217
10220
|
const i = ze();
|
|
10218
10221
|
return e.length === 0 ? /* @__PURE__ */ x("p", { className: _e.empty, children: i.historyEmpty }) : /* @__PURE__ */ x("ul", { className: _e.list, "data-juneau": "history-list", children: e.map((o) => /* @__PURE__ */ Q("li", { className: _e.item, children: [
|
|
10219
10222
|
/* @__PURE__ */ Q(
|
|
@@ -10243,8 +10246,8 @@ export {
|
|
|
10243
10246
|
Ph as AiChat,
|
|
10244
10247
|
cn as AiChatContext,
|
|
10245
10248
|
jh as AiChatHeader,
|
|
10246
|
-
|
|
10247
|
-
|
|
10249
|
+
ud as AiChatHistoryList,
|
|
10250
|
+
od as AiChatProvider,
|
|
10248
10251
|
$i as AiEntityCard,
|
|
10249
10252
|
Hp as AiEntityListPart,
|
|
10250
10253
|
Ih as AiError,
|
|
@@ -10253,27 +10256,28 @@ export {
|
|
|
10253
10256
|
hh as AiMessageList,
|
|
10254
10257
|
Yp as AiMessagePartRenderer,
|
|
10255
10258
|
kp as AiProposalCard,
|
|
10256
|
-
|
|
10259
|
+
sd as AiSidebar,
|
|
10257
10260
|
ap as AiTablePart,
|
|
10258
10261
|
sh as AiTypingIndicator,
|
|
10259
|
-
|
|
10262
|
+
id as JuneauProvider,
|
|
10260
10263
|
Nn as consumeStream,
|
|
10261
|
-
|
|
10262
|
-
|
|
10264
|
+
rd as createFetchStreamAdapter,
|
|
10265
|
+
nd as createSseAdapter,
|
|
10263
10266
|
K as delay,
|
|
10264
|
-
|
|
10267
|
+
Zh as deserializeMessages,
|
|
10265
10268
|
Zi as getMessageText,
|
|
10269
|
+
Jh as isChartPart,
|
|
10266
10270
|
zr as isProposalPart,
|
|
10267
|
-
|
|
10271
|
+
ad as juneauCs,
|
|
10268
10272
|
Lr as juneauEn,
|
|
10269
|
-
|
|
10273
|
+
td as mockAdapter,
|
|
10270
10274
|
Pr as parseJuneauWire,
|
|
10271
|
-
|
|
10275
|
+
Kh as serializeForStorage,
|
|
10272
10276
|
Ki as serializeMessages,
|
|
10273
|
-
|
|
10277
|
+
ed as trimChats,
|
|
10274
10278
|
nl as trimHistory,
|
|
10275
10279
|
ml as useAiChat,
|
|
10276
10280
|
xl as useAiChatContext,
|
|
10277
|
-
|
|
10281
|
+
ld as useAiChatContextSafe
|
|
10278
10282
|
};
|
|
10279
10283
|
//# sourceMappingURL=index.js.map
|