@webskill/chatbot 0.18.0 → 0.20.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/README.md +12 -6
- package/dist/chatbot.css +15 -0
- package/dist/config.d.ts +2 -2
- package/dist/config.js +2 -2
- package/dist/index-DhXFYp0d.d.ts +1417 -0
- package/dist/index.d.ts +172 -8
- package/dist/index.js +1590 -342
- package/dist/{parse-Bo68XTn_.js → parse-BtdRevDk.js} +1 -1
- package/dist/{parse-B8D0fl8I.d.ts → parse-Cu0G_3gS.d.ts} +1 -1
- package/dist/{types-C4dzGOPp.js → types-D6kVxBO9.js} +15 -5
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +1 -1
- package/package.json +7 -3
- package/dist/index-Nnkn73aD.d.ts +0 -398
package/README.md
CHANGED
|
@@ -114,18 +114,24 @@ implementation (OPFS storage, skills, demo/model providers, console embedding).
|
|
|
114
114
|
`ChatEngine.listSessions()` forwards straight to the `SessionStore`, so the
|
|
115
115
|
default `FsSessionStore` decides what you see:
|
|
116
116
|
|
|
117
|
-
- Sessions
|
|
118
|
-
|
|
119
|
-
and the oldest session is not on it.
|
|
117
|
+
- Sessions come back **newest first**: `items[0]` is the most recently created
|
|
118
|
+
session, and the first screen holds the newest page.
|
|
120
119
|
- The page size is the store's (`FS_SESSION_PAGE_SIZE`, 50). `<Chatbot>` does
|
|
121
120
|
not override it — pass your own `sessionStore` if you need another size.
|
|
122
|
-
- `nextCursor` points further back in history
|
|
123
|
-
|
|
124
|
-
|
|
121
|
+
- `nextCursor` points further back in history, and the page it returns is
|
|
122
|
+
appended to the **end** of the list. While it is set, the session list shows a
|
|
123
|
+
**Load earlier sessions** entry **below** the existing rows; when it is absent
|
|
124
|
+
the list is at the end and the entry disappears, so "no button" always means
|
|
125
|
+
"nothing older".
|
|
125
126
|
- Session files that cannot be parsed are skipped rather than failing the whole
|
|
126
127
|
list. Their file names come back in `skipped` and are shown above the list, so
|
|
127
128
|
a session you expected to see but cannot is always accounted for.
|
|
128
129
|
|
|
130
|
+
If you supply your own `SessionStore`, its `list()` must return the page
|
|
131
|
+
newest-first. This is a behavioural contract that the type system cannot check:
|
|
132
|
+
a store that still returns ascending order will render the oldest session at the
|
|
133
|
+
top.
|
|
134
|
+
|
|
129
135
|
## Embedding models
|
|
130
136
|
|
|
131
137
|
- **As a component** inside an existing web app — mount `<Chatbot>` in your own
|
package/dist/chatbot.css
CHANGED
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
--color-success: var(--success);
|
|
51
51
|
--color-warning: var(--warning);
|
|
52
52
|
--color-info: var(--info);
|
|
53
|
+
--color-canvas: var(--background);
|
|
53
54
|
--color-surface: var(--card);
|
|
54
55
|
--color-subtle: var(--accent);
|
|
55
56
|
--color-ink: var(--foreground);
|
|
@@ -358,6 +359,9 @@
|
|
|
358
359
|
.m-3 {
|
|
359
360
|
margin: calc(var(--spacing) * 3);
|
|
360
361
|
}
|
|
362
|
+
.m-4 {
|
|
363
|
+
margin: calc(var(--spacing) * 4);
|
|
364
|
+
}
|
|
361
365
|
.mx-1 {
|
|
362
366
|
margin-inline: var(--spacing);
|
|
363
367
|
}
|
|
@@ -496,6 +500,9 @@
|
|
|
496
500
|
.h-0 {
|
|
497
501
|
height: 0px;
|
|
498
502
|
}
|
|
503
|
+
.h-1 {
|
|
504
|
+
height: var(--spacing);
|
|
505
|
+
}
|
|
499
506
|
.h-2 {
|
|
500
507
|
height: calc(var(--spacing) * 2);
|
|
501
508
|
}
|
|
@@ -541,12 +548,18 @@
|
|
|
541
548
|
.max-h-72 {
|
|
542
549
|
max-height: calc(var(--spacing) * 72);
|
|
543
550
|
}
|
|
551
|
+
.max-h-96 {
|
|
552
|
+
max-height: calc(var(--spacing) * 96);
|
|
553
|
+
}
|
|
544
554
|
.max-h-\[calc\(100dvh-2rem\)\] {
|
|
545
555
|
max-height: calc(100dvh - 2rem);
|
|
546
556
|
}
|
|
547
557
|
.max-h-\[var\(--radix-select-content-available-height\)\] {
|
|
548
558
|
max-height: var(--radix-select-content-available-height);
|
|
549
559
|
}
|
|
560
|
+
.max-h-none {
|
|
561
|
+
max-height: none;
|
|
562
|
+
}
|
|
550
563
|
.min-h-0 {
|
|
551
564
|
min-height: 0px;
|
|
552
565
|
}
|
|
@@ -2726,6 +2739,7 @@
|
|
|
2726
2739
|
font-size: 0.9375rem;
|
|
2727
2740
|
line-height: 1.45;
|
|
2728
2741
|
white-space: pre-wrap;
|
|
2742
|
+
overflow-wrap: anywhere;
|
|
2729
2743
|
}
|
|
2730
2744
|
.webskill-aui-message--assistant {
|
|
2731
2745
|
display: flex;
|
|
@@ -2737,6 +2751,7 @@
|
|
|
2737
2751
|
max-width: 46rem;
|
|
2738
2752
|
font-size: 0.9375rem;
|
|
2739
2753
|
line-height: 1.65;
|
|
2754
|
+
overflow-wrap: anywhere;
|
|
2740
2755
|
}
|
|
2741
2756
|
.webskill-aui-actions {
|
|
2742
2757
|
min-height: 1.75rem;
|
package/dist/config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as RuntimeConfig, r as RuntimeConfigStore } from "./index-
|
|
2
|
-
import { a as parseWebSkillConfig, c as ConfigFieldSpec, i as WebSkillConfigDefaults, l as ConfigLeafKind, n as ParseWebSkillConfigOptions, o as CONFIGURED_RUNTIME_PATHS, r as ParsedWebSkillConfig, s as CONFIG_FIELDS, t as CONFIG_TOP_LEVEL_SECTIONS, u as NON_CONFIGURABLE_RUNTIME_PATHS } from "./parse-
|
|
1
|
+
import { n as RuntimeConfig, r as RuntimeConfigStore } from "./index-DhXFYp0d.js";
|
|
2
|
+
import { a as parseWebSkillConfig, c as ConfigFieldSpec, i as WebSkillConfigDefaults, l as ConfigLeafKind, n as ParseWebSkillConfigOptions, o as CONFIGURED_RUNTIME_PATHS, r as ParsedWebSkillConfig, s as CONFIG_FIELDS, t as CONFIG_TOP_LEVEL_SECTIONS, u as NON_CONFIGURABLE_RUNTIME_PATHS } from "./parse-Cu0G_3gS.js";
|
|
3
3
|
//#region src/config/errors.d.ts
|
|
4
4
|
/** 稳定错误码,供宿主可编程处理;`message` 一律英文 @experimental */
|
|
5
5
|
type WebSkillConfigErrorCode = 'CONFIG_UNKNOWN_KEY' | 'CONFIG_TYPE' | 'CONFIG_RANGE' | 'CONFIG_ENUM' | 'CONFIG_SHAPE' | 'CONFIG_REFERENCE';
|
package/dist/config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as mergeRuntimeConfigDefaults } from "./types-
|
|
2
|
-
import { a as NON_CONFIGURABLE_RUNTIME_PATHS, i as CONFIG_FIELDS, n as parseWebSkillConfig, o as WebSkillConfigError, r as CONFIGURED_RUNTIME_PATHS, t as CONFIG_TOP_LEVEL_SECTIONS } from "./parse-
|
|
1
|
+
import { r as mergeRuntimeConfigDefaults } from "./types-D6kVxBO9.js";
|
|
2
|
+
import { a as NON_CONFIGURABLE_RUNTIME_PATHS, i as CONFIG_FIELDS, n as parseWebSkillConfig, o as WebSkillConfigError, r as CONFIGURED_RUNTIME_PATHS, t as CONFIG_TOP_LEVEL_SECTIONS } from "./parse-BtdRevDk.js";
|
|
3
3
|
|
|
4
4
|
//#region src/config/merge.ts
|
|
5
5
|
function isPlainObject(value) {
|