@promptbook/website-crawler 0.112.0-98 → 0.112.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 +37 -21
- 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 +0 -2
- package/esm/src/_packages/node.index.d.ts +40 -0
- package/esm/src/_packages/types.index.d.ts +18 -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-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 +1 -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 +17 -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/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +22 -0
- package/esm/src/commitments/_common/teamInternalAgentAccess.d.ts +9 -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 +0 -2
- package/umd/src/_packages/node.index.d.ts +40 -0
- package/umd/src/_packages/types.index.d.ts +18 -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-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 +1 -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 +17 -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/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +22 -0
- package/umd/src/commitments/_common/teamInternalAgentAccess.d.ts +9 -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
package/README.md
CHANGED
|
@@ -27,11 +27,27 @@ Create persistent AI agents that turn your company's scattered knowledge into ac
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
+
### Standalone VPS
|
|
31
|
+
|
|
32
|
+
Run the standalone VPS installer only on a fresh server. Interactive mode asks for the installation values:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
sudo curl -fsSL https://raw.githubusercontent.com/webgptorg/promptbook/refs/heads/main/other/vps/install.sh | bash
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Non-interactive mode takes defaults from command-line options. When `--openai-api-key` is provided with the default OpenAI Codex runner, the installer installs and configures Codex automatically; other runner authentication can be configured later from the UI or SSH:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
sudo curl -fsSL https://raw.githubusercontent.com/webgptorg/promptbook/refs/heads/main/other/vps/install.sh | bash -s -- \
|
|
42
|
+
--non-interactive \
|
|
43
|
+
--yes-i-understand-that-script-should-be-run-on-fresh-server \
|
|
44
|
+
--domain s24.ptbk.io \
|
|
45
|
+
--openai-api-key sk-proj-abcdef \
|
|
46
|
+
--sentry-dsn https://abc@def.ingest.de.sentry.io/123 \
|
|
47
|
+
--admin-password xxx
|
|
48
|
+
```
|
|
30
49
|
|
|
31
50
|
|
|
32
|
-
<blockquote style="color: #ff8811">
|
|
33
|
-
<b>⚠ Warning:</b> This is a pre-release version of the library. It is not yet ready for production use. Please look at <a href="https://www.npmjs.com/package/@promptbook/core?activeTab=versions">latest stable release</a>.
|
|
34
|
-
</blockquote>
|
|
35
51
|
|
|
36
52
|
## 📦 Package `@promptbook/website-crawler`
|
|
37
53
|
|
|
@@ -420,9 +436,9 @@ Prompts marked with `[-]` are not ready yet, prompts containing `@@@` are treate
|
|
|
420
436
|
#### Features
|
|
421
437
|
|
|
422
438
|
- **Multi-runner execution:** `openai-codex`, `github-copilot`, `cline`, `claude-code`, `opencode`, `gemini`
|
|
423
|
-
- **Context injection:** `--context AGENTS.md` or inline extra instructions
|
|
439
|
+
- **Context injection:** `--agent agents/coding/developer.book --context AGENTS.md` or inline extra instructions
|
|
424
440
|
- **Reasoning control:** `--thinking-level low|medium|high|xhigh` for supported runners
|
|
425
|
-
- **
|
|
441
|
+
- **Unattended or interactive runs:** default auto mode, or `--no-auto` to wait for user confirmation before each prompt
|
|
426
442
|
- **Git safety:** clean working tree check by default, optional `--ignore-git-changes`
|
|
427
443
|
- **Opt-in remote pushes:** commits stay local unless you explicitly pass `--auto-push`
|
|
428
444
|
- **Prompt triage:** `--priority` to process only more important tasks first
|
|
@@ -440,11 +456,11 @@ npx ts-node ./src/cli/test/ptbk.ts coder generate-boilerplates --template prompt
|
|
|
440
456
|
|
|
441
457
|
npx ts-node ./src/cli/test/ptbk.ts coder generate-boilerplates --template prompts/templates/agents-server.md
|
|
442
458
|
|
|
443
|
-
npx ts-node ./src/cli/test/ptbk.ts coder run --
|
|
459
|
+
npx ts-node ./src/cli/test/ptbk.ts coder run --harness github-copilot --model gpt-5.4 --thinking-level xhigh --agent agents/coding/developer.book --context AGENTS.md
|
|
444
460
|
|
|
445
|
-
npx ts-node ./src/cli/test/ptbk.ts coder run --
|
|
461
|
+
npx ts-node ./src/cli/test/ptbk.ts coder run --harness github-copilot --model gpt-5.4 --thinking-level xhigh --agent agents/coding/developer.book --context AGENTS.md --auto-push
|
|
446
462
|
|
|
447
|
-
npx ts-node ./src/cli/test/ptbk.ts coder run --
|
|
463
|
+
npx ts-node ./src/cli/test/ptbk.ts coder run --harness github-copilot --model gpt-5.4 --thinking-level xhigh --agent agents/coding/developer.book --context AGENTS.md --ignore-git-changes
|
|
448
464
|
|
|
449
465
|
npx ts-node ./src/cli/test/ptbk.ts coder find-refactor-candidates
|
|
450
466
|
|
|
@@ -466,11 +482,11 @@ ptbk coder generate-boilerplates
|
|
|
466
482
|
|
|
467
483
|
ptbk coder generate-boilerplates --template prompts/templates/common.md
|
|
468
484
|
|
|
469
|
-
ptbk coder run --
|
|
485
|
+
ptbk coder run --harness github-copilot --model gpt-5.4 --thinking-level xhigh --agent agents/coding/developer.book --context AGENTS.md --test npm run test
|
|
470
486
|
|
|
471
|
-
ptbk coder run --
|
|
487
|
+
ptbk coder run --harness github-copilot --model gpt-5.4 --thinking-level xhigh --agent agents/coding/developer.book --context AGENTS.md --auto-push
|
|
472
488
|
|
|
473
|
-
ptbk coder run --
|
|
489
|
+
ptbk coder run --harness github-copilot --model gpt-5.4 --thinking-level xhigh --agent agents/coding/developer.book --context AGENTS.md --test npm run test --ignore-git-changes
|
|
474
490
|
|
|
475
491
|
ptbk coder find-refactor-candidates
|
|
476
492
|
|
|
@@ -483,24 +499,24 @@ ptbk coder verify
|
|
|
483
499
|
|
|
484
500
|
#### What each command does
|
|
485
501
|
|
|
486
|
-
| Command | What it does
|
|
487
|
-
| ------------------------------------- |
|
|
502
|
+
| Command | What it does |
|
|
503
|
+
| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------ | ---- | ----- | ------------------------------------------------------------------------ |
|
|
488
504
|
| `ptbk coder init` | Creates `prompts/`, `prompts/done/`, the project-generic template files materialized in `prompts/templates/` (currently `common.md`), and a starter `AGENTS.md`; ensures `.env` contains `CODING_AGENT_GIT_NAME`, `CODING_AGENT_GIT_EMAIL`, and `CODING_AGENT_GIT_SIGNING_KEY`; adds helper coder scripts to `package.json`; ensures `.gitignore` contains `/.promptbook`; and configures `.vscode/settings.json` to save pasted prompt images into `prompts/screenshots/`. |
|
|
489
|
-
| `ptbk coder generate-boilerplates` | Creates new prompt markdown files with fresh emoji tags so you can quickly fill in coding tasks; `--template` accepts either a built-in alias or a markdown file path relative to the project root.
|
|
490
|
-
| `ptbk coder run` | Picks the next ready prompt, appends optional context, runs it through the selected coding agent, can optionally verify each attempt with a shell test command and feed failing output back for retries, then marks success or failure, commits the result, and pushes only when `--auto-push` is enabled.
|
|
491
|
-
| `ptbk coder find-refactor-candidates` | Scans the repository for oversized or overpacked files and writes prompt files for likely refactors; `--level <xlow
|
|
492
|
-
| `ptbk coder verify` | Walks through completed prompts, archives truly finished work, and adds follow-up repair prompts for unfinished results.
|
|
505
|
+
| `ptbk coder generate-boilerplates` | Creates new prompt markdown files with fresh emoji tags so you can quickly fill in coding tasks; `--template` accepts either a built-in alias or a markdown file path relative to the project root. |
|
|
506
|
+
| `ptbk coder run` | Picks the next ready prompt, appends optional context, runs it through the selected coding agent, can optionally verify each attempt with a shell test command and feed failing output back for retries, then marks success or failure, commits the result, and pushes only when `--auto-push` is enabled. |
|
|
507
|
+
| `ptbk coder find-refactor-candidates` | Scans the repository for oversized or overpacked files and writes prompt files for likely refactors; `--level <xlow | low | medium | high | xhigh | extreme>` ranges from a very benevolent scan to a very aggressive sweep. |
|
|
508
|
+
| `ptbk coder verify` | Walks through completed prompts, archives truly finished work, and adds follow-up repair prompts for unfinished results. |
|
|
493
509
|
|
|
494
510
|
#### Most useful `ptbk coder run` flags
|
|
495
511
|
|
|
496
512
|
| Flag | Purpose |
|
|
497
513
|
| -------------------------- | -------------------------------------------------------------------------------------------------- |
|
|
498
|
-
| `--
|
|
514
|
+
| `--harness <name>` | Selects the coding harness. |
|
|
499
515
|
| `--model <model>` | Chooses the runner model; required for `openai-codex` and `gemini`, optional for `github-copilot`. |
|
|
500
516
|
| `--context <text-or-file>` | Appends extra instructions inline or from a file like `AGENTS.md`. |
|
|
501
517
|
| `--test <command>` | Runs a verification command after each prompt attempt and feeds failing output back for retries. |
|
|
502
518
|
| `--thinking-level <level>` | Sets reasoning effort for supported runners. |
|
|
503
|
-
| `--no-
|
|
519
|
+
| `--no-auto` | Waits for user confirmation before each prompt instead of running automatically through the queue. |
|
|
504
520
|
| `--ignore-git-changes` | Disables the clean-working-tree guard. |
|
|
505
521
|
| `--priority <n>` | Runs only prompts at or above the given priority. |
|
|
506
522
|
| `--dry-run` | Prints which prompts are ready instead of executing them. |
|
|
@@ -512,8 +528,8 @@ ptbk coder verify
|
|
|
512
528
|
|
|
513
529
|
1. Initialize once with `ptbk coder init`.
|
|
514
530
|
2. Customize `prompts/templates/*.md` if needed, then create or write prompt files in `prompts/`.
|
|
515
|
-
3. Customize the starter `AGENTS.md` with repository-specific instructions, then pass `--context AGENTS.md`.
|
|
516
|
-
4. Run
|
|
531
|
+
3. Customize the starter `AGENTS.md` with repository-specific instructions, then pass `--agent agents/coding/developer.book --context AGENTS.md`.
|
|
532
|
+
4. Run unattended batches by default, or pass `--no-auto` to confirm each prompt interactively.
|
|
517
533
|
5. Finish with `ptbk coder verify` so resolved prompts are archived and broken ones get explicit repair follow-ups.
|
|
518
534
|
|
|
519
535
|
|
package/esm/index.es.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { spaceTrim as spaceTrim$1 } from 'spacetrim';
|
|
2
2
|
import { Readability } from '@mozilla/readability';
|
|
3
3
|
import { JSDOM } from 'jsdom';
|
|
4
|
-
import
|
|
4
|
+
import CryptoJS from 'crypto-js';
|
|
5
5
|
import { Subject } from 'rxjs';
|
|
6
6
|
import { forTime } from 'waitasecond';
|
|
7
7
|
import hexEncoder from 'crypto-js/enc-hex';
|
|
8
8
|
import sha256 from 'crypto-js/sha256';
|
|
9
9
|
import { basename, join, dirname, isAbsolute } from 'path';
|
|
10
|
-
import { SHA256 } from 'crypto-js';
|
|
11
10
|
import { lookup, extension } from 'mime-types';
|
|
12
|
-
import
|
|
11
|
+
import papaparse from 'papaparse';
|
|
13
12
|
import { mkdir, rm } from 'fs/promises';
|
|
14
|
-
import
|
|
13
|
+
import showdown from 'showdown';
|
|
15
14
|
|
|
16
15
|
// ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten
|
|
17
16
|
/**
|
|
@@ -27,7 +26,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
27
26
|
* @generated
|
|
28
27
|
* @see https://github.com/webgptorg/promptbook
|
|
29
28
|
*/
|
|
30
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0
|
|
29
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0';
|
|
31
30
|
/**
|
|
32
31
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
33
32
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -3339,7 +3338,7 @@ class MissingToolsError extends Error {
|
|
|
3339
3338
|
* @private internal helper function
|
|
3340
3339
|
*/
|
|
3341
3340
|
function $randomToken(randomness) {
|
|
3342
|
-
return
|
|
3341
|
+
return CryptoJS.lib.WordArray.random(randomness).toString(CryptoJS.enc.Hex);
|
|
3343
3342
|
}
|
|
3344
3343
|
// TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
|
|
3345
3344
|
// TODO: Maybe use nanoid instead https://github.com/ai/nanoid
|
|
@@ -5104,7 +5103,7 @@ function normalizeToKebabCase(text) {
|
|
|
5104
5103
|
* @public exported from `@promptbook/editable`
|
|
5105
5104
|
*/
|
|
5106
5105
|
function knowledgeSourceContentToName(knowledgeSourceContent) {
|
|
5107
|
-
const hash = SHA256(hexEncoder.parse(JSON.stringify(knowledgeSourceContent)))
|
|
5106
|
+
const hash = CryptoJS.SHA256(hexEncoder.parse(JSON.stringify(knowledgeSourceContent)))
|
|
5108
5107
|
// <- TODO: [🥬] Encapsulate sha256 to some private utility function
|
|
5109
5108
|
.toString( /* hex */)
|
|
5110
5109
|
.substring(0, 20);
|
|
@@ -6098,7 +6097,7 @@ function csvParse(value /* <- TODO: string_csv */, settings, schema /* <- TODO:
|
|
|
6098
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.');
|
|
6099
6098
|
value = value.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
|
|
6100
6099
|
}
|
|
6101
|
-
const csv = parse(value, settings);
|
|
6100
|
+
const csv = papaparse.parse(value, settings);
|
|
6102
6101
|
return csv;
|
|
6103
6102
|
}
|
|
6104
6103
|
|
|
@@ -6183,10 +6182,10 @@ const CsvFormatParser = {
|
|
|
6183
6182
|
i > index ? { ...row, [outputParameterName]: PENDING_VALUE_PLACEHOLDER } : row,
|
|
6184
6183
|
);
|
|
6185
6184
|
*/
|
|
6186
|
-
await onProgress(unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS }));
|
|
6185
|
+
await onProgress(papaparse.unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS }));
|
|
6187
6186
|
}
|
|
6188
6187
|
}
|
|
6189
|
-
return unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS });
|
|
6188
|
+
return papaparse.unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS });
|
|
6190
6189
|
},
|
|
6191
6190
|
},
|
|
6192
6191
|
{
|
|
@@ -6214,7 +6213,7 @@ const CsvFormatParser = {
|
|
|
6214
6213
|
return /* not await */ mapCallback({ [key]: value }, index, array.length);
|
|
6215
6214
|
}));
|
|
6216
6215
|
}));
|
|
6217
|
-
return unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS });
|
|
6216
|
+
return papaparse.unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS });
|
|
6218
6217
|
},
|
|
6219
6218
|
},
|
|
6220
6219
|
],
|
|
@@ -8412,7 +8411,7 @@ async function getScraperIntermediateSource(source, options) {
|
|
|
8412
8411
|
const { filename: sourceFilename, url } = source;
|
|
8413
8412
|
const { rootDirname, cacheDirname, intermediateFilesStrategy, extension, isVerbose } = options;
|
|
8414
8413
|
// TODO: [👬] DRY
|
|
8415
|
-
const hash = SHA256(
|
|
8414
|
+
const hash = CryptoJS.SHA256(
|
|
8416
8415
|
// <- TODO: [🥬] Encapsulate sha256 to some private utility function
|
|
8417
8416
|
hexEncoder.parse(sourceFilename || url || 'untitled'))
|
|
8418
8417
|
.toString( /* hex */)
|
|
@@ -8476,7 +8475,7 @@ async function getScraperIntermediateSource(source, options) {
|
|
|
8476
8475
|
* @private utility of `WebsiteScraper`
|
|
8477
8476
|
*/
|
|
8478
8477
|
function createShowdownConverter() {
|
|
8479
|
-
return new Converter({
|
|
8478
|
+
return new showdown.Converter({
|
|
8480
8479
|
flavor: 'github',
|
|
8481
8480
|
/*
|
|
8482
8481
|
> import showdownHighlight from 'showdown-highlight';
|