@dudko.dev/agent-web-react 0.0.33 → 0.0.34

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/mcp.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { McpSkillConsent, AgentToolSet } from '@dudko.dev/agent-web';
2
- import { aX as McpOAuthRegistration, aY as McpProtocolMode, P as PendingElicitation, f as McpElicitationResult, aZ as McpElicitationOptions, a_ as McpCatalogEntry, a$ as McpServerProtocol, b0 as McpOAuthRegistrationKind, b1 as McpOAuthCallback, b2 as McpServerResult, b3 as McpModule, b4 as ConnectedMcp, b5 as BrowserOAuthProviderOptions, b6 as BrowserOAuthProvider } from './elicitation-B6h_-yLg.cjs';
2
+ import { aX as McpOAuthRegistration, aY as McpProtocolMode, P as PendingElicitation, f as McpElicitationResult, aZ as McpElicitationOptions, a_ as McpCatalogEntry, a$ as McpServerProtocol, b0 as McpOAuthRegistrationKind, b1 as McpOAuthCallback, b2 as McpServerResult, b3 as McpModule, b4 as ConnectedMcp, b5 as BrowserOAuthProviderOptions, b6 as BrowserOAuthProvider } from './elicitation-BTrJ5t3c.cjs';
3
3
  import { McpAppsConnectionLike } from './index.cjs';
4
- export { b7 as ElicitationQueue, b8 as ElicitationQueueOptions, ao as McpElicitationFieldSchema, b9 as McpElicitationHandler, ap as McpElicitationRequest, aq as McpElicitationSchema, ba as McpServerInstructions, bb as createElicitationQueue, bc as elicitationConnectOptions, bd as elicitationSettings, be as elicitationTimeoutOf } from './elicitation-B6h_-yLg.cjs';
4
+ export { b7 as ElicitationQueue, b8 as ElicitationQueueOptions, ao as McpElicitationFieldSchema, b9 as McpElicitationHandler, ap as McpElicitationRequest, aq as McpElicitationSchema, ba as McpServerInstructions, bb as createElicitationQueue, bc as elicitationConnectOptions, bd as elicitationSettings, be as elicitationTimeoutOf } from './elicitation-BTrJ5t3c.cjs';
5
5
 
6
6
  type McpStatus = 'idle' | 'connecting' | 'connected' | 'needs-authorization' | 'error';
7
7
  /** The OAuth details of one server. Everything is optional. */
package/dist/mcp.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { McpSkillConsent, AgentToolSet } from '@dudko.dev/agent-web';
2
- import { aX as McpOAuthRegistration, aY as McpProtocolMode, P as PendingElicitation, f as McpElicitationResult, aZ as McpElicitationOptions, a_ as McpCatalogEntry, a$ as McpServerProtocol, b0 as McpOAuthRegistrationKind, b1 as McpOAuthCallback, b2 as McpServerResult, b3 as McpModule, b4 as ConnectedMcp, b5 as BrowserOAuthProviderOptions, b6 as BrowserOAuthProvider } from './elicitation-B6h_-yLg.js';
2
+ import { aX as McpOAuthRegistration, aY as McpProtocolMode, P as PendingElicitation, f as McpElicitationResult, aZ as McpElicitationOptions, a_ as McpCatalogEntry, a$ as McpServerProtocol, b0 as McpOAuthRegistrationKind, b1 as McpOAuthCallback, b2 as McpServerResult, b3 as McpModule, b4 as ConnectedMcp, b5 as BrowserOAuthProviderOptions, b6 as BrowserOAuthProvider } from './elicitation-BTrJ5t3c.js';
3
3
  import { McpAppsConnectionLike } from './index.js';
4
- export { b7 as ElicitationQueue, b8 as ElicitationQueueOptions, ao as McpElicitationFieldSchema, b9 as McpElicitationHandler, ap as McpElicitationRequest, aq as McpElicitationSchema, ba as McpServerInstructions, bb as createElicitationQueue, bc as elicitationConnectOptions, bd as elicitationSettings, be as elicitationTimeoutOf } from './elicitation-B6h_-yLg.js';
4
+ export { b7 as ElicitationQueue, b8 as ElicitationQueueOptions, ao as McpElicitationFieldSchema, b9 as McpElicitationHandler, ap as McpElicitationRequest, aq as McpElicitationSchema, ba as McpServerInstructions, bb as createElicitationQueue, bc as elicitationConnectOptions, bd as elicitationSettings, be as elicitationTimeoutOf } from './elicitation-BTrJ5t3c.js';
5
5
 
6
6
  type McpStatus = 'idle' | 'connecting' | 'connected' | 'needs-authorization' | 'error';
7
7
  /** The OAuth details of one server. Everything is optional. */
package/dist/styles.css CHANGED
@@ -25,6 +25,7 @@
25
25
  --awr-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
26
26
  --awr-sidebar-width: 240px;
27
27
  --awr-files-width: 300px;
