@noodleseed/assistant 1.10.0 → 1.11.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 +38 -0
- package/dist/{chunk-RYQBXTLR.js → chunk-KRB2SXFD.js} +6 -1
- package/dist/{chunk-RYQBXTLR.js.map → chunk-KRB2SXFD.js.map} +1 -1
- package/dist/{chunk-RSNMY27B.js → chunk-ZPELSHUP.js} +2 -2
- package/dist/{client-CsmtpD1z.d.cts → client-BKIeuSVS.d.cts} +7 -2
- package/dist/{client-B803xZVn.d.ts → client-BccAX_om.d.ts} +7 -2
- package/dist/client.cjs +5 -0
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +1 -1
- package/dist/index.cjs +5 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/react/client.cjs +5 -0
- package/dist/react/client.cjs.map +1 -1
- package/dist/react/client.d.cts +1 -1
- package/dist/react/client.d.ts +1 -1
- package/dist/react/client.js +1 -1
- package/dist/react.cjs +5 -0
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +2 -2
- package/package.json +1 -1
- /package/dist/{chunk-RSNMY27B.js.map → chunk-ZPELSHUP.js.map} +0 -0
package/README.md
CHANGED
|
@@ -247,6 +247,26 @@ interaction streams a continuation. `principalKey` is browser-local and never se
|
|
|
247
247
|
whenever the authenticated user or tenant changes so the hook aborts and clears the previous session and
|
|
248
248
|
transcript.
|
|
249
249
|
|
|
250
|
+
If the product deliberately sends a first turn on mount, make the effect cleanup-aware. React Strict Mode
|
|
251
|
+
discards the provisional effect, so a persistent "already sent" ref can suppress the stable remount:
|
|
252
|
+
|
|
253
|
+
```tsx
|
|
254
|
+
import { useEffect } from "react";
|
|
255
|
+
|
|
256
|
+
useEffect(() => {
|
|
257
|
+
let active = true;
|
|
258
|
+
queueMicrotask(() => {
|
|
259
|
+
if (active) settle(client.sendMessage(initialMessage));
|
|
260
|
+
});
|
|
261
|
+
return () => {
|
|
262
|
+
active = false;
|
|
263
|
+
};
|
|
264
|
+
}, [client, initialMessage]);
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
`settle` must await or catch the command promise as in the complete example; the same structured failure
|
|
268
|
+
also appears in the hook's `error` state.
|
|
269
|
+
|
|
250
270
|
When the customer-owned transcript should render the linked MCP App itself, pass the typed `data-view`
|
|
251
271
|
payload and the same client to the supported host component:
|
|
252
272
|
|
|
@@ -320,6 +340,24 @@ Use the lower-level `subscribe(...)` event stream only for transport and session
|
|
|
320
340
|
do not belong in the transcript. The package uses the headless `ai` runtime only; React remains an optional
|
|
321
341
|
peer isolated to the `/react` and `/react/client` entries.
|
|
322
342
|
|
|
343
|
+
For a custom progress surface, raw `tool_started` carries the direct invocation's call `id` and technical
|
|
344
|
+
`tool` name before execution. Map known tools through a finite application-owned label table and use a
|
|
345
|
+
neutral fallback such as "Working"; never turn an internal identifier into customer copy mechanically.
|
|
346
|
+
Keep one reserved region with `role="status"` and `aria-live="polite"` from submitted/thinking through tool
|
|
347
|
+
activity and the linked-view skeleton. `view_available` makes that view ready; a raw `error` event or chat
|
|
348
|
+
`error` state replaces the skeleton with `role="alert"`. Keep the skeleton's dimensions stable, mark its
|
|
349
|
+
decorative shapes `aria-hidden="true"`, and disable shimmer/transition animation under
|
|
350
|
+
`@media (prefers-reduced-motion: reduce)`.
|
|
351
|
+
|
|
352
|
+
The transport identity of a view is exactly `view.id + view.resourceUri`; different call IDs are distinct
|
|
353
|
+
invocations and must not be collapsed automatically. If the product intentionally owns one current panel
|
|
354
|
+
for a known resource, define an explicit application-owned slot map and replace only that slot:
|
|
355
|
+
|
|
356
|
+
```ts
|
|
357
|
+
const viewSlots = new Map([["ui://workspace/current", "current-workspace"]]);
|
|
358
|
+
const renderKey = viewSlots.get(view.resourceUri) ?? `${view.id}:${view.resourceUri}`;
|
|
359
|
+
```
|
|
360
|
+
|
|
323
361
|
`clientContext` contains untrusted locale/timezone presentation hints and is evaluated for every turn.
|
|
324
362
|
The client resolves a turn or interaction only after exactly one valid terminal `done` event followed by
|
|
325
363
|
stream EOF. A truncated or malformed stream, duplicate `done`, or any frame after `done` is
|
|
@@ -8360,6 +8360,11 @@ function toAssistantClientEvent(event) {
|
|
|
8360
8360
|
return event;
|
|
8361
8361
|
}
|
|
8362
8362
|
break;
|
|
8363
|
+
case "tool_started":
|
|
8364
|
+
if (hasString(value, "id") && hasString(value, "tool") && hasOptionalTurnId(value)) {
|
|
8365
|
+
return event;
|
|
8366
|
+
}
|
|
8367
|
+
break;
|
|
8363
8368
|
case "tool_proposed":
|
|
8364
8369
|
if (hasString(value, "id") && hasString(value, "tool") && hasOptionalString(value.title) && hasOptionalString(value.description) && hasOptionalJson(value.arguments) && (value.reviewSchema === void 0 || isRecord2(value.reviewSchema)) && hasOptionalString(value.expiresAt) && (value.requiresConfirmation === void 0 || value.requiresConfirmation === true) && hasOptionalTurnId(value)) {
|
|
8365
8370
|
return event;
|
|
@@ -9086,4 +9091,4 @@ export {
|
|
|
9086
9091
|
AssistantClientError,
|
|
9087
9092
|
createAssistantClient
|
|
9088
9093
|
};
|
|
9089
|
-
//# sourceMappingURL=chunk-
|
|
9094
|
+
//# sourceMappingURL=chunk-KRB2SXFD.js.map
|