@promptbook/cli 0.112.0-138 → 0.112.0-140

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 (56) hide show
  1. package/README.md +1 -1
  2. package/apps/agents-server/README.md +9 -0
  3. package/apps/agents-server/src/app/actions.ts +18 -7
  4. package/apps/agents-server/src/app/admin/login-methods/shibboleth/page.tsx +7 -17
  5. package/apps/agents-server/src/app/admin/metadata/MetadataClient.tsx +395 -30
  6. package/apps/agents-server/src/app/api/agents/export/route.ts +28 -2
  7. package/apps/agents-server/src/app/api/auth/change-password/route.ts +53 -6
  8. package/apps/agents-server/src/app/api/auth/login/route.ts +17 -8
  9. package/apps/agents-server/src/app/api/chat/export/pdf/route.ts +167 -2
  10. package/apps/agents-server/src/app/api/emails/incoming/sendgrid/route.ts +24 -2
  11. package/apps/agents-server/src/app/api/metadata/import/route.ts +2 -1
  12. package/apps/agents-server/src/app/api/users/[username]/route.ts +3 -2
  13. package/apps/agents-server/src/app/api/users/route.ts +5 -4
  14. package/apps/agents-server/src/components/Homepage/AgentsList.tsx +1 -13
  15. package/apps/agents-server/src/components/Homepage/AgentsListHeader.tsx +3 -19
  16. package/apps/agents-server/src/components/Homepage/AgentsListListView.tsx +6 -0
  17. package/apps/agents-server/src/components/Homepage/AgentsListViewContent.tsx +6 -0
  18. package/apps/agents-server/src/components/Homepage/SortableFolderCard.tsx +7 -1
  19. package/apps/agents-server/src/components/Homepage/useAgentsListImportExportState.ts +45 -43
  20. package/apps/agents-server/src/components/Homepage/useAgentsListState.ts +1 -3
  21. package/apps/agents-server/src/components/UsersList/useUsersAdmin.ts +2 -10
  22. package/apps/agents-server/src/database/seedCoreAgents.ts +8 -7
  23. package/apps/agents-server/src/message-providers/email/sendgrid/verifySendgridInboundParseWebhook.ts +345 -0
  24. package/apps/agents-server/src/utils/agentsTransfer/createAgentsExportZipStream.ts +15 -2
  25. package/apps/agents-server/src/utils/authenticateUser.ts +110 -3
  26. package/apps/agents-server/src/utils/authenticationAttemptRateLimit.ts +504 -0
  27. package/apps/agents-server/src/utils/backup/createBooksBackupZipStream.ts +76 -5
  28. package/apps/agents-server/src/utils/chatExport/renderHtmlToPdfOnServer.ts +32 -0
  29. package/apps/agents-server/src/utils/chatExport/sanitizeChatPdfExportHtml.ts +193 -0
  30. package/apps/agents-server/src/utils/currentUserIdentity.ts +22 -9
  31. package/apps/agents-server/src/utils/externalChatRunner/processExternalUserChatJob.ts +5 -0
  32. package/apps/agents-server/src/utils/getUserById.ts +19 -5
  33. package/apps/agents-server/src/utils/localChatRunner/processLocalUserChatJob.ts +5 -0
  34. package/apps/agents-server/src/utils/metadataConfigurationTransfer.ts +32 -16
  35. package/apps/agents-server/src/utils/publicUser.ts +59 -0
  36. package/apps/agents-server/src/utils/shibbolethAuthentication.ts +17 -9
  37. package/apps/agents-server/src/utils/userChat/createRunUserChatJobPersistenceController.ts +17 -11
  38. package/apps/agents-server/src/utils/userChat/createUserChatHarnessProgressCard.ts +99 -0
  39. package/apps/agents-server/src/utils/userChat/createUserChatRunnerProgressCard.ts +63 -0
  40. package/apps/agents-server/src/utils/userChat/userChatMessageLifecycle.ts +0 -3
  41. package/apps/agents-server/src/utils/vpsConfiguration.ts +3 -0
  42. package/esm/index.es.js +14 -5
  43. package/esm/index.es.js.map +1 -1
  44. package/esm/src/book-components/Chat/utils/isVisibleChatToolCall.d.ts +10 -0
  45. package/esm/src/version.d.ts +1 -1
  46. package/package.json +1 -1
  47. package/src/book-components/Chat/Chat/createChatMessageToolCallRenderModel.ts +2 -9
  48. package/src/book-components/Chat/utils/isVisibleChatToolCall.ts +23 -0
  49. package/src/other/templates/getTemplatesPipelineCollection.ts +805 -736
  50. package/src/version.ts +2 -2
  51. package/src/versions.txt +2 -1
  52. package/umd/index.umd.js +14 -5
  53. package/umd/index.umd.js.map +1 -1
  54. package/umd/src/book-components/Chat/utils/isVisibleChatToolCall.d.ts +10 -0
  55. package/umd/src/version.d.ts +1 -1
  56. package/apps/agents-server/src/app/api/long-streaming/route.ts +0 -23