28
+ --awr-scrim: rgb(15 17 21 / 0.32);
28
29
  color: var(--awr-fg);
29
30
  font-family: var(--awr-font);
30
31
  }
@@ -41,6 +42,7 @@
41
42
  --awr-danger: #f87171;
42
43
  --awr-warn: #fbbf24;
43
44
  --awr-ok: #4ade80;
45
+ --awr-scrim: rgb(0 0 0 / 0.5);
44
46
  }
45
47
  }
46
48
  :where(.awr-chat, .awr-theme)[data-awr-theme='dark'] {
@@ -54,6 +56,7 @@
54
56
  --awr-danger: #f87171;
55
57
  --awr-warn: #fbbf24;
56
58
  --awr-ok: #4ade80;
59
+ --awr-scrim: rgb(0 0 0 / 0.5);
57
60
  }
58
61
 
59
62
  /* ── Chat panel layout: [history] [main] [files] ──────────────────────────── */
@@ -112,6 +115,14 @@
112
115
  width: min(85%, 320px);
113
116
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
114
117
  }
118
+ /* Beside an open side panel: the chat under a shade, and a tap on it closes the panel. */
119
+ .awr-chat__scrim {
120
+ position: absolute;
121
+ inset: 0;
122
+ z-index: 4;
123
+ background: var(--awr-scrim);
124
+ -webkit-tap-highlight-color: transparent;
125
+ }
115
126
  .awr-chat--narrow > .awr-chat__sidebar {
116
127
  left: 0;
117
128
  }
@@ -129,6 +140,13 @@
129
140
  .awr-chat--narrow .awr-chat__files .awr-panel__head {
130
141
  padding-right: 40px;
131
142
  }
143
+ /* The header and the footer keep their height: only the transcript between them gives way.
144
+ (As flex items they would shrink a little with every line the transcript grows - the header
145
+ down to its min-height - and move everything under them.) */
146
+ .awr-chat__header,
147
+ .awr-chat__footer {
148
+ flex: none;
149
+ }
132
150
  .awr-chat__header {
133
151
  display: flex;
134
152
  align-items: center;
@@ -161,6 +179,9 @@
161
179
  flex: 1 1 auto;
162
180
  min-height: 0;
163
181
  overflow-y: auto;
182
+ /* A fling that reaches the end of the transcript stops there: it is not handed on to the
183
+ page, which on a phone would scroll or bounce the whole window. */
184
+ overscroll-behavior: contain;
164
185
  padding: 16px;
165
186
  display: flex;
166
187
  flex-direction: column;
@@ -269,6 +290,7 @@
269
290
  gap: 8px;
270
291
  }
271
292
  .awr-step__marker {
293
+ flex: none;
272
294
  display: inline-flex;
273
295
  color: var(--awr-muted);
274
296
  }
@@ -279,11 +301,16 @@
279
301
  color: var(--awr-danger);
280
302
  }
281
303
  .awr-step__index {
304
+ /* "1/2" is one word: it keeps its width and its line; the description is what wraps. */
305
+ flex: none;
306
+ white-space: nowrap;
282
307
  font-variant-numeric: tabular-nums;
283
308
  color: var(--awr-muted);
284
309
  font-size: 12px;
285
310
  }
286
311
  .awr-step__desc {
312
+ min-width: 0;
313
+ overflow-wrap: anywhere;
287
314
  font-weight: 500;
288
315
  }
289
316
  .awr-step__text {
@@ -1355,6 +1382,10 @@
1355
1382
  display: block;
1356
1383
  max-width: 100%;
1357
1384
  }
1385
+ /* The preview of a picture opens the image viewer (a button). */
1386
+ .awr-filepreview .awr-imgbtn {
1387
+ display: flex;
1388
+ }
1358
1389
  .awr-filepreview pre {
1359
1390
  margin: 0;
1360
1391
  padding: 8px;
@@ -2954,3 +2985,131 @@
2954
2985
  font-family: var(--awr-font);
2955
2986
  overflow: hidden;
2956
2987
  }
