@webskill/chatbot 0.17.0 → 0.19.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/chatbot.css +30 -0
- package/dist/config.d.ts +5 -2
- package/dist/config.js +59 -3
- package/dist/index-DhXFYp0d.d.ts +1417 -0
- package/dist/index.d.ts +399 -12
- package/dist/index.js +2357 -483
- package/dist/{parse-79VbXLl4.js → parse-BtdRevDk.js} +5 -2
- package/dist/{parse-Cc8nFxir.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-B25ux241.d.ts +0 -390
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
|
}
|
|
@@ -388,6 +392,9 @@
|
|
|
388
392
|
.ms-auto {
|
|
389
393
|
margin-inline-start: auto;
|
|
390
394
|
}
|
|
395
|
+
.me-1 {
|
|
396
|
+
margin-inline-end: var(--spacing);
|
|
397
|
+
}
|
|
391
398
|
.mt-0\.5 {
|
|
392
399
|
margin-top: calc(var(--spacing) * 0.5);
|
|
393
400
|
}
|
|
@@ -493,6 +500,9 @@
|
|
|
493
500
|
.h-0 {
|
|
494
501
|
height: 0px;
|
|
495
502
|
}
|
|
503
|
+
.h-1 {
|
|
504
|
+
height: var(--spacing);
|
|
505
|
+
}
|
|
496
506
|
.h-2 {
|
|
497
507
|
height: calc(var(--spacing) * 2);
|
|
498
508
|
}
|
|
@@ -538,12 +548,18 @@
|
|
|
538
548
|
.max-h-72 {
|
|
539
549
|
max-height: calc(var(--spacing) * 72);
|
|
540
550
|
}
|
|
551
|
+
.max-h-96 {
|
|
552
|
+
max-height: calc(var(--spacing) * 96);
|
|
553
|
+
}
|
|
541
554
|
.max-h-\[calc\(100dvh-2rem\)\] {
|
|
542
555
|
max-height: calc(100dvh - 2rem);
|
|
543
556
|
}
|
|
544
557
|
.max-h-\[var\(--radix-select-content-available-height\)\] {
|
|
545
558
|
max-height: var(--radix-select-content-available-height);
|
|
546
559
|
}
|
|
560
|
+
.max-h-none {
|
|
561
|
+
max-height: none;
|
|
562
|
+
}
|
|
547
563
|
.min-h-0 {
|
|
548
564
|
min-height: 0px;
|
|
549
565
|
}
|
|
@@ -708,6 +724,9 @@
|
|
|
708
724
|
.cursor-default {
|
|
709
725
|
cursor: default;
|
|
710
726
|
}
|
|
727
|
+
.cursor-grab {
|
|
728
|
+
cursor: grab;
|
|
729
|
+
}
|
|
711
730
|
.cursor-not-allowed {
|
|
712
731
|
cursor: not-allowed;
|
|
713
732
|
}
|
|
@@ -1032,6 +1051,12 @@
|
|
|
1032
1051
|
.bg-muted-foreground {
|
|
1033
1052
|
background-color: var(--muted-foreground);
|
|
1034
1053
|
}
|
|
1054
|
+
.bg-muted\/40 {
|
|
1055
|
+
background-color: var(--muted-foreground);
|
|
1056
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1057
|
+
background-color: color-mix(in oklab, var(--muted-foreground) 40%, transparent);
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1035
1060
|
.bg-popover {
|
|
1036
1061
|
background-color: var(--popover);
|
|
1037
1062
|
}
|
|
@@ -1707,6 +1732,9 @@
|
|
|
1707
1732
|
--tw-outline-style: none;
|
|
1708
1733
|
outline-style: none;
|
|
1709
1734
|
}
|
|
1735
|
+
.active\:cursor-grabbing:active {
|
|
1736
|
+
cursor: grabbing;
|
|
1737
|
+
}
|
|
1710
1738
|
.active\:bg-primary\/80:active {
|
|
1711
1739
|
background-color: var(--primary);
|
|
1712
1740
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -2711,6 +2739,7 @@
|
|
|
2711
2739
|
font-size: 0.9375rem;
|
|
2712
2740
|
line-height: 1.45;
|
|
2713
2741
|
white-space: pre-wrap;
|
|
2742
|
+
overflow-wrap: anywhere;
|
|
2714
2743
|
}
|
|
2715
2744
|
.webskill-aui-message--assistant {
|
|
2716
2745
|
display: flex;
|
|
@@ -2722,6 +2751,7 @@
|
|
|
2722
2751
|
max-width: 46rem;
|
|
2723
2752
|
font-size: 0.9375rem;
|
|
2724
2753
|
line-height: 1.65;
|
|
2754
|
+
overflow-wrap: anywhere;
|
|
2725
2755
|
}
|
|
2726
2756
|
.webskill-aui-actions {
|
|
2727
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';
|
|
@@ -27,6 +27,9 @@ declare class WebSkillConfigError extends Error {
|
|
|
27
27
|
*
|
|
28
28
|
* 数组是**替换**语义:`entries: []` 是「用户把模型删光了」,
|
|
29
29
|
* 与「从没配过」(键缺席)必须分得开,否则删掉的条目会自己长回来。
|
|
30
|
+
*
|
|
31
|
+
* 唯一的例外是 `llm.entries` 里的**烘焙条目**:它们是随扩展一起发的运维配置,
|
|
32
|
+
* 不是用户资产,走 `syncBakedEntries` 的下发语义(0.21.0 分册 24)。
|
|
30
33
|
*/
|
|
31
34
|
/** 三方合并的输入 @experimental */
|
|
32
35
|
interface ApplyConfigDefaultsInput {
|
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) {
|
|
@@ -37,6 +37,62 @@ function mergeLeaf(stored, defaultValue, lastApplied) {
|
|
|
37
37
|
return stored;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
|
+
* 烘焙模型按 id 强制同步(0.21.0 分册 24 · FR-24.1)。
|
|
41
|
+
*
|
|
42
|
+
* 与 `mergeLeaf` 的「缺省值」语义不同,这里是**下发**:整片 `entries` 是一片叶子,
|
|
43
|
+
* 用户只要动过列表任意一处,此后所有重新打包的模型配置都到不了他那里。
|
|
44
|
+
* 所以烘焙条目按 id 整条覆盖、按 defaults 的顺序在前,用户自建的按原相对序在末尾。
|
|
45
|
+
*
|
|
46
|
+
* 但下发只在**运维真的重新打包过模型配置时**发生(FR-24.1d):烘焙列表与快照逐字
|
|
47
|
+
* 相同,说明这一版没人改过 `config.json`,此时用户在 Console 里的改动与排序全部作数。
|
|
48
|
+
* 快照缺席(全新安装或重装扩展)按「变了」处理——那正是「恢复初始化配置」的时刻。
|
|
49
|
+
*
|
|
50
|
+
* 读的是 `stored` 原始值而不是合并后的那份:合并后的 `entries` 已经被叶子规则
|
|
51
|
+
* 选过边,从它数不准「用户自建了哪些」。
|
|
52
|
+
*/
|
|
53
|
+
function syncBakedEntries(stored, baked, previous, retired) {
|
|
54
|
+
const bakedIds = new Set(baked.map((entry) => entry.id));
|
|
55
|
+
const kept = Array.isArray(stored) ? stored.filter((entry) => isPlainObject(entry) && typeof entry["id"] === "string" && !retired.has(entry["id"])) : [];
|
|
56
|
+
if (previous !== void 0 && sameValue(previous, baked)) {
|
|
57
|
+
const storedIds = new Set(kept.map((entry) => entry.id));
|
|
58
|
+
return [...kept, ...baked.filter((entry) => !storedIds.has(entry.id))];
|
|
59
|
+
}
|
|
60
|
+
return [...baked, ...kept.filter((entry) => !bakedIds.has(entry.id))];
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* 上一版烘过、这一版不再烘的 id(FR-24.5)。
|
|
64
|
+
*
|
|
65
|
+
* 不认它们的话,运维从 `config.json` 里删掉的模型会以「用户自建」的身份
|
|
66
|
+
* 永久留在每台机器上。快照缺席时分辨不出来,一律保留。
|
|
67
|
+
*/
|
|
68
|
+
function retiredBakedIds(lastApplied, baked) {
|
|
69
|
+
const previous = lastApplied?.llm?.entries ?? [];
|
|
70
|
+
const bakedIds = new Set(baked.map((entry) => entry.id));
|
|
71
|
+
return new Set(previous.map((entry) => entry.id).filter((id) => !bakedIds.has(id)));
|
|
72
|
+
}
|
|
73
|
+
/** 烘焙条目在新一版里被删掉时,用户的默认项会变成空引用——那条空引用正是本册造出来的(FR-24.4) */
|
|
74
|
+
function resolveDefaultId(entries, current) {
|
|
75
|
+
if (typeof current === "string" && entries.some((entry) => entry.id === current)) return current;
|
|
76
|
+
return entries[0]?.id;
|
|
77
|
+
}
|
|
78
|
+
/** `llm.entries` 之外的一切仍走 0.20.0 的逐叶子规则 */
|
|
79
|
+
function applyBakedModels(merged, stored, defaults, lastApplied) {
|
|
80
|
+
const baked = defaults.llm?.entries;
|
|
81
|
+
if (baked === void 0 || !isPlainObject(merged)) return merged;
|
|
82
|
+
const storedLlm = isPlainObject(stored) ? stored["llm"] : void 0;
|
|
83
|
+
const entries = syncBakedEntries(isPlainObject(storedLlm) ? storedLlm["entries"] : void 0, baked, lastApplied?.llm?.entries, retiredBakedIds(lastApplied, baked));
|
|
84
|
+
const llm = isPlainObject(merged["llm"]) ? merged["llm"] : {};
|
|
85
|
+
const defaultId = resolveDefaultId(entries, llm["defaultId"]);
|
|
86
|
+
return {
|
|
87
|
+
...merged,
|
|
88
|
+
llm: {
|
|
89
|
+
...llm,
|
|
90
|
+
entries,
|
|
91
|
+
...defaultId === void 0 ? {} : { defaultId }
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
40
96
|
* `lastApplied` 缺席时每条分支都退化成「stored 存在就取 stored」,
|
|
41
97
|
* 即老实现的 `deepMerge(defaults, stored)`——修订跟随是纯增量,不改既有语义。
|
|
42
98
|
* @experimental
|
|
@@ -44,7 +100,7 @@ function mergeLeaf(stored, defaultValue, lastApplied) {
|
|
|
44
100
|
function applyConfigDefaults(input) {
|
|
45
101
|
const { stored, defaults, lastApplied } = input;
|
|
46
102
|
return {
|
|
47
|
-
config: mergeRuntimeConfigDefaults(stored === void 0 ? defaults : mergeLeaf(stored, defaults, lastApplied)),
|
|
103
|
+
config: mergeRuntimeConfigDefaults(applyBakedModels(stored === void 0 ? defaults : mergeLeaf(stored, defaults, lastApplied), stored, defaults, lastApplied)),
|
|
48
104
|
snapshot: defaults
|
|
49
105
|
};
|
|
50
106
|
}
|