@@ -0,0 +1,10 @@
1
+ import { type ToolCall } from '../../../types/ToolCall';
2
+ /**
3
+ * Returns true when one tool call represents a user-facing action.
4
+ *
5
+ * @param toolCall - Tool call candidate.
6
+ * @returns Whether the tool call should be visible in chat progress and chips.
7
+ *
8
+ * @private internal utility of `<Chat/>`
9
+ */
10
+ export declare function isVisibleChatToolCall(toolCall: Pick<ToolCall, 'name'>): boolean;
@@ -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.112.0-137`).
18
+ * It follows semantic versioning (e.g., `0.112.0-139`).
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.112.0-138",
3
+ "version": "0.112.0-140",
4
4
  "description": "Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -1,5 +1,4 @@
1
1
  import type { ToolCall } from '../../../types/ToolCall';
2
- import { ASSISTANT_PREPARATION_TOOL_CALL_NAME } from '../../../types/ToolCall';
3
2
  import { resolveToolCallIdempotencyKey } from '../../../utils/toolCalls/resolveToolCallIdempotencyKey';
4
3
  import type { AgentChipData } from '../AgentChip/AgentChip';
5
4
  import type { ChatMessage } from '../types/ChatMessage';
@@ -8,6 +7,7 @@ import { collectTeamToolCallSummary } from '../utils/collectTeamToolCallSummary'
8
7
  import { isTeamToolName } from '../utils/createTeamToolNameFromUrl';
9
8
  import type { ToolCallChipletInfo } from '../utils/getToolCallChipletInfo';
10
9
  import { buildToolCallChipText, getToolCallChipletInfo } from '../utils/getToolCallChipletInfo';
10
+ import { isVisibleChatToolCall } from '../utils/isVisibleChatToolCall';
11
11
  import { resolveToolCallState } from '../utils/resolveToolCallState';
12
12
  import { createDeduplicatedWalletCredentialToolCalls } from '../utils/walletCredentialToolCall';
13
13
  import type { ChatProps } from './ChatProps';
@@ -121,13 +121,6 @@ export function createChatMessageToolCallRenderModel(
121
121
  };
122
122
  }
123
123
 
124
- /**
125
- * Tool calls that should stay available in message data but never render as chips under the message.
126
- *
127
- * @private internal helper of `<ChatMessageItem/>`
128
- */
129
- const HIDDEN_TOOL_CALL_CHIP_NAMES = new Set([ASSISTANT_PREPARATION_TOOL_CALL_NAME, 'agent_progress']);
130
-
131
124
  /**
132
125
  * Ongoing tool call entry used for grouping.
133
126
  *
@@ -141,7 +134,7 @@ type OngoingToolCall = NonNullable<ChatMessage['ongoingToolCalls']>[number];
141
134
  * @private internal helper of `<ChatMessageItem/>`
142
135
  */
143
136
  function shouldRenderToolCallChip(toolCall: ToolCall): boolean {
144
- return !HIDDEN_TOOL_CALL_CHIP_NAMES.has(toolCall.name);
137
+ return isVisibleChatToolCall(toolCall);
145
138
  }
146
139
 
147
140
  /**
@@ -0,0 +1,23 @@
1
+ import { ASSISTANT_PREPARATION_TOOL_CALL_NAME, type ToolCall } from '../../../types/ToolCall';
2
+
3
+ /**
4
+ * Tool calls that stay available in message data but should not be surfaced as user-facing chat progress.
5
+ *
6
+ * @private internal utility of `<Chat/>`
7
+ */
8
+ const HIDDEN_CHAT_TOOL_CALL_NAMES: ReadonlySet<string> = new Set([
9
+ ASSISTANT_PREPARATION_TOOL_CALL_NAME,
10
+ 'agent_progress',
11
+ ]);
12
+
13
+ /**
14
+ * Returns true when one tool call represents a user-facing action.
15
+ *
16
+ * @param toolCall - Tool call candidate.
17
+ * @returns Whether the tool call should be visible in chat progress and chips.
18
+ *
19
+ * @private internal utility of `<Chat/>`
20
+ */
21
+ export function isVisibleChatToolCall(toolCall: Pick<ToolCall, 'name'>): boolean {
22
+ return !HIDDEN_CHAT_TOOL_CALL_NAMES.has(toolCall.name);
23
+ }