2988
+
2989
+ /* ── Image viewer: a picture over the chat ────────────────────────────────── */
2990
+ /* A thumbnail is a button with nothing of a button's look. */
2991
+ .awr-imgbtn {
2992
+ display: inline-flex;
2993
+ max-width: 100%;
2994
+ min-width: 0;
2995
+ padding: 0;
2996
+ border: 0;
2997
+ border-radius: 8px;
2998
+ background: none;
2999
+ color: inherit;
3000
+ font: inherit;
3001
+ cursor: zoom-in;
3002
+ }
3003
+ .awr-imgbtn:focus-visible {
3004
+ outline: 2px solid var(--awr-accent);
3005
+ outline-offset: 2px;
3006
+ }
3007
+ .awr-viewer {
3008
+ position: fixed;
3009
+ inset: 0;
3010
+ z-index: 60;
3011
+ display: flex;
3012
+ flex-direction: column;
3013
+ background: color-mix(in srgb, var(--awr-bg) 92%, transparent);
3014
+ color: var(--awr-fg);
3015
+ font-family: var(--awr-font);
3016
+ font-size: 14px;
3017
+ animation: awr-viewer-in 0.12s ease-out;
3018
+ }
3019
+ @keyframes awr-viewer-in {
3020
+ from {
3021
+ opacity: 0;
3022
+ }
3023
+ }
3024
+ @media (prefers-reduced-motion: reduce) {
3025
+ .awr-viewer {
3026
+ animation: none;
3027
+ }
3028
+ }
3029
+ .awr-viewer__bar {
3030
+ flex: none;
3031
+ display: flex;
3032
+ align-items: center;
3033
+ gap: 4px;
3034
+ padding: 8px max(8px, env(safe-area-inset-right, 0px)) 8px
3035
+ max(12px, env(safe-area-inset-left, 0px));
3036
+ padding-top: max(8px, env(safe-area-inset-top, 0px));
3037
+ background: var(--awr-bg);
3038
+ border-bottom: 1px solid var(--awr-border);
3039
+ }
3040
+ .awr-viewer__name {
3041
+ flex: 1 1 auto;
3042
+ min-width: 0;
3043
+ overflow: hidden;
3044
+ text-overflow: ellipsis;
3045
+ white-space: nowrap;
3046
+ font-weight: 600;
3047
+ }
3048
+ .awr-viewer__count {
3049
+ flex: none;
3050
+ padding: 0 6px;
3051
+ color: var(--awr-muted);
3052
+ font-variant-numeric: tabular-nums;
3053
+ }
3054
+ /* Controls a finger can hit. */
3055
+ .awr-viewer .awr-iconbtn {
3056
+ width: 40px;
3057
+ height: 40px;
3058
+ text-decoration: none;
3059
+ }
3060
+ .awr-viewer .awr-iconbtn:focus-visible {
3061
+ outline: 2px solid var(--awr-accent);
3062
+ outline-offset: -2px;
3063
+ }
3064
+ /* The picture fitted to what is left of the window; at full size it is panned by scrolling. */
3065
+ .awr-viewer__stage {
3066
+ flex: 1 1 auto;
3067
+ min-height: 0;
3068
+ display: flex;
3069
+ overflow: auto;
3070
+ padding: 12px;
3071
+ padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
3072
+ overscroll-behavior: contain;
3073
+ /* A sideways swipe is the viewer's (the next picture), not the browser's (back). */
3074
+ touch-action: pan-y pinch-zoom;
3075
+ }
3076
+ .awr-viewer__stage.is-zoomed {
3077
+ touch-action: pan-x pan-y pinch-zoom;
3078
+ }
3079
+ .awr-viewer__img {
3080
+ display: block;
3081
+ flex: none;
3082
+ margin: auto;
3083
+ max-width: 100%;
3084
+ max-height: 100%;
3085
+ object-fit: contain;
3086
+ border-radius: 6px;
3087
+ background: var(--awr-subtle);
3088
+ cursor: zoom-in;
3089
+ user-select: none;
3090
+ }
3091
+ .awr-viewer__stage.is-zoomed .awr-viewer__img {
3092
+ max-width: none;
3093
+ max-height: none;
3094
+ height: auto;
3095
+ cursor: zoom-out;
3096
+ }
3097
+ .awr-viewer .awr-viewer__nav {
3098
+ position: absolute;
3099
+ top: 50%;
3100
+ width: 44px;
3101
+ height: 44px;
3102
+ margin-top: -22px;
3103
+ border: 1px solid var(--awr-border);
3104
+ border-radius: 50%;
3105
+ background: var(--awr-bg);
3106
+ color: var(--awr-fg);
3107
+ font-size: 24px;
3108
+ line-height: 1;
3109
+ }
3110
+ .awr-viewer__nav--prev {
3111
+ left: max(8px, env(safe-area-inset-left, 0px));
3112
+ }
3113
+ .awr-viewer__nav--next {
3114
+ right: max(8px, env(safe-area-inset-right, 0px));
3115
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dudko.dev/agent-web-react",
3
- "version": "0.0.33",
3
+ "version": "0.0.34",
4
4
  "description": "React bindings for @dudko.dev/agent-web: a headless useAgent hook, an AgentProvider context, and optional pre-styled components (chat panel, plan/step view, BYOK key form, WebLLM load bar) that connect the in-browser LLM agent to any React site. UI you can drop in — or a headless reducer you can build your own around.",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -145,7 +145,7 @@
145
145
  "tsup": "^9.0.0",
146
146
  "typescript": "^6.0.3",
147
147
  "zod": "^4.6.7",
148
- "@dudko.dev/agent-web": "0.0.45",
148
+ "@dudko.dev/agent-web": "0.0.46",
149
149
  "@dudko.dev/test-servers": "0.0.0"
150
150
  },
151
151
  "scripts": {