@promptbook/remote-client 0.114.0-1 → 0.114.0-3
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 +16 -15
- package/esm/index.es.js +35 -2
- package/esm/index.es.js.map +1 -1
- package/esm/src/book-2.0/book-language-documentation/BookLanguageManualDictionary.d.ts +1 -15
- package/esm/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.d.ts +1 -1
- package/esm/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.d.ts +0 -4
- package/esm/src/book-components/Chat/utils/$provideServerDomWindow.d.ts +11 -0
- package/esm/src/book-components/Chat/utils/renderMarkdown.d.ts +7 -0
- package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerRuntimeEnvironment.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/agentCodingFile.d.ts +2 -3
- package/esm/src/cli/cli-commands/coder/ping.d.ts +10 -0
- package/esm/src/cli/cli-commands/coder/ping.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/coderGitSyncCliOptions.d.ts +34 -0
- package/esm/src/cli/cli-commands/common/coderGitSyncCliOptions.test.d.ts +1 -0
- package/esm/src/cli/common/loadPromptsModule.d.ts +16 -0
- package/esm/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +1 -1
- package/esm/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiAssistantExecutionToolsStreamRunner.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiAssistantExecutionToolsToolRunner.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiCompatibleNonChatPromptCaller.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiCompatibleRequestManager.d.ts +1 -1
- package/esm/src/llm-providers/openai/utils/callOpenAiCompatibleChatModel.d.ts +1 -1
- package/esm/src/llm-providers/openai/utils/loadOpenAiAgentsModule.d.ts +203 -0
- package/esm/src/llm-providers/openai/utils/uploadFilesToOpenAi.d.ts +1 -1
- package/esm/src/utils/misc/createLazyModuleLoader.d.ts +14 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +6 -2
- package/umd/index.umd.js +40 -6
- package/umd/index.umd.js.map +1 -1
- package/umd/src/book-2.0/book-language-documentation/BookLanguageManualDictionary.d.ts +1 -15
- package/umd/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.d.ts +1 -1
- package/umd/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.d.ts +0 -4
- package/umd/src/book-components/Chat/utils/$provideServerDomWindow.d.ts +11 -0
- package/umd/src/book-components/Chat/utils/renderMarkdown.d.ts +7 -0
- package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerRuntimeEnvironment.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/agentCodingFile.d.ts +2 -3
- package/umd/src/cli/cli-commands/coder/ping.d.ts +10 -0
- package/umd/src/cli/cli-commands/coder/ping.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/coderGitSyncCliOptions.d.ts +34 -0
- package/umd/src/cli/cli-commands/common/coderGitSyncCliOptions.test.d.ts +1 -0
- package/umd/src/cli/common/loadPromptsModule.d.ts +16 -0
- package/umd/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +1 -1
- package/umd/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiAssistantExecutionToolsStreamRunner.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiAssistantExecutionToolsToolRunner.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiCompatibleNonChatPromptCaller.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiCompatibleRequestManager.d.ts +1 -1
- package/umd/src/llm-providers/openai/utils/callOpenAiCompatibleChatModel.d.ts +1 -1
- package/umd/src/llm-providers/openai/utils/loadOpenAiAgentsModule.d.ts +203 -0
- package/umd/src/llm-providers/openai/utils/uploadFilesToOpenAi.d.ts +1 -1
- package/umd/src/utils/misc/createLazyModuleLoader.d.ts +14 -0
- package/umd/src/version.d.ts +1 -1
package/README.md
CHANGED
|
@@ -504,26 +504,27 @@ ptbk coder verify
|
|
|
504
504
|
| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------ | ---- | ----- | ------------------------------------------------------------------------ |
|
|
505
505
|
| `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/`. |
|
|
506
506
|
| `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. |
|
|
507
|
-
| `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 run` | Picks the next ready prompt, can run tests before coding to stop or repair pre-existing failures, 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. |
|
|
508
508
|
| `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. |
|
|
509
509
|
| `ptbk coder verify` | Walks through completed prompts, archives truly finished work, and adds follow-up repair prompts for unfinished results. |
|
|
510
510
|
|
|
511
511
|
#### Most useful `ptbk coder run` flags
|
|
512
512
|
|
|
513
|
-
| Flag | Purpose
|
|
514
|
-
| -------------------------- |
|
|
515
|
-
| `--harness <name>` | Selects the coding harness.
|
|
516
|
-
| `--model <model>` | Chooses the runner model; required for `openai-codex` and `gemini`, optional for `github-copilot`.
|
|
517
|
-
| `--context <text-or-file>` | Appends extra instructions inline or from a file like `AGENTS.md`.
|
|
518
|
-
| `--test <command>` | Runs a verification command after each prompt attempt and feeds failing output back for retries.
|
|
519
|
-
| `--
|
|
520
|
-
| `--
|
|
521
|
-
| `--
|
|
522
|
-
| `--
|
|
523
|
-
| `--
|
|
524
|
-
| `--
|
|
525
|
-
| `--
|
|
526
|
-
| `--auto-
|
|
513
|
+
| Flag | Purpose |
|
|
514
|
+
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
515
|
+
| `--harness <name>` | Selects the coding harness. |
|
|
516
|
+
| `--model <model>` | Chooses the runner model; required for `openai-codex` and `gemini`, optional for `github-copilot`. |
|
|
517
|
+
| `--context <text-or-file>` | Appends extra instructions inline or from a file like `AGENTS.md`. |
|
|
518
|
+
| `--test <command>` | Runs a verification command after each prompt attempt and feeds failing output back for retries. |
|
|
519
|
+
| `--test-before <mode>` | Runs tests before coding: `no` (default), `yes-and-fail` (stop with results), or `yes-and-fix` (create one repair prompt first); defaults to `npm test` when enabled without `--test`. |
|
|
520
|
+
| `--thinking-level <level>` | Sets reasoning effort for supported runners. |
|
|
521
|
+
| `--no-auto` | Waits for user confirmation before each prompt instead of running automatically through the queue. |
|
|
522
|
+
| `--ignore-git-changes` | Disables the clean-working-tree guard. |
|
|
523
|
+
| `--priority <n>` | Runs only prompts at or above the given priority. |
|
|
524
|
+
| `--dry-run` | Prints which prompts are ready instead of executing them. |
|
|
525
|
+
| `--allow-credits` | Lets OpenAI Codex spend credits when required. |
|
|
526
|
+
| `--auto-push` | Pushes each successful coding-agent commit to the configured remote. |
|
|
527
|
+
| `--auto-migrate` | Runs testing-server database migrations after each successful prompt. |
|
|
527
528
|
|
|
528
529
|
#### Typical usage pattern
|
|
529
530
|
|
package/esm/index.es.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { spaceTrim as spaceTrim$1 } from 'spacetrim';
|
|
2
2
|
import CryptoJS from 'crypto-js';
|
|
3
|
-
import { io } from 'socket.io-client';
|
|
4
3
|
import papaparse from 'papaparse';
|
|
5
4
|
import hexEncoder from 'crypto-js/enc-hex';
|
|
6
5
|
import { basename } from 'path';
|
|
@@ -19,7 +18,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
19
18
|
* @generated
|
|
20
19
|
* @see https://github.com/webgptorg/promptbook
|
|
21
20
|
*/
|
|
22
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-
|
|
21
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-3';
|
|
23
22
|
/**
|
|
24
23
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
25
24
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -1654,6 +1653,31 @@ function deserializeError(error, isStackAddedToMessage = true) {
|
|
|
1654
1653
|
return deserializedError;
|
|
1655
1654
|
}
|
|
1656
1655
|
|
|
1656
|
+
/**
|
|
1657
|
+
* Creates a loader which imports one module on the first call and reuses the very same module afterwards
|
|
1658
|
+
*
|
|
1659
|
+
* Note: [🐌] Heavy third-party dependencies are imported lazily to keep the startup of the Promptbook CLI fast.
|
|
1660
|
+
* A statically imported dependency is loaded every single time the bundle is loaded, even when the running
|
|
1661
|
+
* command never touches it. A lazily imported dependency is loaded only when the feature is really used.
|
|
1662
|
+
*
|
|
1663
|
+
* @example
|
|
1664
|
+
* const loadJsdomModule = createLazyModuleLoader(() => import('jsdom'));
|
|
1665
|
+
* const { JSDOM } = await loadJsdomModule();
|
|
1666
|
+
*
|
|
1667
|
+
* @private internal utility of Promptbook
|
|
1668
|
+
*/
|
|
1669
|
+
function createLazyModuleLoader(importModule) {
|
|
1670
|
+
let importedModulePromise = null;
|
|
1671
|
+
return function loadModule() {
|
|
1672
|
+
if (importedModulePromise === null) {
|
|
1673
|
+
importedModulePromise = importModule();
|
|
1674
|
+
}
|
|
1675
|
+
return importedModulePromise;
|
|
1676
|
+
};
|
|
1677
|
+
}
|
|
1678
|
+
// Note: [🐌] Do not convert the lazy `import(...)` calls back to static `import` statements, it would bring back the
|
|
1679
|
+
// slow startup of the `ptbk` CLI utility
|
|
1680
|
+
|
|
1657
1681
|
/**
|
|
1658
1682
|
* Tests if given string is valid URL.
|
|
1659
1683
|
*
|
|
@@ -1685,6 +1709,14 @@ function isValidUrl(url) {
|
|
|
1685
1709
|
}
|
|
1686
1710
|
}
|
|
1687
1711
|
|
|
1712
|
+
/**
|
|
1713
|
+
* Loads the Socket.io client (`socket.io-client`) on demand
|
|
1714
|
+
*
|
|
1715
|
+
* Note: [🐌] Loaded lazily to keep the startup of the `ptbk` CLI utility fast
|
|
1716
|
+
*
|
|
1717
|
+
* @private internal utility of `createRemoteClient`
|
|
1718
|
+
*/
|
|
1719
|
+
const loadSocketIoClientModule = createLazyModuleLoader(() => import('socket.io-client'));
|
|
1688
1720
|
/**
|
|
1689
1721
|
* Creates a connection to the remote proxy server.
|
|
1690
1722
|
*
|
|
@@ -1713,6 +1745,7 @@ async function createRemoteClient(options) {
|
|
|
1713
1745
|
|
|
1714
1746
|
`));
|
|
1715
1747
|
}
|
|
1748
|
+
const { io } = await loadSocketIoClientModule();
|
|
1716
1749
|
return new Promise((resolve, reject) => {
|
|
1717
1750
|
const socket = io(remoteServerUrl, {
|
|
1718
1751
|
retries: CONNECTION_RETRIES_LIMIT,
|