@promptbook/cli 0.112.0-118 → 0.112.0-119

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 (59) hide show
  1. package/apps/agents-server/src/app/api/page-preview/check/route.ts +31 -0
  2. package/apps/agents-server/src/app/api/page-preview/screenshot/route.ts +57 -0
  3. package/apps/agents-server/src/app/api/upload/route.ts +10 -1
  4. package/apps/agents-server/src/app/s3/[first]/[second]/[hash]/[filename]/route.ts +52 -0
  5. package/apps/agents-server/src/database/$provideClientSql.ts +37 -0
  6. package/apps/agents-server/src/database/$provideSupabaseForServer.ts +41 -0
  7. package/apps/agents-server/src/tools/$provideCdnForServer.ts +24 -0
  8. package/apps/agents-server/src/utils/cdn/classes/DigitalOceanSpaces.ts +30 -2
  9. package/apps/agents-server/src/utils/cdn/utils/getUserFileCdnKey.ts +10 -3
  10. package/apps/agents-server/src/utils/iframe/checkIfUrlCanBeEmbedded.ts +68 -0
  11. package/esm/index.es.js +26 -3
  12. package/esm/index.es.js.map +1 -1
  13. package/esm/src/book-components/BookEditor/BookEditor.d.ts +1 -1
  14. package/esm/src/book-components/BookEditor/BookEditorForClient.d.ts +1 -1
  15. package/esm/src/book-components/Chat/Chat/CitationIframePreview.d.ts +20 -0
  16. package/esm/src/book-components/_common/Dropdown/Dropdown.d.ts +1 -1
  17. package/esm/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +1 -1
  18. package/esm/src/book-components/_common/Modal/Modal.d.ts +1 -1
  19. package/esm/src/book-components/icons/AboutIcon.d.ts +1 -1
  20. package/esm/src/book-components/icons/DownloadIcon.d.ts +1 -1
  21. package/esm/src/book-components/icons/ExitFullscreenIcon.d.ts +1 -1
  22. package/esm/src/book-components/icons/FullscreenIcon.d.ts +1 -1
  23. package/esm/src/version.d.ts +1 -1
  24. package/package.json +1 -1
  25. package/src/book-3.0/LiteAgent.ts +1 -1
  26. package/src/book-components/BookEditor/BookEditor.tsx +6 -6
  27. package/src/book-components/BookEditor/BookEditorForClient.tsx +1 -1
  28. package/src/book-components/Chat/Chat/Chat.module.css +45 -0
  29. package/src/book-components/Chat/Chat/ChatCitationModal.tsx +2 -2
  30. package/src/book-components/Chat/Chat/CitationIframePreview.tsx +83 -0
  31. package/src/book-components/_common/Dropdown/Dropdown.tsx +1 -1
  32. package/src/book-components/_common/MenuHoisting/MenuHoistingContext.tsx +1 -1
  33. package/src/book-components/_common/Modal/Modal.tsx +1 -1
  34. package/src/book-components/icons/AboutIcon.tsx +1 -1
  35. package/src/book-components/icons/DownloadIcon.tsx +1 -1
  36. package/src/book-components/icons/ExitFullscreenIcon.tsx +1 -1
  37. package/src/book-components/icons/FullscreenIcon.tsx +1 -1
  38. package/src/cli/cli-commands/agents-server/buildAgentsServer.ts +31 -1
  39. package/src/execution/createPipelineExecutor/getKnowledgeForTask.ts +1 -1
  40. package/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.ts +1 -1
  41. package/src/llm-providers/openai/OpenAiAssistantExecutionToolsToolRunner.ts +1 -1
  42. package/src/llm-providers/openai/OpenAiVectorStoreKnowledgeSourcePreparer.ts +1 -1
  43. package/src/other/templates/getTemplatesPipelineCollection.ts +732 -687
  44. package/src/scripting/javascript/JavascriptEvalExecutionTools.ts +1 -1
  45. package/src/version.ts +2 -2
  46. package/src/versions.txt +1 -0
  47. package/umd/index.umd.js +26 -3
  48. package/umd/index.umd.js.map +1 -1
  49. package/umd/src/book-components/BookEditor/BookEditor.d.ts +1 -1
  50. package/umd/src/book-components/BookEditor/BookEditorForClient.d.ts +1 -1
  51. package/umd/src/book-components/Chat/Chat/CitationIframePreview.d.ts +20 -0
  52. package/umd/src/book-components/_common/Dropdown/Dropdown.d.ts +1 -1
  53. package/umd/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +1 -1
  54. package/umd/src/book-components/_common/Modal/Modal.d.ts +1 -1
  55. package/umd/src/book-components/icons/AboutIcon.d.ts +1 -1
  56. package/umd/src/book-components/icons/DownloadIcon.d.ts +1 -1
  57. package/umd/src/book-components/icons/ExitFullscreenIcon.d.ts +1 -1
  58. package/umd/src/book-components/icons/FullscreenIcon.d.ts +1 -1
  59. package/umd/src/version.d.ts +1 -1
@@ -1,4 +1,4 @@
1
- import { CSSProperties } from 'react';
1
+ import { type CSSProperties } from 'react';
2
2
  import type { Promisable } from 'type-fest';
3
3
  import type { string_book } from '../../book-2.0/agent-source/string_book';
4
4
  import type { number_percent } from '../../types/number_percent';
@@ -1,4 +1,4 @@
1
- import { BookEditorProps } from './BookEditor';
1
+ import type { BookEditorProps } from './BookEditor';
2
2
  /**
3
3
  * Renders a book editor
4
4
  *
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Props for the citation iframe preview component.
3
+ *
4
+ * @private component of `<ChatCitationModal/>`
5
+ */
6
+ export type CitationIframePreviewProps = {
7
+ src: string;
8
+ title: string;
9
+ };
10
+ /**
11
+ * Renders a citation URL preview as an iframe when the target page allows embedding,
12
+ * or falls back to a server-side screenshot with an "Open in new tab" link when it
13
+ * does not (e.g. X-Frame-Options: DENY / SAMEORIGIN).
14
+ *
15
+ * Embedding capability is determined by `GET /api/page-preview/check?url=<url>`.
16
+ * If that endpoint is unavailable the component falls back to the iframe directly.
17
+ *
18
+ * @private component of `<ChatCitationModal/>`
19
+ */
20
+ export declare function CitationIframePreview({ src, title }: CitationIframePreviewProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import { type ReactNode } from 'react';
2
2
  /**
3
3
  * Props for dropdown.
4
4
  */
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import { type ReactNode } from 'react';
2
2
  /**
3
3
  * Item that can be hoisted to the top menu
4
4
  *
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import { type ReactNode } from 'react';
2
2
  /**
3
3
  * Handles modal.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { SVGProps } from 'react';
1
+ import type { SVGProps } from 'react';
2
2
  /**
3
3
  * Renders an information/about icon.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { SVGProps } from 'react';
1
+ import type { SVGProps } from 'react';
2
2
  /**
3
3
  * Renders a download icon.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JSX } from 'react';
1
+ import type { JSX } from 'react';
2
2
  /**
3
3
  * Renders an icon that represents the exit fullscreen action
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JSX } from 'react';
1
+ import type { JSX } from 'react';
2
2
  /**
3
3
  * Renders an icon that represents the fullscreen action
4
4
  *
@@ -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-117`).
18
+ * It follows semantic versioning (e.g., `0.112.0-118`).
19
19
  *
20
20
  * @generated
21
21
  */