@promptbook/cli 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/cli",
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,
package/umd/index.umd.js CHANGED
@@ -56,7 +56,7 @@
56
56
  * @generated
57
57
  * @see https://github.com/webgptorg/promptbook
58
58
  */
59
- const PROMPTBOOK_ENGINE_VERSION = '0.110.0-7';
59
+ const PROMPTBOOK_ENGINE_VERSION = '0.110.0-8';
60
60
  /**
61
61
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
62
62
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -32426,6 +32426,40 @@
32426
32426
  return toolCall.name === ASSISTANT_PREPARATION_TOOL_CALL_NAME;
32427
32427
  }
32428
32428
 
32429
+ /**
32430
+ * Builds a stable identity string for tool calls across partial updates.
32431
+ *
32432
+ * @param toolCall - Tool call entry to identify.
32433
+ * @returns Stable identity string for deduplication.
32434
+ *
32435
+ * @private function of <Chat/>
32436
+ */
32437
+ function getToolCallIdentity(toolCall) {
32438
+ const rawToolCall = toolCall.rawToolCall;
32439
+ 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);
32440
+ if (rawId) {
32441
+ return `id:${rawId}`;
32442
+ }
32443
+ if (toolCall.createdAt) {
32444
+ return `time:${toolCall.createdAt}:${toolCall.name}`;
32445
+ }
32446
+ const argsKey = (() => {
32447
+ if (typeof toolCall.arguments === 'string') {
32448
+ return toolCall.arguments;
32449
+ }
32450
+ if (!toolCall.arguments) {
32451
+ return '';
32452
+ }
32453
+ try {
32454
+ return JSON.stringify(toolCall.arguments);
32455
+ }
32456
+ catch (_a) {
32457
+ return '';
32458
+ }
32459
+ })();
32460
+ return `fallback:${toolCall.name}:${argsKey}`;
32461
+ }
32462
+
32429
32463
  /*! *****************************************************************************
32430
32464
  Copyright (c) Microsoft Corporation.
32431
32465
 
@@ -34080,26 +34114,7 @@
34080
34114
  };
34081
34115
  };
34082
34116
  const getToolCallKey = (toolCall) => {
34083
- var _a;
34084
- const rawId = (_a = toolCall.rawToolCall) === null || _a === void 0 ? void 0 : _a.id;
34085
- if (rawId) {
34086
- return `id:${rawId}`;
34087
- }
34088
- const argsKey = (() => {
34089
- if (typeof toolCall.arguments === 'string') {
34090
- return toolCall.arguments;
34091
- }
34092
- if (!toolCall.arguments) {
34093
- return '';
34094
- }
34095
- try {
34096
- return JSON.stringify(toolCall.arguments);
34097
- }
34098
- catch (_a) {
34099
- return '';
34100
- }
34101
- })();
34102
- return `${toolCall.name}:${toolCall.createdAt || ''}:${argsKey}`;
34117
+ return getToolCallIdentity(toolCall);
34103
34118
  };
34104
34119
  const mergeToolCall = (existing, incoming) => {
34105
34120
  const incomingResult = incoming.result;