@promptbook/cli 0.112.0-97 → 0.112.0-98

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 (60) hide show
  1. package/apps/agents-server/README.md +3 -3
  2. package/apps/agents-server/src/app/admin/cli-access/CliAccessClient.tsx +99 -0
  3. package/apps/agents-server/src/app/admin/cli-access/page.tsx +14 -0
  4. package/apps/agents-server/src/app/admin/code-runners/CodeRunnersClient.tsx +76 -325
  5. package/apps/agents-server/src/app/admin/database/page.tsx +1 -2
  6. package/apps/agents-server/src/app/agents/[agentName]/chat/CanonicalAgentChatSurface.tsx +24 -0
  7. package/apps/agents-server/src/app/api/admin/cli-access/route.ts +137 -0
  8. package/apps/agents-server/src/app/api/admin/code-runners/authentication/route.ts +7 -64
  9. package/apps/agents-server/src/app/api/admin/servers/[serverId]/route.ts +3 -3
  10. package/apps/agents-server/src/app/api/admin/servers/route.ts +4 -4
  11. package/apps/agents-server/src/app/api/chat/export/pdf/route.ts +63 -0
  12. package/apps/agents-server/src/components/AdminTerminal/AdminTerminalCard.tsx +279 -0
  13. package/apps/agents-server/src/components/AdminTerminal/useAdminTerminalSession.ts +336 -0
  14. package/apps/agents-server/src/components/Header/buildHeaderSystemMenuItems.ts +4 -0
  15. package/apps/agents-server/src/database/$provideClientSql.ts +17 -4
  16. package/apps/agents-server/src/database/$provideDatabaseAdminExecutor.ts +24 -3
  17. package/apps/agents-server/src/database/$provideSupabaseForServer.ts +1 -11
  18. package/apps/agents-server/src/database/agentsServerDatabaseMode.ts +1 -20
  19. package/apps/agents-server/src/languages/ServerTranslationKeys.ts +1 -0
  20. package/apps/agents-server/src/languages/translations/czech.yaml +1 -0
  21. package/apps/agents-server/src/languages/translations/english.yaml +1 -0
  22. package/apps/agents-server/src/tools/$provideServer.ts +2 -2
  23. package/apps/agents-server/src/tools/BrowserConnectionProvider.ts +1 -1
  24. package/apps/agents-server/src/utils/chatExport/downloadChatPdfFromServer.ts +59 -0
  25. package/apps/agents-server/src/utils/chatExport/renderHtmlToPdfOnServer.ts +37 -0
  26. package/apps/agents-server/src/utils/codeRunnerAuthentication.ts +77 -237
  27. package/apps/agents-server/src/utils/createInteractiveTerminalEventStream.ts +84 -0
  28. package/apps/agents-server/src/utils/interactiveTerminalSession.ts +442 -0
  29. package/apps/agents-server/src/utils/serverCliAccess.ts +221 -0
  30. package/apps/agents-server/src/utils/serverRegistry.ts +4 -4
  31. package/apps/agents-server/src/utils/vpsConfiguration.ts +2 -0
  32. package/esm/apps/agents-server/src/database/agentsServerDatabaseMode.d.ts +1 -9
  33. package/esm/index.es.js +2 -2
  34. package/esm/src/book-components/Chat/Chat/ChatActionsBar.d.ts +2 -0
  35. package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +6 -0
  36. package/esm/src/book-components/Chat/save/_common/ChatSaveFormatHandler.d.ts +35 -0
  37. package/esm/src/book-components/Chat/save/_common/createChatExportFilename.d.ts +11 -0
  38. package/esm/src/version.d.ts +1 -1
  39. package/package.json +1 -1
  40. package/src/book-components/Chat/Chat/Chat.tsx +2 -0
  41. package/src/book-components/Chat/Chat/ChatActionsBar.tsx +17 -9
  42. package/src/book-components/Chat/Chat/ChatProps.tsx +7 -0
  43. package/src/book-components/Chat/save/_common/ChatSaveFormatHandler.ts +40 -0
  44. package/src/book-components/Chat/save/_common/createChatExportFilename.ts +20 -0
  45. package/src/cli/cli-commands/agents-server/ensureAgentsServerEnvFile.ts +1 -1
  46. package/src/other/templates/getTemplatesPipelineCollection.ts +721 -736
  47. package/src/version.ts +2 -2
  48. package/src/versions.txt +1 -0
  49. package/umd/apps/agents-server/src/database/agentsServerDatabaseMode.d.ts +1 -9
  50. package/umd/index.umd.js +2 -2
  51. package/umd/src/book-components/Chat/Chat/ChatActionsBar.d.ts +2 -0
  52. package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +6 -0
  53. package/umd/src/book-components/Chat/save/_common/ChatSaveFormatHandler.d.ts +35 -0
  54. package/umd/src/book-components/Chat/save/_common/createChatExportFilename.d.ts +11 -0
  55. package/umd/src/version.d.ts +1 -1
  56. package/apps/agents-server/src/database/$providePostgresPool.ts +0 -27
  57. package/apps/agents-server/src/database/postgres/$provideLocalPostgresSupabase.ts +0 -1261
  58. package/src/conversion/validation/_importPipeline.ts +0 -88
  59. /package/esm/src/conversion/validation/{_importPipeline.d.ts → _importPipeline.test.d.ts} +0 -0
  60. /package/umd/src/conversion/validation/{_importPipeline.d.ts → _importPipeline.test.d.ts} +0 -0
