@object-ui/plugin-chatbot 17.6.0 → 18.0.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +2814 -0
  2. package/README.md +84 -28
  3. package/dist/AiPendingActionsInbox.d.ts +8 -2
  4. package/dist/AiPendingActionsInbox.d.ts.map +1 -1
  5. package/dist/ChatbotEnhanced.d.ts +235 -101
  6. package/dist/ChatbotEnhanced.d.ts.map +1 -1
  7. package/dist/FloatingChatbot.d.ts +1 -1
  8. package/dist/FloatingChatbot.d.ts.map +1 -1
  9. package/dist/chatMessageAdapter.d.ts +18 -6
  10. package/dist/chatMessageAdapter.d.ts.map +1 -1
  11. package/dist/elements/conversation.d.ts +1 -1
  12. package/dist/elements/conversation.d.ts.map +1 -1
  13. package/dist/elements/index.d.ts +10 -10
  14. package/dist/elements/message.d.ts +1 -1
  15. package/dist/elements/message.d.ts.map +1 -1
  16. package/dist/elements/prompt-input.d.ts +10 -2
  17. package/dist/elements/prompt-input.d.ts.map +1 -1
  18. package/dist/elements/tool.d.ts +13 -1
  19. package/dist/elements/tool.d.ts.map +1 -1
  20. package/dist/index.d.ts +48 -59
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +3217 -1945
  23. package/dist/index.umd.cjs +3 -3
  24. package/dist/mapMessages.d.ts +309 -6
  25. package/dist/mapMessages.d.ts.map +1 -1
  26. package/dist/recordLink.d.ts +34 -0
  27. package/dist/recordLink.d.ts.map +1 -0
  28. package/dist/tool-display.d.ts +97 -26
  29. package/dist/tool-display.d.ts.map +1 -1
  30. package/dist/useAgents.d.ts +5 -0
  31. package/dist/useAgents.d.ts.map +1 -1
  32. package/dist/useAiApprovalsTranslation.d.ts +76 -0
  33. package/dist/useAiApprovalsTranslation.d.ts.map +1 -0
  34. package/dist/useAiModels.d.ts +3 -1
  35. package/dist/useAiModels.d.ts.map +1 -1
  36. package/dist/useHitlInChat.d.ts +2 -2
  37. package/dist/useHitlInChat.d.ts.map +1 -1
  38. package/dist/useObjectChat.d.ts +94 -27
  39. package/dist/useObjectChat.d.ts.map +1 -1
  40. package/dist/usePendingActions.d.ts +5 -0
  41. package/dist/usePendingActions.d.ts.map +1 -1
  42. package/package.json +11 -15
