@webskill/chatbot 0.4.0 → 0.5.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 +151 -22
- package/dist/index.d.ts +84 -67
- package/dist/index.js +2046 -2728
- package/package.json +2 -2
package/dist/chatbot.css
CHANGED
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
--font-weight-semibold: 600;
|
|
28
28
|
--tracking-normal: 0em;
|
|
29
29
|
--tracking-wide: 0.025em;
|
|
30
|
+
--radius-xl: 0.75rem;
|
|
30
31
|
--animate-spin: spin 1s linear infinite;
|
|
31
32
|
--animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
32
33
|
--aspect-video: 16 / 9;
|
|
@@ -43,6 +44,7 @@
|
|
|
43
44
|
--color-secondary: var(--secondary);
|
|
44
45
|
--color-secondary-foreground: var(--secondary-foreground);
|
|
45
46
|
--color-muted: var(--muted-foreground);
|
|
47
|
+
--color-accent: var(--accent);
|
|
46
48
|
--color-border: var(--border);
|
|
47
49
|
--color-input: var(--input);
|
|
48
50
|
--color-ring: var(--ring);
|
|
@@ -310,11 +312,29 @@
|
|
|
310
312
|
.left-full {
|
|
311
313
|
left: 100%;
|
|
312
314
|
}
|
|
313
|
-
.z-
|
|
314
|
-
z-index:
|
|
315
|
+
.z-\[var\(--webskill-z-dialog\)\] {
|
|
316
|
+
z-index: var(--webskill-z-dialog);
|
|
315
317
|
}
|
|
316
|
-
.z-
|
|
317
|
-
z-index:
|
|
318
|
+
.z-\[var\(--webskill-z-overlay\)\] {
|
|
319
|
+
z-index: var(--webskill-z-overlay);
|
|
320
|
+
}
|
|
321
|
+
.z-\[var\(--webskill-z-popper\)\] {
|
|
322
|
+
z-index: var(--webskill-z-popper);
|
|
323
|
+
}
|
|
324
|
+
.z-\[var\(--webskill-z-raised\)\] {
|
|
325
|
+
z-index: var(--webskill-z-raised);
|
|
326
|
+
}
|
|
327
|
+
.z-\[var\(--webskill-z-scrim\)\] {
|
|
328
|
+
z-index: var(--webskill-z-scrim);
|
|
329
|
+
}
|
|
330
|
+
.z-\[var\(--webskill-z-sheet\)\] {
|
|
331
|
+
z-index: var(--webskill-z-sheet);
|
|
332
|
+
}
|
|
333
|
+
.z-\[var\(--webskill-z-toast\)\] {
|
|
334
|
+
z-index: var(--webskill-z-toast);
|
|
335
|
+
}
|
|
336
|
+
.z-\[var\(--webskill-z-tooltip\)\] {
|
|
337
|
+
z-index: var(--webskill-z-tooltip);
|
|
318
338
|
}
|
|
319
339
|
.container {
|
|
320
340
|
width: 100%;
|
|
@@ -364,9 +384,6 @@
|
|
|
364
384
|
.ms-auto {
|
|
365
385
|
margin-inline-start: auto;
|
|
366
386
|
}
|
|
367
|
-
.-mt-2 {
|
|
368
|
-
margin-top: calc(var(--spacing) * -2);
|
|
369
|
-
}
|
|
370
387
|
.mt-0\.5 {
|
|
371
388
|
margin-top: calc(var(--spacing) * 0.5);
|
|
372
389
|
}
|
|
@@ -519,6 +536,9 @@
|
|
|
519
536
|
.min-h-20 {
|
|
520
537
|
min-height: calc(var(--spacing) * 20);
|
|
521
538
|
}
|
|
539
|
+
.min-h-40 {
|
|
540
|
+
min-height: calc(var(--spacing) * 40);
|
|
541
|
+
}
|
|
522
542
|
.min-h-48 {
|
|
523
543
|
min-height: calc(var(--spacing) * 48);
|
|
524
544
|
}
|
|
@@ -615,6 +635,9 @@
|
|
|
615
635
|
.flex-1 {
|
|
616
636
|
flex: 1;
|
|
617
637
|
}
|
|
638
|
+
.shrink {
|
|
639
|
+
flex-shrink: 1;
|
|
640
|
+
}
|
|
618
641
|
.shrink-0 {
|
|
619
642
|
flex-shrink: 0;
|
|
620
643
|
}
|
|
@@ -692,9 +715,6 @@
|
|
|
692
715
|
.grid-cols-1 {
|
|
693
716
|
grid-template-columns: repeat(1, minmax(0, 1fr));
|
|
694
717
|
}
|
|
695
|
-
.grid-cols-2 {
|
|
696
|
-
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
697
|
-
}
|
|
698
718
|
.flex-col {
|
|
699
719
|
flex-direction: column;
|
|
700
720
|
}
|
|
@@ -737,6 +757,9 @@
|
|
|
737
757
|
.gap-2 {
|
|
738
758
|
gap: calc(var(--spacing) * 2);
|
|
739
759
|
}
|
|
760
|
+
.gap-2\.5 {
|
|
761
|
+
gap: calc(var(--spacing) * 2.5);
|
|
762
|
+
}
|
|
740
763
|
.gap-3 {
|
|
741
764
|
gap: calc(var(--spacing) * 3);
|
|
742
765
|
}
|
|
@@ -811,6 +834,9 @@
|
|
|
811
834
|
.rounded-sm {
|
|
812
835
|
border-radius: calc(var(--radius) - 4px);
|
|
813
836
|
}
|
|
837
|
+
.rounded-xl {
|
|
838
|
+
border-radius: var(--radius-xl);
|
|
839
|
+
}
|
|
814
840
|
.rounded-t-lg {
|
|
815
841
|
border-top-left-radius: 1rem;
|
|
816
842
|
border-top-right-radius: 1rem;
|
|
@@ -866,6 +892,12 @@
|
|
|
866
892
|
.border-border {
|
|
867
893
|
border-color: var(--border);
|
|
868
894
|
}
|
|
895
|
+
.border-border\/80 {
|
|
896
|
+
border-color: var(--border);
|
|
897
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
898
|
+
border-color: color-mix(in oklab, var(--border) 80%, transparent);
|
|
899
|
+
}
|
|
900
|
+
}
|
|
869
901
|
.border-danger\/30 {
|
|
870
902
|
border-color: var(--destructive);
|
|
871
903
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -917,6 +949,12 @@
|
|
|
917
949
|
.bg-canvas {
|
|
918
950
|
background-color: var(--background);
|
|
919
951
|
}
|
|
952
|
+
.bg-canvas\/50 {
|
|
953
|
+
background-color: var(--background);
|
|
954
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
955
|
+
background-color: color-mix(in oklab, var(--background) 50%, transparent);
|
|
956
|
+
}
|
|
957
|
+
}
|
|
920
958
|
.bg-card {
|
|
921
959
|
background-color: var(--card);
|
|
922
960
|
}
|
|
@@ -1161,9 +1199,6 @@
|
|
|
1161
1199
|
font-size: var(--text-xs);
|
|
1162
1200
|
line-height: var(--tw-leading, var(--text-xs--line-height));
|
|
1163
1201
|
}
|
|
1164
|
-
.text-\[0\.85em\] {
|
|
1165
|
-
font-size: 0.85em;
|
|
1166
|
-
}
|
|
1167
1202
|
.leading-6 {
|
|
1168
1203
|
--tw-leading: calc(var(--spacing) * 6);
|
|
1169
1204
|
line-height: calc(var(--spacing) * 6);
|
|
@@ -1221,9 +1256,6 @@
|
|
|
1221
1256
|
.text-ink {
|
|
1222
1257
|
color: var(--foreground);
|
|
1223
1258
|
}
|
|
1224
|
-
.text-input {
|
|
1225
|
-
color: var(--input);
|
|
1226
|
-
}
|
|
1227
1259
|
.text-muted {
|
|
1228
1260
|
color: var(--muted-foreground);
|
|
1229
1261
|
}
|
|
@@ -1609,15 +1641,35 @@
|
|
|
1609
1641
|
.disabled\:opacity-60:disabled {
|
|
1610
1642
|
opacity: 60%;
|
|
1611
1643
|
}
|
|
1644
|
+
@media (hover: hover) {
|
|
1645
|
+
.disabled\:hover\:bg-transparent:disabled:hover {
|
|
1646
|
+
background-color: transparent;
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1649
|
+
.has-disabled\:cursor-not-allowed:has(:disabled) {
|
|
1650
|
+
cursor: not-allowed;
|
|
1651
|
+
}
|
|
1652
|
+
.has-disabled\:opacity-50:has(:disabled) {
|
|
1653
|
+
opacity: 50%;
|
|
1654
|
+
}
|
|
1612
1655
|
.has-\[\[aria-expanded\=true\]\]\:opacity-100:has(:is([aria-expanded=true])) {
|
|
1613
1656
|
opacity: 100%;
|
|
1614
1657
|
}
|
|
1615
1658
|
.aria-disabled\:pointer-events-none[aria-disabled="true"] {
|
|
1616
1659
|
pointer-events: none;
|
|
1617
1660
|
}
|
|
1661
|
+
.aria-disabled\:cursor-not-allowed[aria-disabled="true"] {
|
|
1662
|
+
cursor: not-allowed;
|
|
1663
|
+
}
|
|
1618
1664
|
.aria-disabled\:opacity-50[aria-disabled="true"] {
|
|
1619
1665
|
opacity: 50%;
|
|
1620
1666
|
}
|
|
1667
|
+
.data-dragging\:border-ring[data-dragging] {
|
|
1668
|
+
border-color: var(--ring);
|
|
1669
|
+
}
|
|
1670
|
+
.data-dragging\:bg-subtle[data-dragging] {
|
|
1671
|
+
background-color: var(--accent);
|
|
1672
|
+
}
|
|
1621
1673
|
.data-\[active\=true\]\:bg-sidebar-accent[data-active="true"] {
|
|
1622
1674
|
background-color: var(--sidebar-accent);
|
|
1623
1675
|
}
|
|
@@ -1646,6 +1698,15 @@
|
|
|
1646
1698
|
.data-\[highlighted\]\:bg-subtle[data-highlighted] {
|
|
1647
1699
|
background-color: var(--accent);
|
|
1648
1700
|
}
|
|
1701
|
+
.data-\[orientation\=horizontal\]\:flex-row[data-orientation="horizontal"] {
|
|
1702
|
+
flex-direction: row;
|
|
1703
|
+
}
|
|
1704
|
+
.data-\[orientation\=horizontal\]\:items-center[data-orientation="horizontal"] {
|
|
1705
|
+
align-items: center;
|
|
1706
|
+
}
|
|
1707
|
+
.data-\[orientation\=vertical\]\:flex-col[data-orientation="vertical"] {
|
|
1708
|
+
flex-direction: column;
|
|
1709
|
+
}
|
|
1649
1710
|
.data-\[selected\=true\]\:bg-subtle[data-selected="true"] {
|
|
1650
1711
|
background-color: var(--accent);
|
|
1651
1712
|
}
|
|
@@ -1687,6 +1748,31 @@
|
|
|
1687
1748
|
color: var(--sidebar-accent-foreground);
|
|
1688
1749
|
}
|
|
1689
1750
|
}
|
|
1751
|
+
@media (width < 40rem) {
|
|
1752
|
+
.max-sm\:top-0 {
|
|
1753
|
+
top: 0px;
|
|
1754
|
+
}
|
|
1755
|
+
.max-sm\:left-0 {
|
|
1756
|
+
left: 0px;
|
|
1757
|
+
}
|
|
1758
|
+
.max-sm\:h-dvh {
|
|
1759
|
+
height: 100dvh;
|
|
1760
|
+
}
|
|
1761
|
+
.max-sm\:max-h-dvh {
|
|
1762
|
+
max-height: 100dvh;
|
|
1763
|
+
}
|
|
1764
|
+
.max-sm\:translate-x-0 {
|
|
1765
|
+
--tw-translate-x: 0px;
|
|
1766
|
+
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
1767
|
+
}
|
|
1768
|
+
.max-sm\:translate-y-0 {
|
|
1769
|
+
--tw-translate-y: 0px;
|
|
1770
|
+
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
1771
|
+
}
|
|
1772
|
+
.max-sm\:rounded-none {
|
|
1773
|
+
border-radius: 0;
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1690
1776
|
@media (width >= 40rem) {
|
|
1691
1777
|
.sm\:block {
|
|
1692
1778
|
display: block;
|
|
@@ -1952,6 +2038,7 @@
|
|
|
1952
2038
|
--brand: oklch(0.55 0.16 275);
|
|
1953
2039
|
--brand-foreground: oklch(0.985 0 0);
|
|
1954
2040
|
--text-min: 0.75rem;
|
|
2041
|
+
--text-code: 0.8125rem;
|
|
1955
2042
|
}
|
|
1956
2043
|
:where(.dark, [data-theme='dark']) {
|
|
1957
2044
|
--background: oklch(0.145 0 0);
|
|
@@ -2075,6 +2162,18 @@
|
|
|
2075
2162
|
[data-webskill-theme='dark'] {
|
|
2076
2163
|
color-scheme: dark;
|
|
2077
2164
|
}
|
|
2165
|
+
:root {
|
|
2166
|
+
--webskill-z-content: 0;
|
|
2167
|
+
--webskill-z-sticky: 10;
|
|
2168
|
+
--webskill-z-raised: 20;
|
|
2169
|
+
--webskill-z-overlay: 1000;
|
|
2170
|
+
--webskill-z-scrim: 10;
|
|
2171
|
+
--webskill-z-sheet: 20;
|
|
2172
|
+
--webskill-z-dialog: 30;
|
|
2173
|
+
--webskill-z-popper: 40;
|
|
2174
|
+
--webskill-z-tooltip: 50;
|
|
2175
|
+
--webskill-z-toast: 60;
|
|
2176
|
+
}
|
|
2078
2177
|
@layer components {
|
|
2079
2178
|
.webskill-sheet-content {
|
|
2080
2179
|
width: var(--webskill-sheet-width, min(22rem, calc(100vw - 2rem)));
|
|
@@ -2082,6 +2181,11 @@
|
|
|
2082
2181
|
.webskill-dialog-content {
|
|
2083
2182
|
width: var(--webskill-dialog-width, min(100% - 2rem, 32rem));
|
|
2084
2183
|
}
|
|
2184
|
+
@media (width < 40rem) {
|
|
2185
|
+
.webskill-dialog-content {
|
|
2186
|
+
width: 100%;
|
|
2187
|
+
}
|
|
2188
|
+
}
|
|
2085
2189
|
.webskill-toast-root {
|
|
2086
2190
|
width: 100%;
|
|
2087
2191
|
max-width: var(--webskill-toast-width, 24rem);
|
|
@@ -2098,6 +2202,26 @@
|
|
|
2098
2202
|
min-width: 10rem;
|
|
2099
2203
|
}
|
|
2100
2204
|
}
|
|
2205
|
+
.webskill-record-highlight {
|
|
2206
|
+
animation: webskill-record-highlight 1.6s ease-out 1;
|
|
2207
|
+
}
|
|
2208
|
+
@keyframes webskill-record-highlight {
|
|
2209
|
+
0%, 40% {
|
|
2210
|
+
background-color: color-mix(in oklab, var(--color-accent) 18%, transparent);
|
|
2211
|
+
}
|
|
2212
|
+
100% {
|
|
2213
|
+
background-color: transparent;
|
|
2214
|
+
}
|
|
2215
|
+
}
|
|
2216
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2217
|
+
.webskill-record-highlight {
|
|
2218
|
+
animation-duration: 1ms;
|
|
2219
|
+
background-color: var(--color-accent);
|
|
2220
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
2221
|
+
background-color: color-mix(in oklab, var(--color-accent) 18%, transparent);
|
|
2222
|
+
}
|
|
2223
|
+
}
|
|
2224
|
+
}
|
|
2101
2225
|
.webskill-surface-list {
|
|
2102
2226
|
display: flex;
|
|
2103
2227
|
flex-direction: column;
|
|
@@ -2178,18 +2302,27 @@
|
|
|
2178
2302
|
border-inline: 0;
|
|
2179
2303
|
border-radius: 0;
|
|
2180
2304
|
}
|
|
2305
|
+
[data-webskill-data-table] {
|
|
2306
|
+
container-type: inline-size;
|
|
2307
|
+
container-name: webskill-table;
|
|
2308
|
+
}
|
|
2309
|
+
@container webskill-table (width < 30rem) {
|
|
2310
|
+
.webskill-surface__table-header th, .webskill-surface__table-body td {
|
|
2311
|
+
--webskill-table-min-col: 5rem;
|
|
2312
|
+
}
|
|
2313
|
+
}
|
|
2181
2314
|
.webskill-surface__table-scroll table {
|
|
2182
2315
|
width: max-content;
|
|
2183
2316
|
min-width: 100%;
|
|
2184
2317
|
}
|
|
2185
2318
|
.webskill-surface__table-header {
|
|
2186
2319
|
position: sticky;
|
|
2187
|
-
z-index:
|
|
2320
|
+
z-index: var(--webskill-z-sticky);
|
|
2188
2321
|
top: 0;
|
|
2189
2322
|
background: var(--color-subtle);
|
|
2190
2323
|
}
|
|
2191
2324
|
.webskill-surface__table-header th, .webskill-surface__table-body td {
|
|
2192
|
-
min-width: 8rem;
|
|
2325
|
+
min-width: var(--webskill-table-min-col, 8rem);
|
|
2193
2326
|
border-inline-end: 1px solid var(--color-border);
|
|
2194
2327
|
border-bottom: 1px solid var(--color-border);
|
|
2195
2328
|
padding: 0.625rem 0.75rem;
|
|
@@ -2308,10 +2441,6 @@
|
|
|
2308
2441
|
opacity: 1;
|
|
2309
2442
|
}
|
|
2310
2443
|
.webskill-aui-composer {
|
|
2311
|
-
border-top: 1px solid var(--color-border);
|
|
2312
|
-
background: var(--color-card);
|
|
2313
|
-
}
|
|
2314
|
-
.webskill-aui-composer[data-centered='true'] {
|
|
2315
2444
|
border-top: 0;
|
|
2316
2445
|
background: transparent;
|
|
2317
2446
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AgentLoopConfig, ApprovalScope, BridgeCapabilities, ExternalSkillProvider, ExternalToolSource, FileSystemProvider, HookRunner, InteractionRequest, InteractionResponse, LifecycleEventInit, LlmClient, NetworkPolicy, Page, PageQuery, RenderBlock, RenderResultRequest, RunSnapshot, RunSnapshotListEntry, RuntimePhase, ScriptExecutor, SessionStore, SkillCandidateMarker, SkillCatalogEntry, SkillIntegrityGuard, SkillOutcomeReporter, SkillStateGuard, UiBridge, UiSpecDrafts, UiSpecEvent, UiSpecSnapshot, UiSurfaceActionRequest, UiSurfaceActionResponse, UserProfile,
|
|
1
|
+
import { AgentLoopConfig, ApprovalScope, BridgeCapabilities, ExternalSkillProvider, ExternalToolSource, FileSystemProvider, HookRunner, InteractionRequest, InteractionResponse, LifecycleEventInit, LlmClient, NetworkPolicy, Page, PageQuery, RenderBlock, RenderResultRequest, RunSnapshot, RunSnapshotListEntry, RuntimePhase, RuntimeRun, ScriptExecutor, SessionStore, SkillCandidateMarker, SkillCatalogEntry, SkillIntegrityGuard, SkillOutcomeReporter, SkillStateGuard, UiBridge, UiSpecDrafts, UiSpecEvent, UiSpecSnapshot, UiSurfaceActionRequest, UiSurfaceActionResponse, UserProfile, UserProfileExport, WebSkillErrorCode, diffUserProfile } from "@webskill/sdk";
|
|
2
2
|
import { SandboxMode, TypeScriptSupportOptions } from "@webskill/sdk/browser";
|
|
3
3
|
import { CustomSurfaceActionEvent, ReactBridgeState, SpecInteractionChannel, SurfaceRegistry, UiSurfaceActionEvent } from "@webskill/sdk/ui-react";
|
|
4
4
|
import { PageActionPolicy, PagePerceptionPolicy, PerceptionRecord, SkillCandidateSink, TodoItem } from "@webskill/sdk/agent";
|
|
@@ -290,6 +290,18 @@ interface ChatbotGovernancePorts {
|
|
|
290
290
|
skillOutcomeReporter?: SkillOutcomeReporter;
|
|
291
291
|
/** `SkillStatePolicy.catalogFilter()`:非 active 技能不进路由候选集 */
|
|
292
292
|
catalogFilter?: (entries: SkillCatalogEntry[]) => SkillCatalogEntry[] | Promise<SkillCatalogEntry[]>;
|
|
293
|
+
/**
|
|
294
|
+
* run 未激活任何技能时的钩子(如 `createMissHook`)。
|
|
295
|
+
*
|
|
296
|
+
* 开关存在 `GovernanceFacade.missHook`(属 console),chatbot 读不到也不该依赖它;
|
|
297
|
+
* 所以读开关是**宿主**的责任。宿主应传一个**每次触发时才读开关**的闭包,
|
|
298
|
+
* 而不是装配时把布尔值算好——`#assemble()` 不是每次 run 都跑,
|
|
299
|
+
* 算好了会导致「开着启动 → 中途关闭」不生效(AC-17.11)。
|
|
300
|
+
*/
|
|
301
|
+
onSkillMiss?: (input: {
|
|
302
|
+
prompt: string;
|
|
303
|
+
run: RuntimeRun;
|
|
304
|
+
}) => Promise<void>;
|
|
293
305
|
}
|
|
294
306
|
/** 分配式交叉:直接写 `信封 & LifecycleEventInit` 会把联合压成一个对象,`phase` 的判别性就没了 */
|
|
295
307
|
type WithChatMeta<T> = T extends unknown ? {
|
|
@@ -622,6 +634,20 @@ interface SandboxExecutorDeps {
|
|
|
622
634
|
/** 缺省时 `.ts` 脚本按 `TOOL_UNSUPPORTED` 拒绝 */
|
|
623
635
|
typescript?: TypeScriptSupportOptions;
|
|
624
636
|
}
|
|
637
|
+
/**
|
|
638
|
+
* 装配时(而非执行时)把 `sandbox.typescript` 转成执行器参数,让配置错误早暴露。
|
|
639
|
+
* 只对绝对 URL 走 `RemoteUrlPolicy`:同源相对路径与打包器 specifier 不是出站请求。
|
|
640
|
+
*/
|
|
641
|
+
/**
|
|
642
|
+
* 由 `RuntimeConfig` 装出沙箱执行器依赖。
|
|
643
|
+
*
|
|
644
|
+
* 主链路与**评估链路**共用这一处(T-17-H):此前评估侧只传 `fs`,
|
|
645
|
+
* 于是评估里跑的技能不受沙箱、网络策略、能力与授权范围约束——
|
|
646
|
+
* 那比「.ts 跑不了」严重得多(设计 17 §1.1a)。
|
|
647
|
+
*
|
|
648
|
+
* @experimental
|
|
649
|
+
*/
|
|
650
|
+
declare function sandboxExecutorDeps(fs: FileSystemProvider, rc?: RuntimeConfig, uiBridge?: SandboxExecutorDeps['uiBridge']): SandboxExecutorDeps;
|
|
625
651
|
/** @stable */
|
|
626
652
|
interface ChatEngineOptions {
|
|
627
653
|
llm?: LlmClient;
|
|
@@ -934,6 +960,8 @@ declare const chatbotDictionary: {
|
|
|
934
960
|
'message.copied': string;
|
|
935
961
|
'message.retry': string;
|
|
936
962
|
'message.delete': string;
|
|
963
|
+
'message.deleted.title': string;
|
|
964
|
+
'message.deleted.description': string;
|
|
937
965
|
'message.viewTrace': string;
|
|
938
966
|
'message.skillsUsed': string;
|
|
939
967
|
'message.edit': string;
|
|
@@ -1020,6 +1048,10 @@ declare const chatbotDictionary: {
|
|
|
1020
1048
|
'interaction.allow': string;
|
|
1021
1049
|
'interaction.deny': string;
|
|
1022
1050
|
'interaction.required': string;
|
|
1051
|
+
'surface.addItem': string;
|
|
1052
|
+
'surface.removeItem': string;
|
|
1053
|
+
'surface.arrayFirstItemOnly': string;
|
|
1054
|
+
'surface.readOnlySnapshot': string;
|
|
1023
1055
|
'interaction.wait': string;
|
|
1024
1056
|
'interaction.wait.inPanel': string;
|
|
1025
1057
|
'interaction.wait.fallback': string;
|
|
@@ -1051,7 +1083,7 @@ declare const chatbotDictionary: {
|
|
|
1051
1083
|
'composer.attachment.compressed': string;
|
|
1052
1084
|
'composer.model': string;
|
|
1053
1085
|
'composer.model.demo': string;
|
|
1054
|
-
'
|
|
1086
|
+
'capability.group': string;
|
|
1055
1087
|
'composer.pageCapture': string;
|
|
1056
1088
|
'composer.pageCapture.disabled.setting': string;
|
|
1057
1089
|
'composer.pageCapture.disabled.model': string;
|
|
@@ -1184,6 +1216,7 @@ declare const chatbotDictionary: {
|
|
|
1184
1216
|
'vercel.preview.badge': string;
|
|
1185
1217
|
'vercel.preview.description': string;
|
|
1186
1218
|
'surface.legacy.placeholder': string;
|
|
1219
|
+
'a11y.messageActions': string;
|
|
1187
1220
|
'error.title': string;
|
|
1188
1221
|
'error.suggestion': string;
|
|
1189
1222
|
'error.suggestion.LLM_UNAVAILABLE': string;
|
|
@@ -1194,6 +1227,7 @@ declare const chatbotDictionary: {
|
|
|
1194
1227
|
'error.suggestion.TOOL_RESOLUTION_EXHAUSTED': string;
|
|
1195
1228
|
'error.limit.totalTimeoutMs': string;
|
|
1196
1229
|
'error.limit.maxTurns': string;
|
|
1230
|
+
'error.message.RUN_CANCELLED': string;
|
|
1197
1231
|
'error.openSettings': string;
|
|
1198
1232
|
'error.dismiss': string;
|
|
1199
1233
|
};
|
|
@@ -1249,6 +1283,8 @@ declare const chatbotDictionary: {
|
|
|
1249
1283
|
'message.editCancel': string;
|
|
1250
1284
|
'message.retry': string;
|
|
1251
1285
|
'message.delete': string;
|
|
1286
|
+
'message.deleted.title': string;
|
|
1287
|
+
'message.deleted.description': string;
|
|
1252
1288
|
'message.viewTrace': string;
|
|
1253
1289
|
'message.skillsUsed': string;
|
|
1254
1290
|
'capability.tools.on': string;
|
|
@@ -1332,6 +1368,10 @@ declare const chatbotDictionary: {
|
|
|
1332
1368
|
'interaction.allow': string;
|
|
1333
1369
|
'interaction.deny': string;
|
|
1334
1370
|
'interaction.required': string;
|
|
1371
|
+
'surface.addItem': string;
|
|
1372
|
+
'surface.removeItem': string;
|
|
1373
|
+
'surface.arrayFirstItemOnly': string;
|
|
1374
|
+
'surface.readOnlySnapshot': string;
|
|
1335
1375
|
'interaction.wait': string;
|
|
1336
1376
|
'interaction.wait.inPanel': string;
|
|
1337
1377
|
'interaction.wait.fallback': string;
|
|
@@ -1363,7 +1403,7 @@ declare const chatbotDictionary: {
|
|
|
1363
1403
|
'composer.attachment.compressed': string;
|
|
1364
1404
|
'composer.model': string;
|
|
1365
1405
|
'composer.model.demo': string;
|
|
1366
|
-
'
|
|
1406
|
+
'capability.group': string;
|
|
1367
1407
|
'composer.pageCapture': string;
|
|
1368
1408
|
'composer.pageCapture.disabled.setting': string;
|
|
1369
1409
|
'composer.pageCapture.disabled.model': string;
|
|
@@ -1496,6 +1536,7 @@ declare const chatbotDictionary: {
|
|
|
1496
1536
|
'vercel.preview.badge': string;
|
|
1497
1537
|
'vercel.preview.description': string;
|
|
1498
1538
|
'surface.legacy.placeholder': string;
|
|
1539
|
+
'a11y.messageActions': string;
|
|
1499
1540
|
'error.title': string;
|
|
1500
1541
|
'error.suggestion': string;
|
|
1501
1542
|
'error.suggestion.LLM_UNAVAILABLE': string;
|
|
@@ -1506,6 +1547,7 @@ declare const chatbotDictionary: {
|
|
|
1506
1547
|
'error.suggestion.TOOL_RESOLUTION_EXHAUSTED': string;
|
|
1507
1548
|
'error.limit.totalTimeoutMs': string;
|
|
1508
1549
|
'error.limit.maxTurns': string;
|
|
1550
|
+
'error.message.RUN_CANCELLED': string;
|
|
1509
1551
|
'error.openSettings': string;
|
|
1510
1552
|
'error.dismiss': string;
|
|
1511
1553
|
};
|
|
@@ -1561,6 +1603,8 @@ declare const useT: () => TranslateFn<{
|
|
|
1561
1603
|
'message.copied': string;
|
|
1562
1604
|
'message.retry': string;
|
|
1563
1605
|
'message.delete': string;
|
|
1606
|
+
'message.deleted.title': string;
|
|
1607
|
+
'message.deleted.description': string;
|
|
1564
1608
|
'message.viewTrace': string;
|
|
1565
1609
|
'message.skillsUsed': string;
|
|
1566
1610
|
'message.edit': string;
|
|
@@ -1647,6 +1691,10 @@ declare const useT: () => TranslateFn<{
|
|
|
1647
1691
|
'interaction.allow': string;
|
|
1648
1692
|
'interaction.deny': string;
|
|
1649
1693
|
'interaction.required': string;
|
|
1694
|
+
'surface.addItem': string;
|
|
1695
|
+
'surface.removeItem': string;
|
|
1696
|
+
'surface.arrayFirstItemOnly': string;
|
|
1697
|
+
'surface.readOnlySnapshot': string;
|
|
1650
1698
|
'interaction.wait': string;
|
|
1651
1699
|
'interaction.wait.inPanel': string;
|
|
1652
1700
|
'interaction.wait.fallback': string;
|
|
@@ -1678,7 +1726,7 @@ declare const useT: () => TranslateFn<{
|
|
|
1678
1726
|
'composer.attachment.compressed': string;
|
|
1679
1727
|
'composer.model': string;
|
|
1680
1728
|
'composer.model.demo': string;
|
|
1681
|
-
'
|
|
1729
|
+
'capability.group': string;
|
|
1682
1730
|
'composer.pageCapture': string;
|
|
1683
1731
|
'composer.pageCapture.disabled.setting': string;
|
|
1684
1732
|
'composer.pageCapture.disabled.model': string;
|
|
@@ -1811,6 +1859,7 @@ declare const useT: () => TranslateFn<{
|
|
|
1811
1859
|
'vercel.preview.badge': string;
|
|
1812
1860
|
'vercel.preview.description': string;
|
|
1813
1861
|
'surface.legacy.placeholder': string;
|
|
1862
|
+
'a11y.messageActions': string;
|
|
1814
1863
|
'error.title': string;
|
|
1815
1864
|
'error.suggestion': string;
|
|
1816
1865
|
'error.suggestion.LLM_UNAVAILABLE': string;
|
|
@@ -1821,6 +1870,7 @@ declare const useT: () => TranslateFn<{
|
|
|
1821
1870
|
'error.suggestion.TOOL_RESOLUTION_EXHAUSTED': string;
|
|
1822
1871
|
'error.limit.totalTimeoutMs': string;
|
|
1823
1872
|
'error.limit.maxTurns': string;
|
|
1873
|
+
'error.message.RUN_CANCELLED': string;
|
|
1824
1874
|
'error.openSettings': string;
|
|
1825
1875
|
'error.dismiss': string;
|
|
1826
1876
|
};
|
|
@@ -1876,6 +1926,8 @@ declare const useT: () => TranslateFn<{
|
|
|
1876
1926
|
'message.editCancel': string;
|
|
1877
1927
|
'message.retry': string;
|
|
1878
1928
|
'message.delete': string;
|
|
1929
|
+
'message.deleted.title': string;
|
|
1930
|
+
'message.deleted.description': string;
|
|
1879
1931
|
'message.viewTrace': string;
|
|
1880
1932
|
'message.skillsUsed': string;
|
|
1881
1933
|
'capability.tools.on': string;
|
|
@@ -1959,6 +2011,10 @@ declare const useT: () => TranslateFn<{
|
|
|
1959
2011
|
'interaction.allow': string;
|
|
1960
2012
|
'interaction.deny': string;
|
|
1961
2013
|
'interaction.required': string;
|
|
2014
|
+
'surface.addItem': string;
|
|
2015
|
+
'surface.removeItem': string;
|
|
2016
|
+
'surface.arrayFirstItemOnly': string;
|
|
2017
|
+
'surface.readOnlySnapshot': string;
|
|
1962
2018
|
'interaction.wait': string;
|
|
1963
2019
|
'interaction.wait.inPanel': string;
|
|
1964
2020
|
'interaction.wait.fallback': string;
|
|
@@ -1990,7 +2046,7 @@ declare const useT: () => TranslateFn<{
|
|
|
1990
2046
|
'composer.attachment.compressed': string;
|
|
1991
2047
|
'composer.model': string;
|
|
1992
2048
|
'composer.model.demo': string;
|
|
1993
|
-
'
|
|
2049
|
+
'capability.group': string;
|
|
1994
2050
|
'composer.pageCapture': string;
|
|
1995
2051
|
'composer.pageCapture.disabled.setting': string;
|
|
1996
2052
|
'composer.pageCapture.disabled.model': string;
|
|
@@ -2123,6 +2179,7 @@ declare const useT: () => TranslateFn<{
|
|
|
2123
2179
|
'vercel.preview.badge': string;
|
|
2124
2180
|
'vercel.preview.description': string;
|
|
2125
2181
|
'surface.legacy.placeholder': string;
|
|
2182
|
+
'a11y.messageActions': string;
|
|
2126
2183
|
'error.title': string;
|
|
2127
2184
|
'error.suggestion': string;
|
|
2128
2185
|
'error.suggestion.LLM_UNAVAILABLE': string;
|
|
@@ -2133,6 +2190,7 @@ declare const useT: () => TranslateFn<{
|
|
|
2133
2190
|
'error.suggestion.TOOL_RESOLUTION_EXHAUSTED': string;
|
|
2134
2191
|
'error.limit.totalTimeoutMs': string;
|
|
2135
2192
|
'error.limit.maxTurns': string;
|
|
2193
|
+
'error.message.RUN_CANCELLED': string;
|
|
2136
2194
|
'error.openSettings': string;
|
|
2137
2195
|
'error.dismiss': string;
|
|
2138
2196
|
};
|
|
@@ -2154,6 +2212,20 @@ interface AppearanceChange {
|
|
|
2154
2212
|
dictationLang?: string;
|
|
2155
2213
|
}
|
|
2156
2214
|
//#endregion
|
|
2215
|
+
//#region src/react/settingsSection.d.ts
|
|
2216
|
+
/**
|
|
2217
|
+
* chatbot 里各处「打开设置」出口指向的分区(FR-20.3)。
|
|
2218
|
+
*
|
|
2219
|
+
* 取值就是 console 的路由 leaf id,因此不需要维护第二套映射表;
|
|
2220
|
+
* 但这**不构成对 `@webskill/console` 的依赖**——它只是一组字符串字面量。
|
|
2221
|
+
* 宿主不用 console 时,这些字符串就是它自定义路由的键名,语义自定。
|
|
2222
|
+
*
|
|
2223
|
+
* 只覆盖**配置类** leaf:`skills.editor`、`governance.review` 这些与配置无关的页
|
|
2224
|
+
* 不在其中(AC-20.7 按「无未覆盖的配置类 leaf」执行,见偏差 D-15)。
|
|
2225
|
+
* @experimental
|
|
2226
|
+
*/
|
|
2227
|
+
type SettingsSectionId = 'settings.runtime' | 'settings.sandbox' | 'settings.genui' | 'settings.trust' | 'settings.privacy' | 'settings.appearance' | 'connections.models' | 'connections.page' | 'connections.mcp';
|
|
2228
|
+
//#endregion
|
|
2157
2229
|
//#region src/react/useChatLayout.d.ts
|
|
2158
2230
|
/** 宿主可指定的布局档;auto 按容器尺寸判定 @stable */
|
|
2159
2231
|
type ChatLayout = 'auto' | 'fullscreen' | 'embedded';
|
|
@@ -2181,6 +2253,11 @@ interface ChatbotProps {
|
|
|
2181
2253
|
/** 布局档(默认 'auto':按容器尺寸在 fullscreen / embedded / mobile 之间判定) */
|
|
2182
2254
|
layout?: ChatLayout;
|
|
2183
2255
|
onAppearanceChange?(next: AppearanceChange): void;
|
|
2256
|
+
/**
|
|
2257
|
+
* 打开配置面(FR-20.4)。配置面本身已迁到 console,chatbot 只负责发出这个请求;
|
|
2258
|
+
* 宿主不接就不渲染任何「打开设置」出口——给一个点了没反应的按钮更糟。
|
|
2259
|
+
*/
|
|
2260
|
+
onOpenSettings?(section: SettingsSectionId): void;
|
|
2184
2261
|
/**
|
|
2185
2262
|
* 装配完成后把引擎交给宿主,用于接线跨界面动作(例如 console 的快照恢复入口
|
|
2186
2263
|
* 需要调 `engine.resume(runId)`)。每次重新装配都会再调一次。
|
|
@@ -2192,7 +2269,7 @@ interface ChatbotProps {
|
|
|
2192
2269
|
* presentation shell and accessible thread primitives.
|
|
2193
2270
|
* @stable
|
|
2194
2271
|
*/
|
|
2195
|
-
declare function Chatbot({ adapter, config, locale: localeProp, theme: themeProp, renderer: rendererProp, dictationLang: dictationLangProp, surfaceRegistry, layout, onAppearanceChange, onEngineReady }: ChatbotProps): import("react").JSX.Element;
|
|
2272
|
+
declare function Chatbot({ adapter, config, locale: localeProp, theme: themeProp, renderer: rendererProp, dictationLang: dictationLangProp, surfaceRegistry, layout, onAppearanceChange, onOpenSettings, onEngineReady }: ChatbotProps): import("react").JSX.Element;
|
|
2196
2273
|
//#endregion
|
|
2197
2274
|
//#region src/react/A2uiSurfaceHost.d.ts
|
|
2198
2275
|
/** @experimental */
|
|
@@ -2348,66 +2425,6 @@ interface InterruptedBannerProps {
|
|
|
2348
2425
|
*/
|
|
2349
2426
|
declare function InterruptedBanner({ engine, sessionId }: InterruptedBannerProps): import("react").JSX.Element | null;
|
|
2350
2427
|
//#endregion
|
|
2351
|
-
//#region src/react/SettingsDrawer.d.ts
|
|
2352
|
-
/** @stable */
|
|
2353
|
-
interface SettingsDrawerProps {
|
|
2354
|
-
open: boolean;
|
|
2355
|
-
/**
|
|
2356
|
-
* 运行环境配置存储:模型列表、流式、temperature、Agent 能力全部读写这里。
|
|
2357
|
-
* 缺省时模型区只读展示(宿主没接配置源,谈不上持久化)。
|
|
2358
|
-
*/
|
|
2359
|
-
runtimeConfig?: RuntimeConfigStore;
|
|
2360
|
-
/**
|
|
2361
|
-
* 语音识别语言(BCP-47);空串即跟随界面语言(FR-7.7)。
|
|
2362
|
-
* @experimental
|
|
2363
|
-
*/
|
|
2364
|
-
dictationLang?: string;
|
|
2365
|
-
/** 语音语言切换时回调(写回同一份外观配置) */
|
|
2366
|
-
onAppearanceChange?(next: AppearanceChange): void;
|
|
2367
|
-
/**
|
|
2368
|
-
* 当前选中的模型条目 id(FR-14.4):它不支持工具时,Agent 能力开关置灰。
|
|
2369
|
-
* @experimental
|
|
2370
|
-
*/
|
|
2371
|
-
selectedModelId?: string;
|
|
2372
|
-
/** 保存/清除成功后回调(Chatbot 借此触发 engine.reloadConfig) */
|
|
2373
|
-
onSaved(): void;
|
|
2374
|
-
/**
|
|
2375
|
-
* 用户画像的读写入口(需求 19)。不注入即整段画像 UI 不渲染(R11)——
|
|
2376
|
-
* 没有数据源时展示一个空列表比不展示更容易让人以为「记录丢了」。
|
|
2377
|
-
* @experimental
|
|
2378
|
-
*/
|
|
2379
|
-
userProfileApi?: UserProfileApi;
|
|
2380
|
-
/**
|
|
2381
|
-
* 打开时定位到哪个分区(缺省 `'general'`)。触顶报错的「打开设置」按此直达 Agent 区,
|
|
2382
|
-
* 让用户少找一步(FR-21.2)。传了不存在的 id 则回落到 `'general'`。
|
|
2383
|
-
* @experimental
|
|
2384
|
-
*/
|
|
2385
|
-
initialSectionId?: string;
|
|
2386
|
-
onClose(): void;
|
|
2387
|
-
}
|
|
2388
|
-
/** 设置面板对画像数据的最小依赖面;实现由 Chatbot 用 ChatEngine 装配 @experimental */
|
|
2389
|
-
interface UserProfileApi {
|
|
2390
|
-
read(): Promise<UserProfile>;
|
|
2391
|
-
refine(): Promise<UserProfile>;
|
|
2392
|
-
deleteEntry(id: string): Promise<UserProfile>;
|
|
2393
|
-
clearRecords(): Promise<void>;
|
|
2394
|
-
clearProfile(): Promise<void>;
|
|
2395
|
-
/** 记录与画像一并清除(关闭总开关时的追问) */
|
|
2396
|
-
clearAll(): Promise<void>;
|
|
2397
|
-
/** `excludeIds` 来自导出前的逐条审阅 */
|
|
2398
|
-
export(excludeIds: readonly string[]): Promise<UserProfileExport>;
|
|
2399
|
-
diffImport(incoming: UserProfileExport): Promise<UserProfileImportDiff>;
|
|
2400
|
-
applyImport(incoming: UserProfileExport): Promise<UserProfile>;
|
|
2401
|
-
}
|
|
2402
|
-
/** @experimental */
|
|
2403
|
-
interface UserProfileImportDiff {
|
|
2404
|
-
added: readonly UserProfileEntry[];
|
|
2405
|
-
updated: readonly UserProfileEntry[];
|
|
2406
|
-
origin: string;
|
|
2407
|
-
}
|
|
2408
|
-
/** 设置抽屉:模型列表(增删改 / 设默认 / 逐条探测)+ 流式与 temperature + Agent 能力 + 语音语言 @stable */
|
|
2409
|
-
declare function SettingsDrawer({ open, runtimeConfig, dictationLang, selectedModelId, onAppearanceChange, onSaved, userProfileApi: profileApi, initialSectionId, onClose }: SettingsDrawerProps): import("react").JSX.Element;
|
|
2410
|
-
//#endregion
|
|
2411
2428
|
//#region src/react/ErrorCard.d.ts
|
|
2412
2429
|
/** @stable */
|
|
2413
2430
|
interface ErrorCardProps {
|
|
@@ -2430,4 +2447,4 @@ interface ErrorCardProps {
|
|
|
2430
2447
|
/** 结构化错误卡:错误码徽章 + 描述 + 建议(engine error 事件 / 失败 run) @stable */
|
|
2431
2448
|
declare function ErrorCard({ code, message, loopLimits, onOpenSettings, onDismiss }: ErrorCardProps): import("react").JSX.Element;
|
|
2432
2449
|
//#endregion
|
|
2433
|
-
export { A2uiSurfaceHost, type A2uiSurfaceHostProps, A2uiSurfaceSnapshotHost, type A2uiSurfaceSnapshotHostProps, type AppearanceChange, type ChatAttachmentInput, type ChatAttachmentMeta, ChatEngine, type ChatEngineOptions, type ChatEvent, type ChatInteractionRecord, type ChatLayout, type ChatMessage, type ChatRunPhase, type ChatSessionListResult, type ChatSessionMeta, type ChatTheme, type ChatToolCall, Chatbot, type ChatbotConfig, type ChatbotGovernancePorts, type ChatbotHostAdapter, type ChatbotProps, CompositeUiBridge, type CompositeUiBridgeDeps, DEFAULT_RENDERER_CAPABILITIES, DEFAULT_RUNTIME_CONFIG_STORAGE_KEY, type DownloadableFile, ErrorCard, type ErrorCardProps, InteractionCard, type InteractionCardProps, InterruptedBanner, type InterruptedBannerProps, type Locale, OpenUiSurfaceHost, type OpenUiSurfaceHostProps, OpenUiSurfaceSnapshotHost, type OpenUiSurfaceSnapshotHostProps, type RendererCapability, type RendererKind, type ResolvedChatLayout, ResultBlockList, type ResultBlockListProps, ResultBlocksPro, type ResultBlocksProProps, type RunSnapshot, type RuntimeAppearanceConfig, type RuntimeConfig, type RuntimeConfigStore, type RuntimeRendererId, type SandboxExecutorDeps,
|
|
2450
|
+
export { A2uiSurfaceHost, type A2uiSurfaceHostProps, A2uiSurfaceSnapshotHost, type A2uiSurfaceSnapshotHostProps, type AppearanceChange, type ChatAttachmentInput, type ChatAttachmentMeta, ChatEngine, type ChatEngineOptions, type ChatEvent, type ChatInteractionRecord, type ChatLayout, type ChatMessage, type ChatRunPhase, type ChatSessionListResult, type ChatSessionMeta, type ChatTheme, type ChatToolCall, Chatbot, type ChatbotConfig, type ChatbotGovernancePorts, type ChatbotHostAdapter, type ChatbotProps, CompositeUiBridge, type CompositeUiBridgeDeps, DEFAULT_RENDERER_CAPABILITIES, DEFAULT_RUNTIME_CONFIG_STORAGE_KEY, type DownloadableFile, ErrorCard, type ErrorCardProps, InteractionCard, type InteractionCardProps, InterruptedBanner, type InterruptedBannerProps, type Locale, OpenUiSurfaceHost, type OpenUiSurfaceHostProps, OpenUiSurfaceSnapshotHost, type OpenUiSurfaceSnapshotHostProps, type RendererCapability, type RendererKind, type ResolvedChatLayout, ResultBlockList, type ResultBlockListProps, ResultBlocksPro, type ResultBlocksProProps, type RunSnapshot, type RuntimeAppearanceConfig, type RuntimeConfig, type RuntimeConfigStore, type RuntimeRendererId, type SandboxExecutorDeps, type SettingsSectionId, SkillBadges, SpecInteraction, type SpecInteractionProps, VercelPayloadPreview, type VercelPayloadPreviewProps, VercelSurfaceHost, type VercelSurfaceHostProps, VercelSurfaceSnapshotHost, type VercelSurfaceSnapshotHostProps, chatbotDictionary, configureA2uiMarkdown, createLocalStorageRuntimeConfigStore, createMemoryRuntimeConfigStore, probeA2uiAvailability, probeOpenUiAvailability, sandboxExecutorDeps, useT };
|