@chatsystem/client 1.3.3 → 2.0.1

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 CHANGED
@@ -103,6 +103,13 @@ the client itself; it must never be reimplemented in a host-specific adapter.
103
103
 
104
104
  ## Browser regression tests
105
105
 
106
+ Local-preview feedback is translated through `react-intl`: completing or closing
107
+ the form explicitly says that this was a demo and no answers were transmitted.
108
+ The generic renderer does not promise storage, support handling or Slack delivery.
109
+ The server-owned Tool presentation explains its own production journey (for
110
+ example, the support-request inbox and optional Slack channel). This copy remains
111
+ visible after completion without adding a Tool-name switch or browser protocol.
112
+
106
113
  The package has a Playwright suite under `e2e/identity-gate`. It builds this
107
114
  library, mounts it inside a fictional customer website, and drives a real
108
115
  headless Chromium through identity delegation, redirect/resume, shared-runtime
@@ -158,3 +165,49 @@ programmatic browser API so the provider functions remain JavaScript values:
158
165
 
159
166
  This passes the provider to the same internal `App` and identity session used
160
167
  by the npm package. Do not place callbacks or secrets in `data-*` attributes.
168
+
169
+ ## Custom CSS and layout
170
+
171
+ Put custom rules in the Agent's `CSSRules`, which are inserted after the default
172
+ widget styles inside its Shadow DOM. Host-page styles cannot select elements
173
+ inside that boundary. A custom `cssHref` can also provide the widget stylesheet.
174
+
175
+ | Selector | Layout contract |
176
+ | --- | --- |
177
+ | `.chatBox` | Chat surface; in launcher mode, the actual floating window |
178
+ | `.chatsystem-widget-window` | Launcher window only; owns viewport positioning |
179
+ | `.chatsystem-widget-surface` | Clips window contents and inherits its background and corners |
180
+ | `.launcher` | Floating launcher button |
181
+ | `.chatsystem-interactive-widget` | Form panel inside the scrolling conversation |
182
+
183
+ For example, these Agent rules move the launcher and its window to the left:
184
+
185
+ ```css
186
+ .chatsystem-widget-window, .launcher { left: 18px; right: auto; }
187
+ .chatsystem-interactive-widget { border-radius: 6px; }
188
+ ```
189
+
190
+ Legacy `.chatBox` positioning rules remain supported. Inline chat stays in normal
191
+ document flow. Interactive forms stay in the message flow and scroll with it;
192
+ they do not create a floating overlay. Defaults remain overridable in both the
193
+ constructable stylesheet and style-tag fallback paths.
194
+
195
+ ## Completed AI answers per discussion
196
+
197
+ The API controls the discussion allowance through
198
+ `CompanySettingsDTO.api.settings.maxAiResponsesPerDiscussion`. Only completed,
199
+ persisted final AI answers consume it; user messages, Tool exchanges,
200
+ intermediate text and human support do not. This is not a context/token limit.
201
+ The widget disables AI input at the limit and offers a new conversation.
202
+
203
+ Shared chatbox/launcher views use the same absolute completion count. Validated
204
+ `ai.response.completed` receipts are discussion-scoped, replay-safe and retained
205
+ in local conversation history. Server admission remains authoritative if that
206
+ history or a receipt is missing. A busy discussion is not quota exhaustion.
207
+
208
+ This migration requires shared 2.0.0 and a compatible API; upgrade pinned widgets
209
+ explicitly. No React prop, script data attribute or `mount()` option changes.
210
+ Publish the npm component and standalone S3 bundle independently. Custom runtime
211
+ adapters must return the new required settings field, expose `discussionId` and
212
+ forward completion events through their existing NDJSON stream; `message_end`
213
+ alone does not prove durable completion.