@promptbook/website-crawler 0.112.0-99 → 0.113.0-0
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.
- package/README.md +76 -44
- package/esm/index.es.js +12 -13
- package/esm/index.es.js.map +1 -1
- package/esm/src/_packages/components.index.d.ts +4 -0
- package/esm/src/_packages/core.index.d.ts +22 -2
- package/esm/src/_packages/node.index.d.ts +40 -0
- package/esm/src/_packages/types.index.d.ts +20 -0
- package/esm/src/avatars/avatarAnimationScheduler.d.ts +4 -0
- package/esm/src/avatars/types/AvatarVisualDefinition.d.ts +1 -1
- package/esm/src/avatars/visuals/octopus3d3AvatarVisual.d.ts +7 -0
- package/esm/src/avatars/visuals/octopus3d4AvatarVisual.d.ts +7 -0
- package/esm/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -0
- package/esm/src/book-2.0/agent-source/agentSourceVisibility.d.ts +97 -0
- package/esm/src/book-2.0/agent-source/agentSourceVisibility.test.d.ts +1 -0
- package/esm/src/book-3.0/BookNodeAgentSource.d.ts +38 -0
- package/esm/src/book-3.0/CliAgent.d.ts +66 -0
- package/esm/src/book-3.0/CliAgent.test.d.ts +1 -0
- package/esm/src/book-3.0/LiteAgent.d.ts +68 -0
- package/esm/src/book-3.0/LiteAgent.test.d.ts +1 -0
- package/esm/src/book-3.0/agentFolderPaths.d.ts +30 -0
- package/esm/src/book-3.0/cliAgentEnv.d.ts +33 -0
- package/esm/src/book-components/BookEditor/BookEditor.d.ts +6 -5
- package/esm/src/book-components/BookEditor/BookEditorAboutPromptbookInformation.d.ts +12 -0
- package/esm/src/book-components/BookEditor/BookEditorBrowserConfig.d.ts +2 -0
- package/esm/src/book-components/BookEditor/BookEditorForClient.d.ts +7 -0
- package/esm/src/book-components/BookEditor/BookEditorMonacoTokenization.d.ts +2 -0
- package/esm/src/book-components/BookEditor/BookEditorTheme.d.ts +24 -0
- package/esm/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.d.ts +9 -0
- package/esm/src/book-components/BookEditor/useBookEditorMonacoLanguage.d.ts +1 -6
- package/esm/src/book-components/BookEditor/useBookEditorMonacoLifecycle.d.ts +1 -4
- package/esm/src/book-components/BookEditor/useBookEditorMonacoStyles.d.ts +2 -1
- package/esm/src/book-components/Chat/Chat/ChatCitationModal.d.ts +2 -0
- package/esm/src/book-components/Chat/Chat/ChatMessageItem.d.ts +4 -0
- package/esm/src/book-components/Chat/Chat/ChatMessageList.d.ts +4 -0
- package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +5 -0
- package/esm/src/book-components/Chat/Chat/ChatToolCallModal.d.ts +2 -0
- package/esm/src/book-components/Chat/Chat/ChatToolCallModalContent.d.ts +3 -1
- package/esm/src/book-components/Chat/Chat/CitationIframePreview.d.ts +20 -0
- package/esm/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +2 -0
- package/esm/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +1 -0
- package/esm/src/book-components/Chat/SourceChip/SourceChip.d.ts +6 -1
- package/esm/src/book-components/Chat/hooks/useResolvedCitationLabel.d.ts +12 -0
- package/esm/src/book-components/Chat/types/ChatMessage.d.ts +4 -0
- package/esm/src/book-components/Chat/types/ChatParticipant.d.ts +1 -1
- package/esm/src/book-components/Chat/types/CitationLabelResolver.d.ts +8 -0
- package/esm/src/book-components/Chat/utils/citationHelpers.d.ts +9 -0
- package/esm/src/book-components/Chat/utils/decodeJsonUnicodeEscapesInMarkdownText.d.ts +14 -0
- package/esm/src/book-components/Chat/utils/decodeJsonUnicodeEscapesInMarkdownText.test.d.ts +1 -0
- package/esm/src/book-components/Chat/utils/isVisibleChatToolCall.d.ts +10 -0
- package/esm/src/book-components/Chat/utils/parseCitationsFromContent.d.ts +4 -0
- package/esm/src/book-components/_common/Dropdown/Dropdown.d.ts +1 -1
- package/esm/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +1 -1
- package/esm/src/book-components/_common/Modal/Modal.d.ts +1 -1
- package/esm/src/book-components/icons/AboutIcon.d.ts +1 -1
- package/esm/src/book-components/icons/DownloadIcon.d.ts +1 -1
- package/esm/src/book-components/icons/ExitFullscreenIcon.d.ts +1 -1
- package/esm/src/book-components/icons/FullscreenIcon.d.ts +1 -1
- package/esm/src/cli/cli-commands/agent/agentCliOptions.d.ts +38 -0
- package/esm/src/cli/cli-commands/agent/chat.d.ts +10 -0
- package/esm/src/cli/cli-commands/agent/exec.d.ts +10 -0
- package/esm/src/cli/cli-commands/agent/run.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/agent-folder/agentProjectPaths.d.ts +2 -24
- package/esm/src/cli/cli-commands/agent.d.ts +14 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +23 -1
- package/esm/src/cli/cli-commands/agents-server/run.d.ts +6 -0
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +9 -2
- package/esm/src/cli/cli-commands/coder/ThinkingLevel.d.ts +1 -1
- package/esm/src/cli/cli-commands/coder/ensureCoderDeveloperAgentFile.d.ts +25 -0
- package/esm/src/cli/cli-commands/coder/find-unwritten.d.ts +10 -0
- package/esm/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +2 -0
- package/esm/src/cli/cli-commands/coder/server.d.ts +13 -0
- package/esm/src/cli/cli-commands/coder/waitOptions.d.ts +14 -0
- package/esm/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +9 -25
- package/esm/src/collection/agent-collection/CreateAgentInput.d.ts +2 -1
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +22 -0
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.d.ts +21 -1
- package/esm/src/commitments/META_VISIBILITY/META_VISIBILITY.d.ts +27 -0
- package/esm/src/commitments/_common/teamInternalAgentAccess.d.ts +9 -1
- package/esm/src/commitments/index.d.ts +2 -1
- package/esm/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -1
- package/esm/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +1 -1
- package/esm/src/scrapers/website/utils/createShowdownConverter.d.ts +2 -2
- package/esm/src/utils/isTimingSafeEqualString.d.ts +25 -0
- package/esm/src/utils/validators/url/isValidAgentUrl.d.ts +5 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +2 -3
- package/umd/index.umd.js +16 -13
- package/umd/index.umd.js.map +1 -1
- package/umd/src/_packages/components.index.d.ts +4 -0
- package/umd/src/_packages/core.index.d.ts +22 -2
- package/umd/src/_packages/node.index.d.ts +40 -0
- package/umd/src/_packages/types.index.d.ts +20 -0
- package/umd/src/avatars/avatarAnimationScheduler.d.ts +4 -0
- package/umd/src/avatars/types/AvatarVisualDefinition.d.ts +1 -1
- package/umd/src/avatars/visuals/octopus3d3AvatarVisual.d.ts +7 -0
- package/umd/src/avatars/visuals/octopus3d4AvatarVisual.d.ts +7 -0
- package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -0
- package/umd/src/book-2.0/agent-source/agentSourceVisibility.d.ts +97 -0
- package/umd/src/book-2.0/agent-source/agentSourceVisibility.test.d.ts +1 -0
- package/umd/src/book-3.0/BookNodeAgentSource.d.ts +38 -0
- package/umd/src/book-3.0/CliAgent.d.ts +66 -0
- package/umd/src/book-3.0/CliAgent.test.d.ts +1 -0
- package/umd/src/book-3.0/LiteAgent.d.ts +68 -0
- package/umd/src/book-3.0/LiteAgent.test.d.ts +1 -0
- package/umd/src/book-3.0/agentFolderPaths.d.ts +30 -0
- package/umd/src/book-3.0/cliAgentEnv.d.ts +33 -0
- package/umd/src/book-components/BookEditor/BookEditor.d.ts +6 -5
- package/umd/src/book-components/BookEditor/BookEditorAboutPromptbookInformation.d.ts +12 -0
- package/umd/src/book-components/BookEditor/BookEditorBrowserConfig.d.ts +2 -0
- package/umd/src/book-components/BookEditor/BookEditorForClient.d.ts +7 -0
- package/umd/src/book-components/BookEditor/BookEditorMonacoTokenization.d.ts +2 -0
- package/umd/src/book-components/BookEditor/BookEditorTheme.d.ts +24 -0
- package/umd/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.d.ts +9 -0
- package/umd/src/book-components/BookEditor/useBookEditorMonacoLanguage.d.ts +1 -6
- package/umd/src/book-components/BookEditor/useBookEditorMonacoLifecycle.d.ts +1 -4
- package/umd/src/book-components/BookEditor/useBookEditorMonacoStyles.d.ts +2 -1
- package/umd/src/book-components/Chat/Chat/ChatCitationModal.d.ts +2 -0
- package/umd/src/book-components/Chat/Chat/ChatMessageItem.d.ts +4 -0
- package/umd/src/book-components/Chat/Chat/ChatMessageList.d.ts +4 -0
- package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +5 -0
- package/umd/src/book-components/Chat/Chat/ChatToolCallModal.d.ts +2 -0
- package/umd/src/book-components/Chat/Chat/ChatToolCallModalContent.d.ts +3 -1
- package/umd/src/book-components/Chat/Chat/CitationIframePreview.d.ts +20 -0
- package/umd/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +2 -0
- package/umd/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +1 -0
- package/umd/src/book-components/Chat/SourceChip/SourceChip.d.ts +6 -1
- package/umd/src/book-components/Chat/hooks/useResolvedCitationLabel.d.ts +12 -0
- package/umd/src/book-components/Chat/types/ChatMessage.d.ts +4 -0
- package/umd/src/book-components/Chat/types/ChatParticipant.d.ts +1 -1
- package/umd/src/book-components/Chat/types/CitationLabelResolver.d.ts +8 -0
- package/umd/src/book-components/Chat/utils/citationHelpers.d.ts +9 -0
- package/umd/src/book-components/Chat/utils/decodeJsonUnicodeEscapesInMarkdownText.d.ts +14 -0
- package/umd/src/book-components/Chat/utils/decodeJsonUnicodeEscapesInMarkdownText.test.d.ts +1 -0
- package/umd/src/book-components/Chat/utils/isVisibleChatToolCall.d.ts +10 -0
- package/umd/src/book-components/Chat/utils/parseCitationsFromContent.d.ts +4 -0
- package/umd/src/book-components/_common/Dropdown/Dropdown.d.ts +1 -1
- package/umd/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +1 -1
- package/umd/src/book-components/_common/Modal/Modal.d.ts +1 -1
- package/umd/src/book-components/icons/AboutIcon.d.ts +1 -1
- package/umd/src/book-components/icons/DownloadIcon.d.ts +1 -1
- package/umd/src/book-components/icons/ExitFullscreenIcon.d.ts +1 -1
- package/umd/src/book-components/icons/FullscreenIcon.d.ts +1 -1
- package/umd/src/cli/cli-commands/agent/agentCliOptions.d.ts +38 -0
- package/umd/src/cli/cli-commands/agent/chat.d.ts +10 -0
- package/umd/src/cli/cli-commands/agent/exec.d.ts +10 -0
- package/umd/src/cli/cli-commands/agent/run.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/agent-folder/agentProjectPaths.d.ts +2 -24
- package/umd/src/cli/cli-commands/agent.d.ts +14 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +23 -1
- package/umd/src/cli/cli-commands/agents-server/run.d.ts +6 -0
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +9 -2
- package/umd/src/cli/cli-commands/coder/ThinkingLevel.d.ts +1 -1
- package/umd/src/cli/cli-commands/coder/ensureCoderDeveloperAgentFile.d.ts +25 -0
- package/umd/src/cli/cli-commands/coder/find-unwritten.d.ts +10 -0
- package/umd/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +2 -0
- package/umd/src/cli/cli-commands/coder/server.d.ts +13 -0
- package/umd/src/cli/cli-commands/coder/waitOptions.d.ts +14 -0
- package/umd/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +9 -25
- package/umd/src/collection/agent-collection/CreateAgentInput.d.ts +2 -1
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +22 -0
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.d.ts +21 -1
- package/umd/src/commitments/META_VISIBILITY/META_VISIBILITY.d.ts +27 -0
- package/umd/src/commitments/_common/teamInternalAgentAccess.d.ts +9 -1
- package/umd/src/commitments/index.d.ts +2 -1
- package/umd/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -1
- package/umd/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +1 -1
- package/umd/src/scrapers/website/utils/createShowdownConverter.d.ts +2 -2
- package/umd/src/utils/isTimingSafeEqualString.d.ts +25 -0
- package/umd/src/utils/validators/url/isValidAgentUrl.d.ts +5 -0
- package/umd/src/version.d.ts +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { InitializationStatus } from './boilerplateTemplates';
|
|
2
|
+
/**
|
|
3
|
+
* Relative directory path for agents initialized by `ptbk coder init`.
|
|
4
|
+
*
|
|
5
|
+
* @private internal utility of `coder init` command
|
|
6
|
+
*/
|
|
7
|
+
export declare const CODER_AGENTS_DIRECTORY_PATH = "agents";
|
|
8
|
+
/**
|
|
9
|
+
* Relative file path to the default developer agent initialized by `ptbk coder init`.
|
|
10
|
+
*
|
|
11
|
+
* @private internal utility of `coder init` command
|
|
12
|
+
*/
|
|
13
|
+
export declare const CODER_DEVELOPER_AGENT_FILE_PATH = "agents/developer.book";
|
|
14
|
+
/**
|
|
15
|
+
* Source file path of the bundled developer agent inside the Promptbook repository.
|
|
16
|
+
*
|
|
17
|
+
* @private internal utility of `coder init` command
|
|
18
|
+
*/
|
|
19
|
+
export declare const DEFAULT_CODER_DEVELOPER_AGENT_SOURCE_FILE_PATH = "agents/default/developer.book";
|
|
20
|
+
/**
|
|
21
|
+
* Ensures the default developer agent exists in the initialized project.
|
|
22
|
+
*
|
|
23
|
+
* @private function of `initializeCoderProjectConfiguration`
|
|
24
|
+
*/
|
|
25
|
+
export declare function ensureCoderDeveloperAgentFile(projectPath: string): Promise<InitializationStatus>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Command as Program } from 'commander';
|
|
2
|
+
import type { $side_effect } from '../../../utils/organization/$side_effect';
|
|
3
|
+
/**
|
|
4
|
+
* Initializes `coder find-unwritten` command for Promptbook CLI utilities
|
|
5
|
+
*
|
|
6
|
+
* Note: `$` is used to indicate that this function is not a pure function - it registers a command in the CLI
|
|
7
|
+
*
|
|
8
|
+
* @private internal function of `promptbookCli`
|
|
9
|
+
*/
|
|
10
|
+
export declare function $initializeCoderFindUnwrittenCommand(program: Program): $side_effect;
|
|
@@ -9,6 +9,8 @@ export type CoderInitializationSummary = {
|
|
|
9
9
|
readonly promptsDoneDirectoryStatus: InitializationStatus;
|
|
10
10
|
readonly promptsTemplatesDirectoryStatus: InitializationStatus;
|
|
11
11
|
readonly promptTemplateFileStatuses: ReadonlyArray<EnsuredCoderPromptTemplateFile>;
|
|
12
|
+
readonly agentsDirectoryStatus: InitializationStatus;
|
|
13
|
+
readonly developerAgentFileStatus: InitializationStatus;
|
|
12
14
|
readonly agentsFileStatus: InitializationStatus;
|
|
13
15
|
readonly agentCodingFileStatus: InitializationStatus;
|
|
14
16
|
readonly envFileStatus: InitializationStatus;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command as Program } from 'commander';
|
|
2
|
+
import type { $side_effect } from '../../../utils/organization/$side_effect';
|
|
3
|
+
/**
|
|
4
|
+
* Initializes `coder server` command for Promptbook CLI utilities.
|
|
5
|
+
*
|
|
6
|
+
* Runs the same prompt processing logic as `ptbk coder run` but keeps the process alive
|
|
7
|
+
* and serves a kanban web UI on the configured port.
|
|
8
|
+
*
|
|
9
|
+
* Note: `$` is used to indicate that this function is not a pure function - it registers a command in the CLI
|
|
10
|
+
*
|
|
11
|
+
* @private internal function of `promptbookCli`
|
|
12
|
+
*/
|
|
13
|
+
export declare function $initializeCoderServerCommand(program: Program): $side_effect;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default wait duration applied before retrying a prompt round after an error (10 minutes).
|
|
3
|
+
*
|
|
4
|
+
* @private internal constant of `ptbk coder` wait handling
|
|
5
|
+
*/
|
|
6
|
+
export declare const DEFAULT_WAIT_AFTER_ERROR_MS: number;
|
|
7
|
+
/**
|
|
8
|
+
* Parses an optional Commander duration string and returns the resolved milliseconds.
|
|
9
|
+
*
|
|
10
|
+
* Returns `defaultMs` when the flag was not provided or was provided without a non-empty value.
|
|
11
|
+
*
|
|
12
|
+
* @private internal utility of `ptbk coder` wait handling
|
|
13
|
+
*/
|
|
14
|
+
export declare function parseOptionalWaitDuration(value: string | undefined, defaultMs: number): number;
|
|
@@ -1,42 +1,26 @@
|
|
|
1
1
|
import { Command as Program } from 'commander';
|
|
2
2
|
import type { ThinkingLevel } from '../coder/ThinkingLevel';
|
|
3
|
+
import { PTBK_HARNESS_ENV, PTBK_MODEL_ENV, PTBK_THINKING_LEVEL_ENV } from '../../../book-3.0/cliAgentEnv';
|
|
4
|
+
export { PTBK_HARNESS_ENV, PTBK_MODEL_ENV, PTBK_THINKING_LEVEL_ENV };
|
|
3
5
|
/**
|
|
4
6
|
* Runner identifiers supported by Promptbook CLI agent orchestration commands.
|
|
5
7
|
*
|
|
6
8
|
* @private internal utility of `promptbookCli`
|
|
7
9
|
*/
|
|
8
|
-
export declare const
|
|
9
|
-
/**
|
|
10
|
-
* Environment variable used as the default runner identifier when `--agent` is omitted.
|
|
11
|
-
*
|
|
12
|
-
* @private internal utility of `promptbookCli`
|
|
13
|
-
*/
|
|
14
|
-
export declare const PTBK_AGENT_ENV = "PTBK_AGENT";
|
|
15
|
-
/**
|
|
16
|
-
* Environment variable used as the default runner model when `--model` is omitted.
|
|
17
|
-
*
|
|
18
|
-
* @private internal utility of `promptbookCli`
|
|
19
|
-
*/
|
|
20
|
-
export declare const PTBK_MODEL_ENV = "PTBK_MODEL";
|
|
21
|
-
/**
|
|
22
|
-
* Environment variable used as the default runner thinking level when `--thinking-level` is omitted.
|
|
23
|
-
*
|
|
24
|
-
* @private internal utility of `promptbookCli`
|
|
25
|
-
*/
|
|
26
|
-
export declare const PTBK_THINKING_LEVEL_ENV = "PTBK_THINKING_LEVEL";
|
|
10
|
+
export declare const PROMPT_RUNNER_HARNESS_NAMES: readonly ["openai-codex", "github-copilot", "cline", "claude-code", "opencode", "gemini"];
|
|
27
11
|
/**
|
|
28
12
|
* Runner identifier supported by Promptbook CLI agent orchestration commands.
|
|
29
13
|
*
|
|
30
14
|
* @private internal utility of `promptbookCli`
|
|
31
15
|
*/
|
|
32
|
-
export type
|
|
16
|
+
export type PromptRunnerHarnessName = (typeof PROMPT_RUNNER_HARNESS_NAMES)[number];
|
|
33
17
|
/**
|
|
34
18
|
* Commander option bag for shared runner flags.
|
|
35
19
|
*
|
|
36
20
|
* @private internal utility of `promptbookCli`
|
|
37
21
|
*/
|
|
38
22
|
export type PromptRunnerCliOptions = {
|
|
39
|
-
readonly
|
|
23
|
+
readonly harness?: string;
|
|
40
24
|
readonly model?: string;
|
|
41
25
|
readonly ui: boolean;
|
|
42
26
|
readonly thinkingLevel?: ThinkingLevel;
|
|
@@ -52,14 +36,14 @@ export type PromptRunnerCliOptions = {
|
|
|
52
36
|
*
|
|
53
37
|
* @private internal utility of `promptbookCli`
|
|
54
38
|
*/
|
|
55
|
-
export type PromptRunnerSelectionCliOptions = Pick<PromptRunnerCliOptions, '
|
|
39
|
+
export type PromptRunnerSelectionCliOptions = Pick<PromptRunnerCliOptions, 'harness' | 'model' | 'ui' | 'thinkingLevel' | 'allowCredits'>;
|
|
56
40
|
/**
|
|
57
41
|
* Normalized runner options used by runner-backed CLI commands.
|
|
58
42
|
*
|
|
59
43
|
* @private internal utility of `promptbookCli`
|
|
60
44
|
*/
|
|
61
45
|
export type NormalizedPromptRunnerCliOptions = {
|
|
62
|
-
readonly agentName?:
|
|
46
|
+
readonly agentName?: PromptRunnerHarnessName;
|
|
63
47
|
readonly model?: string;
|
|
64
48
|
readonly noUi: boolean;
|
|
65
49
|
readonly thinkingLevel?: ThinkingLevel;
|
|
@@ -83,11 +67,11 @@ export type NormalizedPromptRunnerSelectionCliOptions = Pick<NormalizedPromptRun
|
|
|
83
67
|
*/
|
|
84
68
|
export declare const PROMPT_RUNNER_DESCRIPTION: string;
|
|
85
69
|
/**
|
|
86
|
-
* Commander description for the `--
|
|
70
|
+
* Commander description for the `--harness` option.
|
|
87
71
|
*
|
|
88
72
|
* @private internal utility of `promptbookCli`
|
|
89
73
|
*/
|
|
90
|
-
export declare const
|
|
74
|
+
export declare const PROMPT_RUNNER_HARNESS_OPTION_DESCRIPTION = "Select runner: openai-codex, github-copilot, cline, claude-code, opencode, gemini (required for non-dry-run)";
|
|
91
75
|
/**
|
|
92
76
|
* Commander description for the `--model` option.
|
|
93
77
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { string_book } from '../../book-2.0/agent-source/string_book';
|
|
2
|
+
import { type AgentVisibility } from '../../book-2.0/agent-source/agentSourceVisibility';
|
|
2
3
|
import type { LlmToolDefinition } from '../../types/LlmToolDefinition';
|
|
3
4
|
/**
|
|
4
5
|
* Supported visibility options for agent creation.
|
|
@@ -11,7 +12,7 @@ export declare const CREATE_AGENT_VISIBILITY_VALUES: readonly ["PRIVATE", "UNLIS
|
|
|
11
12
|
*
|
|
12
13
|
* @private shared create-agent contract
|
|
13
14
|
*/
|
|
14
|
-
export type CreateAgentVisibility =
|
|
15
|
+
export type CreateAgentVisibility = AgentVisibility;
|
|
15
16
|
/**
|
|
16
17
|
* Canonical input payload for creating one persisted agent entity.
|
|
17
18
|
*
|
|
@@ -60,6 +60,28 @@ export declare class AgentCollectionInSupabase {
|
|
|
60
60
|
* Gets all agents in the collection
|
|
61
61
|
*/
|
|
62
62
|
listAgents(): Promise<ReadonlyArray<AgentBasicInformation>>;
|
|
63
|
+
/**
|
|
64
|
+
* Finds one active agent profile by its human-readable name or permanent id.
|
|
65
|
+
*
|
|
66
|
+
* This keeps route-level lookups from loading the whole agent collection when only
|
|
67
|
+
* one canonical route identifier is needed.
|
|
68
|
+
*
|
|
69
|
+
* @param agentNameOrPermanentId - Agent name or stable permanent identifier.
|
|
70
|
+
* @returns Matching active agent profile or `null` when not found.
|
|
71
|
+
*
|
|
72
|
+
* @public exported from `@promptbook/core`
|
|
73
|
+
*/
|
|
74
|
+
findAgentBasicInformation(agentNameOrPermanentId: string_agent_name | string_agent_permanent_id): Promise<AgentBasicInformation | null>;
|
|
75
|
+
/**
|
|
76
|
+
* Converts one database row into public agent information.
|
|
77
|
+
*
|
|
78
|
+
* @param row - Database row carrying the persisted profile snapshot.
|
|
79
|
+
* @param isVerbose - Whether profile-name mismatches should be logged.
|
|
80
|
+
* @returns Agent profile with canonical database name and permanent id.
|
|
81
|
+
*
|
|
82
|
+
* @private internal helper of `AgentCollectionInSupabase`
|
|
83
|
+
*/
|
|
84
|
+
private mapAgentBasicInformationRow;
|
|
63
85
|
/**
|
|
64
86
|
* Retrieves the permanent ID of an agent by its name or permanent ID.
|
|
65
87
|
*/
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import type { AgentBasicInformation } from '../../../../book-2.0/agent-source/AgentBasicInformation';
|
|
2
|
+
import { type AgentVisibility } from '../../../../book-2.0/agent-source/agentSourceVisibility';
|
|
2
3
|
import type { string_book } from '../../../../book-2.0/agent-source/string_book';
|
|
3
4
|
import type { string_agent_permanent_id } from '../../../../types/string_agent_name';
|
|
5
|
+
/**
|
|
6
|
+
* Options used while preparing a source for persistence.
|
|
7
|
+
*
|
|
8
|
+
* @private shared persistence helper for `AgentCollectionInSupabase`
|
|
9
|
+
*/
|
|
10
|
+
export type PrepareAgentSourceForPersistenceOptions = {
|
|
11
|
+
/**
|
|
12
|
+
* Visibility value that should be written into the book when present.
|
|
13
|
+
*/
|
|
14
|
+
readonly visibility?: AgentVisibility | null;
|
|
15
|
+
/**
|
|
16
|
+
* Whether `visibility` should replace an existing `META VISIBILITY` commitment.
|
|
17
|
+
*/
|
|
18
|
+
readonly isVisibilityOverride?: boolean;
|
|
19
|
+
};
|
|
4
20
|
/**
|
|
5
21
|
* Prepared agent source payload ready for database persistence.
|
|
6
22
|
*
|
|
@@ -22,6 +38,10 @@ export type PreparedAgentSourceForPersistence = {
|
|
|
22
38
|
* Permanent id extracted from the original source before stripping `META ID`.
|
|
23
39
|
*/
|
|
24
40
|
readonly permanentId: string_agent_permanent_id | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Visibility parsed from the normalized source.
|
|
43
|
+
*/
|
|
44
|
+
readonly visibility: AgentVisibility | undefined;
|
|
25
45
|
};
|
|
26
46
|
/**
|
|
27
47
|
* Normalizes one agent source before persistence.
|
|
@@ -33,4 +53,4 @@ export type PreparedAgentSourceForPersistence = {
|
|
|
33
53
|
*
|
|
34
54
|
* @private shared persistence helper for `AgentCollectionInSupabase`
|
|
35
55
|
*/
|
|
36
|
-
export declare function prepareAgentSourceForPersistence(agentSource: string_book): PreparedAgentSourceForPersistence;
|
|
56
|
+
export declare function prepareAgentSourceForPersistence(agentSource: string_book, options?: PrepareAgentSourceForPersistenceOptions): PreparedAgentSourceForPersistence;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
|
+
/**
|
|
4
|
+
* META VISIBILITY commitment definition.
|
|
5
|
+
*
|
|
6
|
+
* The `META VISIBILITY` commitment stores whether an agent is public, private, or unlisted.
|
|
7
|
+
* Agents Server mirrors this value into the database for efficient filtering, but the book
|
|
8
|
+
* commitment remains the editable source of truth.
|
|
9
|
+
*
|
|
10
|
+
* @private Metadata-only commitment used by Agents Server.
|
|
11
|
+
*/
|
|
12
|
+
export declare class MetaVisibilityCommitmentDefinition extends BaseCommitmentDefinition<'META VISIBILITY'> {
|
|
13
|
+
constructor();
|
|
14
|
+
/**
|
|
15
|
+
* Short one-line description of META VISIBILITY.
|
|
16
|
+
*/
|
|
17
|
+
get description(): string;
|
|
18
|
+
/**
|
|
19
|
+
* Icon for this commitment.
|
|
20
|
+
*/
|
|
21
|
+
get icon(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Markdown documentation for META VISIBILITY commitment.
|
|
24
|
+
*/
|
|
25
|
+
get documentation(): string;
|
|
26
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
27
|
+
}
|
|
@@ -26,7 +26,15 @@ export type TeamInternalAgentAccessHeadersOptions = {
|
|
|
26
26
|
/**
|
|
27
27
|
* Resolves the internal token used by same-server TEAM calls.
|
|
28
28
|
*
|
|
29
|
-
*
|
|
29
|
+
* `PROMPTBOOK_TEAM_AGENT_ACCESS_TOKEN` must be a dedicated secret — falling
|
|
30
|
+
* back to `ADMIN_PASSWORD`, `SUPABASE_SERVICE_ROLE_KEY`, or any other shared
|
|
31
|
+
* credential would let a leak of one secret compromise both authentication
|
|
32
|
+
* boundaries (admin login and same-server teammate-agent access). When the
|
|
33
|
+
* dedicated variable is missing, this function returns `null` so the calling
|
|
34
|
+
* server fails closed — same-server TEAM access is disabled and no header is
|
|
35
|
+
* sent — instead of silently authorizing requests with the wrong secret.
|
|
36
|
+
*
|
|
37
|
+
* @returns Hashed token, or `null` when the dedicated secret is not configured.
|
|
30
38
|
*
|
|
31
39
|
* @private internal Agents Server access wiring
|
|
32
40
|
*/
|
|
@@ -25,6 +25,7 @@ import { MetaFontCommitmentDefinition } from './META_FONT/META_FONT';
|
|
|
25
25
|
import { MetaImageCommitmentDefinition } from './META_IMAGE/META_IMAGE';
|
|
26
26
|
import { MetaInputPlaceholderCommitmentDefinition } from './META_INPUT_PLACEHOLDER/META_INPUT_PLACEHOLDER';
|
|
27
27
|
import { MetaLinkCommitmentDefinition } from './META_LINK/META_LINK';
|
|
28
|
+
import { MetaVisibilityCommitmentDefinition } from './META_VISIBILITY/META_VISIBILITY';
|
|
28
29
|
import { MetaVoiceCommitmentDefinition } from './META_VOICE/META_VOICE';
|
|
29
30
|
import { ModelCommitmentDefinition } from './MODEL/MODEL';
|
|
30
31
|
import { NoteCommitmentDefinition } from './NOTE/NOTE';
|
|
@@ -61,4 +62,4 @@ import { NotYetImplementedCommitmentDefinition } from './_base/NotYetImplemented
|
|
|
61
62
|
*
|
|
62
63
|
* @private Use functions to access commitments instead of this array directly
|
|
63
64
|
*/
|
|
64
|
-
export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, MemoryCommitmentDefinition, MemoryCommitmentDefinition, StyleCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, LanguageCommitmentDefinition, LanguageCommitmentDefinition, WritingSampleCommitmentDefinition, WritingRulesCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, FormatCommitmentDefinition, TemplateCommitmentDefinition, TemplateCommitmentDefinition, FromCommitmentDefinition, ImportCommitmentDefinition, ImportCommitmentDefinition, ModelCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, ActionCommitmentDefinition, ComponentCommitmentDefinition, MetaAvatarCommitmentDefinition, MetaImageCommitmentDefinition, MetaColorCommitmentDefinition, MetaFontCommitmentDefinition, MetaLinkCommitmentDefinition, MetaDomainCommitmentDefinition, MetaDisclaimerCommitmentDefinition, MetaInputPlaceholderCommitmentDefinition, MetaCommitmentDefinition, MetaVoiceCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, InitialMessageCommitmentDefinition, UserMessageCommitmentDefinition, InternalMessageCommitmentDefinition, AgentMessageCommitmentDefinition, MessageSuffixCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, WalletCommitmentDefinition, WalletCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DictionaryCommitmentDefinition, OpenCommitmentDefinition, ClosedCommitmentDefinition, TeamCommitmentDefinition, UseBrowserCommitmentDefinition, UseDeepSearchCommitmentDefinition, UseSearchEngineCommitmentDefinition, UseSpawnCommitmentDefinition, UseTimeoutCommitmentDefinition, UseTimeCommitmentDefinition, UseUserLocationCommitmentDefinition, UseCalendarCommitmentDefinition, UseEmailCommitmentDefinition, UsePopupCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseMcpCommitmentDefinition, UsePrivacyCommitmentDefinition, UseProjectCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
|
|
65
|
+
export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, MemoryCommitmentDefinition, MemoryCommitmentDefinition, StyleCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, LanguageCommitmentDefinition, LanguageCommitmentDefinition, WritingSampleCommitmentDefinition, WritingRulesCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, FormatCommitmentDefinition, TemplateCommitmentDefinition, TemplateCommitmentDefinition, FromCommitmentDefinition, ImportCommitmentDefinition, ImportCommitmentDefinition, ModelCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, ActionCommitmentDefinition, ComponentCommitmentDefinition, MetaAvatarCommitmentDefinition, MetaImageCommitmentDefinition, MetaColorCommitmentDefinition, MetaFontCommitmentDefinition, MetaLinkCommitmentDefinition, MetaDomainCommitmentDefinition, MetaDisclaimerCommitmentDefinition, MetaInputPlaceholderCommitmentDefinition, MetaVisibilityCommitmentDefinition, MetaCommitmentDefinition, MetaVoiceCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, InitialMessageCommitmentDefinition, UserMessageCommitmentDefinition, InternalMessageCommitmentDefinition, AgentMessageCommitmentDefinition, MessageSuffixCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, WalletCommitmentDefinition, WalletCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DictionaryCommitmentDefinition, OpenCommitmentDefinition, ClosedCommitmentDefinition, TeamCommitmentDefinition, UseBrowserCommitmentDefinition, UseDeepSearchCommitmentDefinition, UseSearchEngineCommitmentDefinition, UseSpawnCommitmentDefinition, UseTimeoutCommitmentDefinition, UseTimeCommitmentDefinition, UseUserLocationCommitmentDefinition, UseCalendarCommitmentDefinition, UseEmailCommitmentDefinition, UsePopupCommitmentDefinition, UseImageGeneratorCommitmentDefinition, UseMcpCommitmentDefinition, UsePrivacyCommitmentDefinition, UseProjectCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
|
|
@@ -6,7 +6,7 @@ import type { LlmToolsConfiguration } from './LlmToolsConfiguration';
|
|
|
6
6
|
*
|
|
7
7
|
* It looks for environment variables:
|
|
8
8
|
* - `process.env.OPENAI_API_KEY`
|
|
9
|
-
* - `process.env.ANTHROPIC_CLAUDE_API_KEY`
|
|
9
|
+
* - `process.env.ANTHROPIC_API_KEY` (or the deprecated `process.env.ANTHROPIC_CLAUDE_API_KEY`)
|
|
10
10
|
* - ...
|
|
11
11
|
*
|
|
12
12
|
* @see Environment variables documentation or .env file for required variables.
|
|
@@ -13,7 +13,7 @@ import type { CreateLlmToolsFromConfigurationOptions } from './createLlmToolsFro
|
|
|
13
13
|
*
|
|
14
14
|
* It looks for environment variables:
|
|
15
15
|
* - `process.env.OPENAI_API_KEY`
|
|
16
|
-
* - `process.env.ANTHROPIC_CLAUDE_API_KEY`
|
|
16
|
+
* - `process.env.ANTHROPIC_API_KEY` (or the deprecated `process.env.ANTHROPIC_CLAUDE_API_KEY`)
|
|
17
17
|
* - ...
|
|
18
18
|
*
|
|
19
19
|
* @param options Configuration options for the LLM tools
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import showdown from 'showdown';
|
|
2
2
|
/**
|
|
3
3
|
* Create a new showdown converter instance
|
|
4
4
|
*
|
|
5
5
|
* @private utility of `WebsiteScraper`
|
|
6
6
|
*/
|
|
7
|
-
export declare function createShowdownConverter():
|
|
7
|
+
export declare function createShowdownConverter(): showdown.Converter;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compares two strings in constant time to prevent timing attacks.
|
|
3
|
+
*
|
|
4
|
+
* Plain JavaScript `===` / `!==` string comparisons short-circuit on the first
|
|
5
|
+
* byte that differs, which lets a remote attacker who can measure response
|
|
6
|
+
* timing recover the expected value one byte at a time. This helper performs
|
|
7
|
+
* the comparison through Node's `timingSafeEqual`, which always inspects every
|
|
8
|
+
* byte of the equal-length buffers.
|
|
9
|
+
*
|
|
10
|
+
* Returning `false` early when the byte lengths differ does not expose
|
|
11
|
+
* character content — only length — which is an acceptable trade-off, since
|
|
12
|
+
* `timingSafeEqual` requires equal-length buffers and length is typically not
|
|
13
|
+
* secret.
|
|
14
|
+
*
|
|
15
|
+
* `null` and `undefined` inputs are treated as non-matching so callers can
|
|
16
|
+
* forward raw request values (for example `request.headers.get(name)`) without
|
|
17
|
+
* an extra guard.
|
|
18
|
+
*
|
|
19
|
+
* @param candidate - Value supplied by the caller (for example a request header or cookie).
|
|
20
|
+
* @param expected - Value to compare against (for example a configured secret).
|
|
21
|
+
* @returns `true` when both values are strings of equal length with identical bytes.
|
|
22
|
+
*
|
|
23
|
+
* @private internal helper function
|
|
24
|
+
*/
|
|
25
|
+
export declare function isTimingSafeEqualString(candidate: string | null | undefined, expected: string | null | undefined): boolean;
|
|
@@ -8,6 +8,11 @@ import type { really_unknown } from '../../organization/really_unknown';
|
|
|
8
8
|
* - `isValidAgentUrl` *(this one)* which tests just agent URL
|
|
9
9
|
* - `isValidPipelineUrl` which tests just pipeline URL
|
|
10
10
|
*
|
|
11
|
+
* Note: This is a pure structural validator and does not block private/internal network
|
|
12
|
+
* addresses. Callers that fetch the URL server-side from an untrusted network context must
|
|
13
|
+
* additionally apply the `assertSafeUrl` SSRF guard from the Agents Server before any
|
|
14
|
+
* outbound request.
|
|
15
|
+
*
|
|
11
16
|
* @public exported from `@promptbook/utils`
|
|
12
17
|
*/
|
|
13
18
|
export declare function isValidAgentUrl(url: really_unknown): url is string_agent_url;
|
package/esm/src/version.d.ts
CHANGED
|
@@ -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
|
|
18
|
+
* It follows semantic versioning (e.g., `0.112.0`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/website-crawler",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.113.0-0",
|
|
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,
|
|
@@ -99,11 +99,10 @@
|
|
|
99
99
|
"types": "./esm/src/_packages/website-crawler.index.d.ts",
|
|
100
100
|
"typings": "./esm/src/_packages/website-crawler.index.d.ts",
|
|
101
101
|
"peerDependencies": {
|
|
102
|
-
"@promptbook/core": "0.
|
|
102
|
+
"@promptbook/core": "0.113.0-0"
|
|
103
103
|
},
|
|
104
104
|
"dependencies": {
|
|
105
105
|
"@mozilla/readability": "0.6.0",
|
|
106
|
-
"crypto": "1.0.1",
|
|
107
106
|
"crypto-js": "4.2.0",
|
|
108
107
|
"jsdom": "25.0.1",
|
|
109
108
|
"papaparse": "5.4.1",
|
package/umd/index.umd.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('spacetrim'), require('@mozilla/readability'), require('jsdom'), require('crypto'), require('rxjs'), require('waitasecond'), require('crypto-js/enc-hex'), require('crypto-js/sha256'), require('path'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'spacetrim', '@mozilla/readability', 'jsdom', 'crypto', 'rxjs', 'waitasecond', 'crypto-js/enc-hex', 'crypto-js/sha256', 'path', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-website-crawler"] = {}, global.spacetrim, global.readability, global.jsdom, global.
|
|
5
|
-
})(this, (function (exports, spacetrim, readability, jsdom,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('spacetrim'), require('@mozilla/readability'), require('jsdom'), require('crypto-js'), require('rxjs'), require('waitasecond'), require('crypto-js/enc-hex'), require('crypto-js/sha256'), require('path'), require('mime-types'), require('papaparse'), require('fs/promises'), require('showdown')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'spacetrim', '@mozilla/readability', 'jsdom', 'crypto-js', 'rxjs', 'waitasecond', 'crypto-js/enc-hex', 'crypto-js/sha256', 'path', 'mime-types', 'papaparse', 'fs/promises', 'showdown'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-website-crawler"] = {}, global.spacetrim, global.readability, global.jsdom, global.CryptoJS, global.rxjs, global.waitasecond, global.hexEncoder, global.sha256, global.path, global.mimeTypes, global.papaparse, global.promises, global.showdown));
|
|
5
|
+
})(this, (function (exports, spacetrim, readability, jsdom, CryptoJS, rxjs, waitasecond, hexEncoder, sha256, path, mimeTypes, papaparse, promises, showdown) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
9
|
+
var CryptoJS__default = /*#__PURE__*/_interopDefaultLegacy(CryptoJS);
|
|
9
10
|
var hexEncoder__default = /*#__PURE__*/_interopDefaultLegacy(hexEncoder);
|
|
10
11
|
var sha256__default = /*#__PURE__*/_interopDefaultLegacy(sha256);
|
|
12
|
+
var papaparse__default = /*#__PURE__*/_interopDefaultLegacy(papaparse);
|
|
13
|
+
var showdown__default = /*#__PURE__*/_interopDefaultLegacy(showdown);
|
|
11
14
|
|
|
12
15
|
// ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten
|
|
13
16
|
/**
|
|
@@ -23,7 +26,7 @@
|
|
|
23
26
|
* @generated
|
|
24
27
|
* @see https://github.com/webgptorg/promptbook
|
|
25
28
|
*/
|
|
26
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.
|
|
29
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.113.0-0';
|
|
27
30
|
/**
|
|
28
31
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
29
32
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -3335,7 +3338,7 @@
|
|
|
3335
3338
|
* @private internal helper function
|
|
3336
3339
|
*/
|
|
3337
3340
|
function $randomToken(randomness) {
|
|
3338
|
-
return
|
|
3341
|
+
return CryptoJS__default["default"].lib.WordArray.random(randomness).toString(CryptoJS__default["default"].enc.Hex);
|
|
3339
3342
|
}
|
|
3340
3343
|
// TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
|
|
3341
3344
|
// TODO: Maybe use nanoid instead https://github.com/ai/nanoid
|
|
@@ -5100,7 +5103,7 @@
|
|
|
5100
5103
|
* @public exported from `@promptbook/editable`
|
|
5101
5104
|
*/
|
|
5102
5105
|
function knowledgeSourceContentToName(knowledgeSourceContent) {
|
|
5103
|
-
const hash =
|
|
5106
|
+
const hash = CryptoJS__default["default"].SHA256(hexEncoder__default["default"].parse(JSON.stringify(knowledgeSourceContent)))
|
|
5104
5107
|
// <- TODO: [🥬] Encapsulate sha256 to some private utility function
|
|
5105
5108
|
.toString( /* hex */)
|
|
5106
5109
|
.substring(0, 20);
|
|
@@ -6094,7 +6097,7 @@
|
|
|
6094
6097
|
console.warn('CSV string contains carriage return characters, but in the CSV settings the `newline` setting does not include them. Autohealing the CSV string.');
|
|
6095
6098
|
value = value.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
|
|
6096
6099
|
}
|
|
6097
|
-
const csv =
|
|
6100
|
+
const csv = papaparse__default["default"].parse(value, settings);
|
|
6098
6101
|
return csv;
|
|
6099
6102
|
}
|
|
6100
6103
|
|
|
@@ -6179,10 +6182,10 @@
|
|
|
6179
6182
|
i > index ? { ...row, [outputParameterName]: PENDING_VALUE_PLACEHOLDER } : row,
|
|
6180
6183
|
);
|
|
6181
6184
|
*/
|
|
6182
|
-
await onProgress(
|
|
6185
|
+
await onProgress(papaparse__default["default"].unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS }));
|
|
6183
6186
|
}
|
|
6184
6187
|
}
|
|
6185
|
-
return
|
|
6188
|
+
return papaparse__default["default"].unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS });
|
|
6186
6189
|
},
|
|
6187
6190
|
},
|
|
6188
6191
|
{
|
|
@@ -6210,7 +6213,7 @@
|
|
|
6210
6213
|
return /* not await */ mapCallback({ [key]: value }, index, array.length);
|
|
6211
6214
|
}));
|
|
6212
6215
|
}));
|
|
6213
|
-
return
|
|
6216
|
+
return papaparse__default["default"].unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS });
|
|
6214
6217
|
},
|
|
6215
6218
|
},
|
|
6216
6219
|
],
|
|
@@ -8408,7 +8411,7 @@
|
|
|
8408
8411
|
const { filename: sourceFilename, url } = source;
|
|
8409
8412
|
const { rootDirname, cacheDirname, intermediateFilesStrategy, extension, isVerbose } = options;
|
|
8410
8413
|
// TODO: [👬] DRY
|
|
8411
|
-
const hash =
|
|
8414
|
+
const hash = CryptoJS__default["default"].SHA256(
|
|
8412
8415
|
// <- TODO: [🥬] Encapsulate sha256 to some private utility function
|
|
8413
8416
|
hexEncoder__default["default"].parse(sourceFilename || url || 'untitled'))
|
|
8414
8417
|
.toString( /* hex */)
|
|
@@ -8472,7 +8475,7 @@
|
|
|
8472
8475
|
* @private utility of `WebsiteScraper`
|
|
8473
8476
|
*/
|
|
8474
8477
|
function createShowdownConverter() {
|
|
8475
|
-
return new
|
|
8478
|
+
return new showdown__default["default"].Converter({
|
|
8476
8479
|
flavor: 'github',
|
|
8477
8480
|
/*
|
|
8478
8481
|
> import showdownHighlight from 'showdown-highlight';
|