@promptbook/node 0.110.0-7 → 0.110.0-8

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.
@@ -45,6 +45,10 @@ export type AgentChipProps = {
45
45
  * Additional CSS class name
46
46
  */
47
47
  className?: string;
48
+ /**
49
+ * Optional suffix appended to the agent label (e.g., " (2x)").
50
+ */
51
+ labelSuffix?: string;
48
52
  };
49
53
  /**
50
54
  * AgentChip component - displays a chip with agent avatar and name
@@ -64,4 +68,4 @@ export type AgentChipProps = {
64
68
  *
65
69
  * @private utility of `ChatMessageItem` component
66
70
  */
67
- export declare function AgentChip({ agent, isOngoing, isClickable, onClick, className }: AgentChipProps): import("react/jsx-runtime").JSX.Element;
71
+ export declare function AgentChip({ agent, isOngoing, isClickable, onClick, className, labelSuffix, }: AgentChipProps): import("react/jsx-runtime").JSX.Element;
@@ -69,5 +69,8 @@ export type LlmChatProps = Omit<ChatProps, 'messages' | 'onMessage' | 'onChange'
69
69
  * @param error - The error that occurred
70
70
  * @param retry - Function to retry the last failed message
71
71
  */
72
- onError?(error: unknown, retry: () => void): void;
72
+ onError?(error: unknown, retry: () => void, failedMessage: {
73
+ content: string;
74
+ attachments: ChatMessage['attachments'];
75
+ }): void;
73
76
  };
@@ -0,0 +1,10 @@
1
+ import type { ToolCall } from '../../types/ToolCall';
2
+ /**
3
+ * Builds a stable identity string for tool calls across partial updates.
4
+ *
5
+ * @param toolCall - Tool call entry to identify.
6
+ * @returns Stable identity string for deduplication.
7
+ *
8
+ * @private function of <Chat/>
9
+ */
10
+ export declare function getToolCallIdentity(toolCall: ToolCall): string;
@@ -15,7 +15,7 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
15
15
  export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
16
16
  /**
17
17
  * Represents the version string of the Promptbook engine.
18
- * It follows semantic versioning (e.g., `0.110.0-6`).
18
+ * It follows semantic versioning (e.g., `0.110.0-7`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/node",
3
- "version": "0.110.0-7",
3
+ "version": "0.110.0-8",
4
4
  "description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -96,7 +96,7 @@
96
96
  "module": "./esm/index.es.js",
97
97
  "typings": "./esm/typings/src/_packages/node.index.d.ts",
98
98
  "peerDependencies": {
99
- "@promptbook/core": "0.110.0-7"
99
+ "@promptbook/core": "0.110.0-8"
100
100
  },
101
101
  "dependencies": {
102
102
  "@mozilla/readability": "0.6.0",
package/umd/index.umd.js CHANGED
@@ -48,7 +48,7 @@
48
48
  * @generated
49
49
  * @see https://github.com/webgptorg/promptbook
50
50
  */
51
- const PROMPTBOOK_ENGINE_VERSION = '0.110.0-7';
51
+ const PROMPTBOOK_ENGINE_VERSION = '0.110.0-8';
52
52
  /**
53
53
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
54
54
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -20323,6 +20323,40 @@
20323
20323
  return toolCall.name === ASSISTANT_PREPARATION_TOOL_CALL_NAME;
20324
20324
  }
20325
20325
 
20326
+ /**
20327
+ * Builds a stable identity string for tool calls across partial updates.
20328
+ *
20329
+ * @param toolCall - Tool call entry to identify.
20330
+ * @returns Stable identity string for deduplication.
20331
+ *
20332
+ * @private function of <Chat/>
20333
+ */
20334
+ function getToolCallIdentity(toolCall) {
20335
+ const rawToolCall = toolCall.rawToolCall;
20336
+ const rawId = (rawToolCall === null || rawToolCall === void 0 ? void 0 : rawToolCall.id) || (rawToolCall === null || rawToolCall === void 0 ? void 0 : rawToolCall.callId) || (rawToolCall === null || rawToolCall === void 0 ? void 0 : rawToolCall.call_id);
20337
+ if (rawId) {
20338
+ return `id:${rawId}`;
20339
+ }
20340
+ if (toolCall.createdAt) {
20341
+ return `time:${toolCall.createdAt}:${toolCall.name}`;
20342
+ }
20343
+ const argsKey = (() => {
20344
+ if (typeof toolCall.arguments === 'string') {
20345
+ return toolCall.arguments;
20346
+ }
20347
+ if (!toolCall.arguments) {
20348
+ return '';
20349
+ }
20350
+ try {
20351
+ return JSON.stringify(toolCall.arguments);
20352
+ }
20353
+ catch (_a) {
20354
+ return '';
20355
+ }
20356
+ })();
20357
+ return `fallback:${toolCall.name}:${argsKey}`;
20358
+ }
20359
+
20326
20360
  /*! *****************************************************************************
20327
20361
  Copyright (c) Microsoft Corporation.
20328
20362
 
@@ -26121,26 +26155,7 @@
26121
26155
  };
26122
26156
  };
26123
26157
  const getToolCallKey = (toolCall) => {
26124
- var _a;
26125
- const rawId = (_a = toolCall.rawToolCall) === null || _a === void 0 ? void 0 : _a.id;
26126
- if (rawId) {
26127
- return `id:${rawId}`;
26128
- }
26129
- const argsKey = (() => {
26130
- if (typeof toolCall.arguments === 'string') {
26131
- return toolCall.arguments;
26132
- }
26133
- if (!toolCall.arguments) {
26134
- return '';
26135
- }
26136
- try {
26137
- return JSON.stringify(toolCall.arguments);
26138
- }
26139
- catch (_a) {
26140
- return '';
26141
- }
26142
- })();
26143
- return `${toolCall.name}:${toolCall.createdAt || ''}:${argsKey}`;
26158
+ return getToolCallIdentity(toolCall);
26144
26159
  };
26145
26160
  const mergeToolCall = (existing, incoming) => {
26146
26161
  const incomingResult = incoming.result;