@@ -138,9 +138,14 @@ export declare function resolveDefaultAgentName(agents: AgentDescriptor[], prefe
138
138
  * to land in lockstep with a console release.
139
139
  */
140
140
  export declare function extractAgentList(payload: unknown): RawAgent[];
141
+ /** Test seam: forget the painted frame and the cached catalog. Not public. */
142
+ export declare function __resetAgentsCatalog(): void;
141
143
  /**
142
144
  * Fetches the active agent catalog from the backend.
143
145
  *
146
+ * The request leaves after the first frame has painted (objectui#12980), not
147
+ * in the mounting commit — see {@link afterCatalogFrame}.
148
+ *
144
149
  * @example
145
150
  * const { agents } = useAgents({ apiBase: '/api/v1/ai' });
146
151
  */
@@ -1 +1 @@
1
- {"version":3,"file":"useAgents.d.ts","sourceRoot":"","sources":["../src/useAgents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,kDAAkD;IAClD,SAAS,EAAE,OAAO,CAAC;IACnB,kDAAkD;IAClD,MAAM,EAAE,OAAO,CAAC;IAChB,6CAA6C;IAC7C,KAAK,EAAE,OAAO,CAAC;IACf,4CAA4C;IAC5C,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,kEAAkE;IAClE,YAAY,CAAC,EAAE,iBAAiB,CAAC;CAClC;AAED,MAAM,WAAW,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,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,iBAAiB,EAAE,OAAO,CAAC,CAAC,CAAC;IACjE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAaD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS,eAAe,EAAE,EAClC,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,GAAG,EAAE,MAAM,iBAAiB,GAC3B,OAAO,CAKT;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,QAAQ,CAAC;AAE5C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,eAAe,EAAE,EACzB,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,GAAG,SAAS,CAUpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,QAAQ,EAAE,CAU7D;AA+GD,8EAA8E;AAC9E,wBAAgB,oBAAoB,IAAI,IAAI,CAI3C;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,gBAAqB,GAAG,eAAe,CAgDzE"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ /**
9
+ * Locale wiring for `AiPendingActionsInbox` — objectui#7173.
10
+ *
11
+ * A module of its own, the shape `plugin-detail`'s `useDetailTranslation.ts`
12
+ * already uses: the defaults map has to be importable by the test that compares
13
+ * it against the `en` pack, and exporting a non-component from the component
14
+ * file trips `react-refresh/only-export-components`.
15
+ *
16
+ * @module
17
+ */
18
+ /**
19
+ * English fallbacks for every key the inbox reads.
20
+ *
21
+ * `createSafeTranslation` serves these when no `I18nProvider` is mounted — a
22
+ * standalone Studio panel, a host that embeds the inbox without the provider,
23
+ * this package's own tests — so a provider-less render shows English rather
24
+ * than raw keys. Every row here is byte-identical to its `en` pack value: the
25
+ * pack is what the console renders and this map is its stand-in, so the two
26
+ * must not disagree.
27
+ *
28
+ * The four relative-time rows are BORROWED from `detail.*` rather than minted
29
+ * under this namespace. They already existed, translated, in all ten packs, and
30
+ * cross-package borrowing is this repo's settled convention — `ObjectGrid`,
31
+ * `ObjectKanban`, `ObjectTree`, `ListView`, `ObjectView`, `NavigationOverlay`
32
+ * and `RecordAttachmentsPanel` all resolve `detail.*` from outside
33
+ * `plugin-detail`. One phrase on one kind of control should not get a second
34
+ * translation that can drift from the first.
35
+ *
36
+ * ⛔ The five relative-time helpers in this repo are NOT unified (objectui#7173's
37
+ * triage ruling): they differ in real behaviour — `Math.round` in this inbox vs
38
+ * `Math.floor` in `plugin-detail`, 45s/30d vs 60s/7d, different tails — and
39
+ * normalising them is a behaviour change that needs its own card. Only the
40
+ * OUTPUT is translated; `AiPendingActionsInbox.formatRelative` keeps its own
41
+ * arithmetic, pinned by `__tests__/AiPendingActionsInbox.i18n.test.tsx`.
42
+ *
43
+ * Exported from this MODULE, not from the package barrel (`src/index.tsx`
44
+ * names its exports one by one), so it stays off the published API surface
45
+ * while `__tests__/AiPendingActionsInbox.i18n.test.tsx` can compare it row by
46
+ * row against the `en` pack — the invariant
47
+ * `app-shell/src/__tests__/defaults-maps-mirror-en-pack.test.tsx` holds the
48
+ * detail / list / designer maps to. A row that disagrees with the pack renders
49
+ * two different labels for one control and nothing else would see it.
50
+ */
51
+ export declare const AI_APPROVALS_DEFAULT_TRANSLATIONS: Record<string, string>;
52
+ /**
53
+ * Safe wrapper for `useObjectTranslation` that falls back to the map above when
54
+ * no `I18nProvider` is mounted. Delegates to `@object-ui/i18n`'s
55
+ * `createSafeTranslation` — the factory form, not the per-call
56
+ * `useSafeTranslate(key, fallback)`: the inbox interpolates `{{count}}`,
57
+ * `{{id}}`, `{{message}}`, `{{tool}}` and `{{object}}`, and `useSafeTranslate`
58
+ * has no options argument, so those holes would reach the DOM raw. No inline
59
+ * `defaultValue` anywhere either (objectui#3517).
60
+ */
61
+ export declare const useAiApprovalsTranslation: () => {
62
+ t: (key: string, options?: Record<string, unknown>) => string;
63
+ language: string;
64
+ } | {
65
+ t: import('i18next').TFunction<string, undefined>;
66
+ language: string;
67
+ };
68
+ /**
69
+ * The `t` the inbox's module-level helpers take.
70
+ *
71
+ * `formatRelative` and `statusLabel` are plain functions, not hooks, so the
72
+ * component reads the hook once and passes `t` down — the same shape
73
+ * `ActivityTimeline` uses for its own formatter.
74
+ */
75
+ export type InboxTranslate = (key: string, options?: Record<string, unknown>) => string;
76
+ //# sourceMappingURL=useAiApprovalsTranslation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAiApprovalsTranslation.d.ts","sourceRoot":"","sources":["../src/useAiApprovalsTranslation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;;;;;;GASG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,iCAAiC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAqDpE,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB;4BAjHrC,CAAC;;;;;CAoHD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC"}
@@ -1,4 +1,4 @@
1
- import { ChatbotModelOption } from './ChatbotEnhanced';
1
+ import { ChatbotModelOption } from './ChatbotEnhanced.js';
2
2
  export interface UseAiModelsOptions {
3
3
  /** Base URL of the AI service, e.g. "http://localhost:3000/api/v1/ai". */
4
4
  apiBase?: string;
@@ -16,6 +16,8 @@ export interface UseAiModelsReturn {
16
16
  error: Error | undefined;
17
17
  refetch: () => void;
18
18
  }
19
+ /** Test-only: forget the session's 501 answers. Not exported from the package. */
20
+ export declare function resetAiModelsSession(): void;
19
21
  /**
20
22
  * Fetch the AI-model allowlist for the current environment.
21
23
  *
@@ -1 +1 @@
1
- {"version":3,"file":"useAiModels.d.ts","sourceRoot":"","sources":["../src/useAiModels.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,MAAM,WAAW,kBAAkB;IACjC,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,mEAAmE;IACnE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,4EAA4E;IAC5E,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,+DAA+D;IAC/D,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAeD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,iBAAiB,CA8E/E"}
1
+ {"version":3,"file":"useAiModels.d.ts","sourceRoot":"","sources":["../src/useAiModels.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,MAAM,WAAW,kBAAkB;IACjC,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,mEAAmE;IACnE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,4EAA4E;IAC5E,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,+DAA+D;IAC/D,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAmBD,kFAAkF;AAClF,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AAQD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,iBAAiB,CAyF/E"}
@@ -1,5 +1,5 @@
1
- import { ChatMessage, ToolDecisionState } from './ChatbotEnhanced';
2
- import { ApproveOutcome, RejectOutcome } from './usePendingActions';
1
+ import { ChatbotEnhancedMessage as ChatMessage, ToolDecisionState } from './ChatbotEnhanced.js';
2
+ import { ApproveOutcome, RejectOutcome } from './usePendingActions.js';
3
3
  export type { ToolDecisionState };
4
4
  export interface UseHitlInChatOptions {
5
5
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"useHitlInChat.d.ts","sourceRoot":"","sources":["../src/useHitlInChat.ts"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzE,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAElC,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACj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CAAC;AAElC,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC;;;;;;;;;;;;;;;;;OAiBG;IACH,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,aAAa,KAAK,IAAI,CAAC;IAClF;;;;;;;;;;OAUG;IACH,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;CAC3E;AAED,4EAA4E;AAC5E,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,UAAU,GAAG,UAAU,CAAC;IAClC;;;;;OAKG;IACH,OAAO,EAAE,cAAc,GAAG,aAAa,CAAC;IACxC,gFAAgF;IAChF,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC7C;;;;OAIG;IACH,MAAM,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClF;;;OAGG;IACH,UAAU,EAAE,OAAO,CAAC;CACrB;AA0BD,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,mBAAmB,CAyJhF"}
@@ -1,5 +1,5 @@
1
- import { ChatMessage as OuiChatMessage } from '@object-ui/types';
2
- import { SeamChatMessage } from './chatMessageAdapter';
1
+ import { useChat } from '@ai-sdk/react';
2
+ import { SeamChatMessage } from './chatMessageAdapter.js';
3
3
  /**
4
4
  * What `useObjectChat` actually emits — from `messages` and from the
5
5
  * `onSend(content, messages)` callback fed from it (objectui#4424).
@@ -20,6 +20,11 @@ import { SeamChatMessage } from './chatMessageAdapter';
20
20
  * surface unchanged and are folded only at the render seam, which is the
21
21
  * decision `chatMessageAdapter.ts` records. So the runtime type would have
22
22
  * been a lie about local mode.
23
+ * - **wide where API mode is wide.** The AI SDK's three approval states
24
+ * (`approval-requested`, `approval-responded`, `output-denied`) are
25
+ * runtime-only — the authoring contract refuses them (objectui#10018) —
26
+ * but API mode produces them, so its tool invocations carry them. So the
27
+ * authoring type would have been a lie about API mode.
23
28
  * - **narrow where BOTH modes are narrow.** `timestamp` is `string`, never
24
29
  * `Date`: API mode never produces one and local mode absorbs it in
25
30
  * `normalizeMessages` before it is ever handed out. Declaring `Date` here
@@ -29,10 +34,15 @@ import { SeamChatMessage } from './chatMessageAdapter';
29
34
  * draft-review / proposed-plan / builder-handoff extensions on each tool
30
35
  * invocation.
31
36
  *
32
- * It is a SUBTYPE of `@object-ui/types`' `ChatMessage`, which is what makes the
33
- * change invisible to correct consumers: anything that accepted the authoring
34
- * type still accepts these values, including a host `onSend` callback that
35
- * declares its parameter as `ChatMessage[]`.
37
+ * ⚠️ It is NOT a subtype of `@object-ui/types`' `ChatMessage` (objectui#10018).
38
+ * It was one until the authoring `state` union shed the three runtime-only
39
+ * approval states; the values did not change, the authoring contract did. So a
40
+ * host `onSend` callback that declares its parameter as the authoring
41
+ * `ChatMessage[]` no longer type-checks — it was being handed states that
42
+ * contract refuses. Declare it as `ObjectChatMessage[]`. `ChatbotSchema.onSend`
43
+ * (the schema's runtime slot, forwarded here by the three renderers) is typed
44
+ * with the authoring shape widened by exactly those three states, and this type
45
+ * is assignable to it.
36
46
  */
37
47
  export type ObjectChatMessage = Omit<SeamChatMessage, 'timestamp'> & {
38
48
  /**
@@ -109,10 +119,35 @@ export declare function withTurnId(req: {
109
119
  * first turn to seed the ask thread as context. Exported for unit testing.
110
120
  */
111
121
  export declare function withHandoffContext(body: Record<string, unknown>, parentConversationId: string): Record<string, unknown>;
112
- /** Test seam: forget that the inert-`maxToolRoundtrips` notice has been given. */
113
- export declare function resetMaxToolRoundtripsWarning(): void;
114
- type InitialMessage = OuiChatMessage & {
115
- parts?: Array<Record<string, unknown>>;
122
+ /**
123
+ * One initial message — the seam's INPUT shape ({@link SeamChatMessage}), not
124
+ * the authoring one (objectui#10018).
125
+ *
126
+ * The two callers hand in different things: the schema renderer passes
127
+ * `schema.messages` (authored), and app-shell passes the output of
128
+ * `hydratedMessagesToChatMessages` — RUNTIME values restored from server
129
+ * history, which carry the AI SDK's approval states and the render-only keys.
130
+ * The authoring `ChatMessage` refuses those approval states, so it cannot type
131
+ * the second caller; the seam's input admits both, and the authoring shape is
132
+ * assignable to it, so no authored caller is affected.
133
+ */
134
+ type InitialMessage = SeamChatMessage & {
135
+ /**
136
+ * Pre-built chat-runtime parts, handed through to the store untouched when
137
+ * present. Declared as {@link SdkChatMessage}'s own part array — DERIVED, so
138
+ * a runtime bump moves it — rather than as the `Array<Record<string,
139
+ * unknown>>` it used to be (objectui#8426).
140
+ *
141
+ * ⚠️ **BREAKING for a host that passes `parts`.** `Record<string, unknown>`
142
+ * admitted every object, including the ones the store cannot hold, and the
143
+ * mismatch was absorbed by a cast at the `useChat` call instead of being
144
+ * reported here. Nothing in this repository sets this member (the schema
145
+ * renderer passes `schema.messages`, and app-shell passes the output of
146
+ * `hydratedMessagesToChatMessages`, whose literal declares no `parts`), so
147
+ * the narrowing is visible only to external hosts — which is exactly the
148
+ * population it protects.
149
+ */
150
+ parts?: SdkChatMessage['parts'];
116
151
  reasoning?: string;
117
152
  };
118
153
  /**
@@ -162,18 +197,6 @@ export interface UseObjectChatOptions {
162
197
  * Additional body parameters for each API request.
163
198
  */
164
199
  body?: Record<string, unknown>;
165
- /**
166
- * Maximum tool-calling round-trips per message.
167
- *
168
- * @deprecated objectui#5605 — INERT. Nothing reads this value: the installed
169
- * chat runtime exposes no client-side round-trip cap, and ObjectUI does not
170
- * own the server loop. Setting it has never had an effect, and it does not
171
- * acquire one by being set. Cap tool-calling loops on the agent instead
172
- * (`planning.maxIterations`). Still accepted so existing documents keep
173
- * parsing; authoring it now logs a one-time notice, and it is slated for
174
- * removal in a future major. See {@link warnMaxToolRoundtripsInert}.
175
- */
176
- maxToolRoundtrips?: number;
177
200
  /**
178
201
  * Error callback.
179
202
  */
@@ -199,10 +222,12 @@ export interface UseObjectChatOptions {
199
222
  * External send callback (fires for both modes).
200
223
  *
201
224
  * `messages` is the thread as it will be after this send, in the same shape
202
- * the hook's own `messages` uses — see {@link ObjectChatMessage}. A callback
203
- * that declares the parameter as `@object-ui/types`' `ChatMessage[]` still
204
- * type-checks (the emitted shape is a subtype); declaring it as
205
- * `ObjectChatMessage[]` is what lets you READ the render-only keys.
225
+ * the hook's own `messages` uses — see {@link ObjectChatMessage}. Declare the
226
+ * parameter as `ObjectChatMessage[]`: that is also what lets you READ the
227
+ * render-only keys. ⚠️ A callback that declares it as `@object-ui/types`'
228
+ * authoring `ChatMessage[]` no longer type-checks (objectui#10018) — the
229
+ * emitted shape can carry the three runtime-only approval states that the
230
+ * authoring contract refuses, so it is not a subtype of it.
206
231
  */
207
232
  onSend?: (content: string, messages: ObjectChatMessage[]) => void;
208
233
  }
@@ -227,7 +252,41 @@ export interface UseObjectChatReturn {
227
252
  reload: () => void;
228
253
  /** Clear all messages */
229
254
  clear: () => void;
230
- /** ADR-0013 D2: re-hydrate the thread (API mode only); undefined in local mode. */
255
+ /**
256
+ * ADR-0013 D2: re-hydrate the thread (API mode only); undefined in local mode.
257
+ *
258
+ * Deliberately loose, and — since objectui#8342 — honest about it. The
259
+ * parameter stays `unknown[]` because this package will not republish
260
+ * `@ai-sdk/react`'s pinned `UIMessage` on its own surface; that is the same
261
+ * call objectui#8214 made one file over for `AnyPart.state`. Parameters are
262
+ * CONTRAVARIANT, so this declaration used to be a lie: the value handed out
263
+ * was the SDK's own `setMessages`, which accepts only its `UIMessage[]`, and
264
+ * the only thing stopping `tsc` from saying so was a `chatResult as any`
265
+ * inside the hook.
266
+ *
267
+ * What the implementation now guarantees, which is what makes the
268
+ * declaration a promise it keeps: the hook wraps the SDK function and CHECKS
269
+ * every element before handing the array on. A value that is not a chat
270
+ * message — not an object, or missing a string `id`, a
271
+ * `'user' | 'assistant' | 'system'` role, or a `parts` array — is REFUSED
272
+ * LOUDLY: the call throws a `TypeError` naming the offending index, and the
273
+ * SDK's store is left untouched, because the whole array is checked before
274
+ * anything is written.
275
+ *
276
+ * Refusing rather than FILTERING is the contract, on purpose. This is a
277
+ * re-hydration path: the caller's statement is "the thread is now exactly
278
+ * these messages". Dropping the elements that failed would install a SHORTER
279
+ * thread with no way for the caller to notice — the return type is `void` —
280
+ * which is the same silent-deletion failure objectui#4424 was graded on. The
281
+ * one in-repo consumer, `@object-ui/app-shell`'s `useReconcileOnError`,
282
+ * already calls this inside a `try`/`catch` that falls through to the
283
+ * ordinary error banner, so a refusal degrades to "show the error" instead of
284
+ * to a quietly-truncated transcript.
285
+ *
286
+ * Note the surface accepts an ARRAY only. The SDK's own `setMessages` also
287
+ * takes an updater callback; this member never advertised one and still
288
+ * does not.
289
+ */
231
290
  setMessages?: (messages: unknown[]) => void;
232
291
  /** Whether the hook is operating in API (streaming) mode */
233
292
  isApiMode: boolean;
@@ -238,6 +297,14 @@ export interface UseObjectChatReturn {
238
297
  /** Handle input change event */
239
298
  handleInputChange: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
240
299
  }
300
+ /**
301
+ * The message element the PINNED `@ai-sdk/react` `setMessages` accepts,
302
+ * DERIVED from that function rather than restated. No SDK type is named here,
303
+ * so a version bump that moves `UIMessage` moves this alias with it and the
304
+ * published `UseObjectChatReturn['setMessages']` never has to move at all —
305
+ * which is precisely why objectui#8342 was ruled option B and not option A.
306
+ */
307
+ type SdkChatMessage = Extract<Parameters<ReturnType<typeof useChat>['setMessages']>[0], readonly unknown[]>[number];
241
308
  /**
242
309
  * useObjectChat – Composable hook for ObjectUI Chatbot.
243
310
  *
@@ -1 +1 @@
1
- {"version":3,"file":"useObjectChat.d.ts","sourceRoot":"","sources":["../src/useObjectChat.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,WAAW,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC,GAAG;IACnE;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,8BAA8B,CAAC;AAElE,6EAA6E;AAC7E,wBAAgB,kBAAkB,IAAI,IAAI,CAOzC;AAED,mFAAmF;AACnF,MAAM,WAAW,WAAY,SAAQ,KAAK;IACxC,qFAAqF;IACrF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,cAAc,CAClC,KAAK,EAAE,WAAW,GAAG,GAAG,EACxB,IAAI,CAAC,EAAE,WAAW,GACjB,OAAO,CAAC,QAAQ,CAAC,CA2BnB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,QAAQ,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9C,OAAO,CAAC,EAAE,O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;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,oBAAyB,GAAG,mBAAmB,CA0crF"}
@@ -121,6 +121,11 @@ export interface UsePendingActionsReturn {
121
121
  /**
122
122
  * Hook that drives the HITL pending-actions inbox.
123
123
  *
124
+ * Polls every `pollInterval` while the endpoint answers. A refused read
125
+ * (`501`, `403`, `404`, any `4xx` other than `408` / `429`) stops the poll. A
126
+ * transient failure backs it off, doubling up to a ceiling. A read that
127
+ * succeeds resumes the normal cadence (objectui#11736; see `ListReadOutcome`).
128
+ *
124
129
  * @example
125
130
  * ```tsx
126
131
  * const { items, isLoading, error, approve, reject, refresh } =
@@ -1 +1 @@
1
- {"version":3,"file":"usePendingActions.d.ts","sourceRoot":"","sources":["../src/usePendingActions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAoBH,OAAO,KAAK,EACV,8BAA8B,EAC9B,6BAA6B,EAC9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,6BAA6B,CAAC;AAErC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,MAAM,cAAc,GAAG,8BAA8B,CAAC;AAC5D,MAAM,MAAM,aAAa,GAAG,6BAA6B,CAAC;AAE1D,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,mBAAmB,GAAG,KAAK,CAAC;IACrC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC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GG;IACH,MAAM,CAAC,EAAE,mBAAmB,GAAG,KAAK,CAAC;IACrC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iEAAiE;IACjE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IACzB,oCAAoC;IACpC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B;;;;OAIG;IACH,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;IACjD;;;OAGG;IACH,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;CACjE;AAsID;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,GAAE,wBAA6B,GACrC,uBAAuB,CA+GzB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@object-ui/plugin-chatbot",
3
- "version": "17.6.0",
3
+ "version": "18.0.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Chatbot interface plugin for Object UI",
@@ -26,24 +26,21 @@
26
26
  "dependencies": {
27
27
  "@ai-sdk/react": "^4.0.68",
28
28
  "@radix-ui/react-slot": "^1.3.3",
29
- "@objectstack/spec": "^17.0.0",
29
+ "@objectstack/spec": "^18.0.0",
30
30
  "@radix-ui/react-use-controllable-state": "^1.2.6",
31
31
  "ai": "^7.0.65",
32
32
  "class-variance-authority": "^0.7.1",
33
- "lucide-react": "^1.31.0",
34
- "motion": "^12.43.0",
33
+ "lucide-react": "^1.43.0",
34
+ "motion": "^13.2.0",
35
35
  "nanoid": "^6.0.1",
36
- "react-markdown": "^10.1.0",
37
- "react-syntax-highlighter": "^16.1.1",
38
- "remark-gfm": "^4.0.1",
39
36
  "shiki": "^4.4.2",
40
37
  "streamdown": "^2.5.0",
41
38
  "use-stick-to-bottom": "^1.1.6",
42
- "@object-ui/components": "17.6.0",
43
- "@object-ui/core": "17.6.0",
44
- "@object-ui/i18n": "17.6.0",
45
- "@object-ui/react": "17.6.0",
46
- "@object-ui/types": "17.6.0"
39
+ "@object-ui/components": "18.0.0",
40
+ "@object-ui/core": "18.0.0",
41
+ "@object-ui/i18n": "18.0.0",
42
+ "@object-ui/react": "18.0.0",
43
+ "@object-ui/types": "18.0.0"
47
44
  },
48
45
  "peerDependencies": {
49
46
  "react": "^18.0.0 || ^19.0.0",
@@ -52,7 +49,6 @@
52
49
  "devDependencies": {
53
50
  "@types/react": "19.2.18",
54
51
  "@types/react-dom": "19.2.4",
55
- "@types/react-syntax-highlighter": "^15.5.13",
56
52
  "@vitejs/plugin-react": "^6.0.5",
57
53
  "typescript": "^6.0.3",
58
54
  "vite": "^8.2.1",
@@ -84,8 +80,8 @@
84
80
  ],
85
81
  "scripts": {
86
82
  "build": "vite build",
87
- "test": "vitest run",
88
- "test:watch": "vitest",
83
+ "test": "vitest run --root ../.. packages/plugin-chatbot/",
84
+ "test:watch": "vitest --root ../.. packages/plugin-chatbot/",
89
85
  "type-check": "tsc --noEmit && tsc -p tsconfig.test.json",
90
86
  "lint": "eslint ."
91
87
  }