@@ -1,88 +0,0 @@
1
- import { readFile } from 'fs/promises';
2
- import { join } from 'path';
3
- import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
4
- import type { PipelineString } from '../../pipeline/PipelineString';
5
- import { validatePipelineString } from '../../pipeline/validatePipelineString';
6
- import { unpreparePipeline } from '../../prepare/unpreparePipeline';
7
- import { $provideFilesystemForNode } from '../../scrapers/_common/register/$provideFilesystemForNode';
8
- import type { string_filename } from '../../types/string_filename';
9
- import { loadArchive } from '../archive/loadArchive';
10
-
11
- /**
12
- * Import the pipeline.book or pipeline.bookc file
13
- *
14
- * Note: Using here custom import to work in jest tests
15
- * Note: Using sync version is 💩 in the production code, but it's ok here in tests
16
- *
17
- * @param path - The path to the file relative to examples/pipelines directory
18
- *
19
- * @private internal function of tests
20
- */
21
- export async function importPipelineWithoutPreparation(path: `${string}.book`): Promise<PipelineString>;
22
- /**
23
- * Imports pipeline without preparation.
24
- *
25
- * @private internal utility of `_importPipeline`
26
- */
27
- export async function importPipelineWithoutPreparation(path: `${string}.bookc`): Promise<PipelineJson>;
28
- /**
29
- * Imports pipeline without preparation.
30
- *
31
- * @private internal utility of `_importPipeline`
32
- */
33
- export async function importPipelineWithoutPreparation(path: string_filename): Promise<PipelineString | PipelineJson> {
34
- const examplesDir = '../../../examples/pipelines'; // <- TODO: [🚏] DRY, to config
35
- const filePath = join(__dirname, examplesDir, path);
36
-
37
- if (path.endsWith('.bookc')) {
38
- const pipelines = await loadArchive(filePath, $provideFilesystemForNode());
39
-
40
- if (pipelines.length !== 1) {
41
- throw new Error('The archive must contain exactly one pipeline');
42
- }
43
-
44
- let pipeline = pipelines[0]!;
45
-
46
- pipeline = unpreparePipeline(pipeline);
47
- return pipeline;
48
- } else if (path.endsWith('.book')) {
49
- const content = await readFile(filePath, 'utf-8');
50
-
51
- return validatePipelineString(content);
52
- } else {
53
- throw new Error('This should be used only for .book.md or .bookc files');
54
- }
55
- }
56
-
57
- /**
58
- * Import the pipeline.bookc file as parsed JSON
59
- *
60
- * @private internal function of tests
61
- */
62
- export async function importPipelineJson(path: `${string}.bookc`): Promise<PipelineJson> {
63
- const examplesDir = '../../../examples/pipelines'; // <- TODO: [🚏] DRY, to config
64
-
65
- const pipelines = await loadArchive(join(__dirname, examplesDir, path), $provideFilesystemForNode());
66
-
67
- if (pipelines.length !== 1) {
68
- throw new Error('The archive must contain exactly one pipeline');
69
- }
70
-
71
- const pipeline = pipelines[0]!;
72
-
73
- return pipeline;
74
- }
75
-
76
- /*
77
- TODO: [👩🏽‍🤝‍🧑🏾]
78
- /**
79
- * Import the pipeline.bookc file as string
80
- *
81
- * @private internal function of tests
82
- * /
83
- ex_port async function importPipelineJsonAsString(path: `${string}.bookc`): Promise<string_json<PipelineJson>> {
84
- }
85
- */
86
-
87
- // Note: [⚫] Code for private pipeline import shim [_importPipeline](src/conversion/validation/_importPipeline.ts) should never be published in any package
88
- // Note: [💞] Ignore a discrepancy between file name and entity name