@promptbook/cli 0.112.0-40 → 0.112.0-42
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 +23 -21
- package/esm/apps/agents-server/src/database/acquireMigrationExecutionLock.d.ts +13 -2
- package/esm/apps/agents-server/src/database/importRuntimeModule.d.ts +8 -0
- package/esm/apps/agents-server/src/database/migratePrefix.d.ts +1 -1
- package/esm/apps/agents-server/src/database/resolveMigrationsDirectory.d.ts +2 -2
- package/esm/apps/agents-server/src/database/runDatabaseMigrations.d.ts +9 -0
- package/esm/index.es.js +5755 -3403
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/run-codex-prompts/git/commitChanges.d.ts +3 -1
- package/esm/scripts/verify-prompts/verify-prompts.d.ts +23 -2
- package/esm/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.d.ts +8 -2
- package/esm/src/book-components/Chat/Chat/ChatInputArea.d.ts +0 -10
- package/esm/src/book-components/Chat/Chat/ChatInputUploadedFile.d.ts +10 -0
- package/esm/src/book-components/Chat/Chat/ChatToolCallModalContent.d.ts +46 -0
- package/esm/src/book-components/Chat/Chat/resolveRunBrowserToolCallDetailsState.d.ts +146 -0
- package/esm/src/book-components/Chat/Chat/useChatInputAreaAttachments.d.ts +1 -1
- package/esm/src/book-components/Chat/Chat/useChatInputAreaComposer.d.ts +39 -0
- package/esm/src/book-components/Chat/Chat/useChatPostprocessedMessages.d.ts +17 -0
- package/esm/src/book-components/Chat/Chat/useChatScrollState.d.ts +34 -0
- package/esm/src/book-components/Chat/Chat/useChatToolCallModalState.d.ts +61 -0
- package/esm/src/book-components/Chat/Chat/useChatToolCallState.d.ts +35 -0
- package/esm/src/book-components/Chat/LlmChat/useLlmChatMessageHandler.d.ts +58 -0
- package/esm/src/book-components/Chat/LlmChat/useLlmChatMessages.d.ts +29 -0
- package/esm/src/book-components/Chat/LlmChat/useLlmChatState.d.ts +53 -0
- package/esm/src/cli/cli-commands/coder/verify.test.d.ts +1 -0
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +2 -14
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/createAgentPersistenceRecords.d.ts +40 -0
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/createAgentPersistenceRecords.test.d.ts +1 -0
- package/esm/src/collection/pipeline-collection/constructors/createPipelineCollectionFromDirectory.d.ts +7 -1
- package/esm/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +52 -0
- package/esm/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +128 -0
- package/esm/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +3 -3
- package/esm/src/llm-providers/openai/OpenAiVectorStoreHandler.d.ts +54 -0
- package/esm/src/llm-providers/openai/utils/OpenAiCompatibleUnsupportedParameterRetrier.d.ts +29 -0
- package/esm/src/llm-providers/openai/utils/callOpenAiCompatibleChatModel.d.ts +28 -0
- package/esm/src/types/number_usd.d.ts +1 -1
- package/esm/src/types/string_parameter_name.d.ts +2 -2
- package/esm/src/types/typeAliases.d.ts +2 -2
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/umd/apps/agents-server/src/database/acquireMigrationExecutionLock.d.ts +13 -2
- package/umd/apps/agents-server/src/database/importRuntimeModule.d.ts +8 -0
- package/umd/apps/agents-server/src/database/migratePrefix.d.ts +1 -1
- package/umd/apps/agents-server/src/database/resolveMigrationsDirectory.d.ts +2 -2
- package/umd/apps/agents-server/src/database/runDatabaseMigrations.d.ts +9 -0
- package/umd/index.umd.js +5758 -3406
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/run-codex-prompts/git/commitChanges.d.ts +3 -1
- package/umd/scripts/verify-prompts/verify-prompts.d.ts +23 -2
- package/umd/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.d.ts +8 -2
- package/umd/src/book-components/Chat/Chat/ChatInputArea.d.ts +0 -10
- package/umd/src/book-components/Chat/Chat/ChatInputUploadedFile.d.ts +10 -0
- package/umd/src/book-components/Chat/Chat/ChatToolCallModalContent.d.ts +46 -0
- package/umd/src/book-components/Chat/Chat/resolveRunBrowserToolCallDetailsState.d.ts +146 -0
- package/umd/src/book-components/Chat/Chat/useChatInputAreaAttachments.d.ts +1 -1
- package/umd/src/book-components/Chat/Chat/useChatInputAreaComposer.d.ts +39 -0
- package/umd/src/book-components/Chat/Chat/useChatPostprocessedMessages.d.ts +17 -0
- package/umd/src/book-components/Chat/Chat/useChatScrollState.d.ts +34 -0
- package/umd/src/book-components/Chat/Chat/useChatToolCallModalState.d.ts +61 -0
- package/umd/src/book-components/Chat/Chat/useChatToolCallState.d.ts +35 -0
- package/umd/src/book-components/Chat/LlmChat/useLlmChatMessageHandler.d.ts +58 -0
- package/umd/src/book-components/Chat/LlmChat/useLlmChatMessages.d.ts +29 -0
- package/umd/src/book-components/Chat/LlmChat/useLlmChatState.d.ts +53 -0
- package/umd/src/cli/cli-commands/coder/verify.test.d.ts +1 -0
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +2 -14
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/createAgentPersistenceRecords.d.ts +40 -0
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/createAgentPersistenceRecords.test.d.ts +1 -0
- package/umd/src/collection/pipeline-collection/constructors/createPipelineCollectionFromDirectory.d.ts +7 -1
- package/umd/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +52 -0
- package/umd/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +128 -0
- package/umd/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +3 -3
- package/umd/src/llm-providers/openai/OpenAiVectorStoreHandler.d.ts +54 -0
- package/umd/src/llm-providers/openai/utils/OpenAiCompatibleUnsupportedParameterRetrier.d.ts +29 -0
- package/umd/src/llm-providers/openai/utils/callOpenAiCompatibleChatModel.d.ts +28 -0
- package/umd/src/types/number_usd.d.ts +1 -1
- package/umd/src/types/string_parameter_name.d.ts +2 -2
- package/umd/src/types/typeAliases.d.ts +2 -2
- package/umd/src/version.d.ts +1 -1
package/README.md
CHANGED
|
@@ -19,11 +19,13 @@ Create persistent AI agents that turn your company's scattered knowledge into ac
|
|
|
19
19
|
[](https://github.com/webgptorg/promptbook/actions/workflows/test-types.yml)
|
|
20
20
|
[](https://github.com/webgptorg/promptbook/issues)
|
|
21
21
|
|
|
22
|
+
## 🚀 Quick deploy
|
|
22
23
|
|
|
23
24
|
|
|
24
|
-
## 🌟 New Features
|
|
25
25
|
|
|
26
|
-
-
|
|
26
|
+
[](https://vercel.com/new/clone?project-name=promptbook-agents-server&repository-name=promptbook-agents-server&repository-url=https%3A%2F%2Fgithub.com%2Fwebgptorg%2Fpromptbook&root-directory=apps%2Fagents-server&demo-title=Promptbook+Agents+Server&demo-description=Persistent+AI+agents+with+a+built-in+admin+UI.+This+deploy+creates+a+Supabase+project+automatically%2C+injects+the+required+database+credentials%2C+and+Promptbook+runs+the+SQL+migrations+on+first+startup.&demo-url=https%3A%2F%2Fgallery.ptbk.io%2F&external-id=https%3A%2F%2Fgithub.com%2Fwebgptorg%2Fpromptbook%2Ftree%2Fmain%2Fapps%2Fagents-server&env=OPENAI_API_KEY%2CADMIN_PASSWORD%2CSUPABASE_AUTO_MIGRATE&envDescription=Supabase+is+created+automatically+by+the+required+Vercel+integration.+Add+OPENAI_API_KEY+from+https%3A%2F%2Fplatform.openai.com%2Fapi-keys%2C+choose+ADMIN_PASSWORD+for+your+first+admin+login%2C+and+leave+SUPABASE_AUTO_MIGRATE+enabled.&envLink=https%3A%2F%2Fgithub.com%2Fwebgptorg%2Fpromptbook%2Fblob%2Fmain%2FREADME.md%23vercel-form-fields&envDefaults=%7B%22SUPABASE_AUTO_MIGRATE%22%3A%22true%22%7D&stores=%5B%7B%22type%22%3A%22integration%22%2C%22integrationSlug%22%3A%22supabase%22%2C%22productSlug%22%3A%22supabase%22%7D%5D)
|
|
27
|
+
|
|
28
|
+
|
|
27
29
|
|
|
28
30
|
|
|
29
31
|
|
|
@@ -597,28 +599,28 @@ npx ptbk coder verify
|
|
|
597
599
|
|
|
598
600
|
#### What each command does
|
|
599
601
|
|
|
600
|
-
| Command
|
|
601
|
-
|
|
|
602
|
-
| `ptbk coder init`
|
|
603
|
-
| `ptbk coder generate-boilerplates`
|
|
604
|
-
| `ptbk coder run`
|
|
605
|
-
| `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. |
|
|
606
|
-
| `ptbk coder verify`
|
|
602
|
+
| Command | What it does |
|
|
603
|
+
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------ | ---- | ----- | ------------------------------------------------------------------------ |
|
|
604
|
+
| `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 `/.tmp`; and configures `.vscode/settings.json` to save pasted prompt images into `prompts/screenshots/`. |
|
|
605
|
+
| `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. |
|
|
606
|
+
| `ptbk coder run` | Picks the next ready prompt, appends optional context, runs it through the selected coding agent, marks success or failure, then commits and pushes the result. |
|
|
607
|
+
| `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. |
|
|
608
|
+
| `ptbk coder verify` | Walks through completed prompts, archives truly finished work, and adds follow-up repair prompts for unfinished results. |
|
|
607
609
|
|
|
608
610
|
#### Most useful `ptbk coder run` flags
|
|
609
611
|
|
|
610
|
-
| Flag
|
|
611
|
-
|
|
|
612
|
-
| `--agent <name>`
|
|
613
|
-
| `--model <model>`
|
|
614
|
-
| `--context <text-or-file>` | Appends extra instructions inline or from a file like `AGENTS.md`.
|
|
615
|
-
| `--thinking-level <level>` | Sets reasoning effort for supported runners.
|
|
616
|
-
| `--no-wait`
|
|
617
|
-
| `--ignore-git-changes`
|
|
618
|
-
| `--priority <n>`
|
|
619
|
-
| `--dry-run`
|
|
620
|
-
| `--allow-credits`
|
|
621
|
-
| `--auto-migrate`
|
|
612
|
+
| Flag | Purpose |
|
|
613
|
+
| -------------------------- | -------------------------------------------------------------------------------------------------- |
|
|
614
|
+
| `--agent <name>` | Selects the coding backend. |
|
|
615
|
+
| `--model <model>` | Chooses the runner model; required for `openai-codex` and `gemini`, optional for `github-copilot`. |
|
|
616
|
+
| `--context <text-or-file>` | Appends extra instructions inline or from a file like `AGENTS.md`. |
|
|
617
|
+
| `--thinking-level <level>` | Sets reasoning effort for supported runners. |
|
|
618
|
+
| `--no-wait` | Skips interactive pauses between prompts for unattended execution. |
|
|
619
|
+
| `--ignore-git-changes` | Disables the clean-working-tree guard. |
|
|
620
|
+
| `--priority <n>` | Runs only prompts at or above the given priority. |
|
|
621
|
+
| `--dry-run` | Prints which prompts are ready instead of executing them. |
|
|
622
|
+
| `--allow-credits` | Lets OpenAI Codex spend credits when required. |
|
|
623
|
+
| `--auto-migrate` | Runs testing-server database migrations after each successful prompt. |
|
|
622
624
|
|
|
623
625
|
#### Typical usage pattern
|
|
624
626
|
|
|
@@ -1,14 +1,25 @@
|
|
|
1
|
-
import { Client } from 'pg';
|
|
1
|
+
import type { Client } from 'pg';
|
|
2
2
|
import type { DatabaseMigrationLogger } from './runDatabaseMigrations';
|
|
3
|
+
/**
|
|
4
|
+
* Lock-acquisition strategies used by the migration runner.
|
|
5
|
+
*
|
|
6
|
+
* `wait` is appropriate for explicit/manual migration flows where the caller expects one serialized run.
|
|
7
|
+
* `skip` is appropriate for background startup checks where waiting would block request handling.
|
|
8
|
+
*
|
|
9
|
+
* @private function of runDatabaseMigrations
|
|
10
|
+
*/
|
|
11
|
+
export type DatabaseMigrationExecutionLockMode = 'wait' | 'skip';
|
|
3
12
|
/**
|
|
4
13
|
* Acquires advisory lock preventing concurrent migration execution across processes.
|
|
5
14
|
*
|
|
6
15
|
* @param client Connected PostgreSQL client.
|
|
7
16
|
* @param logger Logger used for progress output.
|
|
17
|
+
* @param mode Whether the caller should block for the lock or skip when it is already held.
|
|
18
|
+
* @returns `true` when the lock was acquired and migrations may proceed.
|
|
8
19
|
*
|
|
9
20
|
* @private function of runDatabaseMigrations
|
|
10
21
|
*/
|
|
11
|
-
export declare function acquireMigrationExecutionLock(client: Client, logger: DatabaseMigrationLogger): Promise<
|
|
22
|
+
export declare function acquireMigrationExecutionLock(client: Client, logger: DatabaseMigrationLogger, mode?: DatabaseMigrationExecutionLockMode): Promise<boolean>;
|
|
12
23
|
/**
|
|
13
24
|
* Releases advisory lock used for migration execution.
|
|
14
25
|
*
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Imports a runtime-only module without letting Next.js statically bundle Node-only dependencies.
|
|
3
|
+
*
|
|
4
|
+
* @param specifier - Module specifier to import at runtime.
|
|
5
|
+
* @returns Imported module namespace.
|
|
6
|
+
* @private internal helper for runtime-only database utilities
|
|
7
|
+
*/
|
|
8
|
+
export declare function importRuntimeModule<TModule>(specifier: string): Promise<TModule>;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @private function of runDatabaseMigrations
|
|
7
7
|
*/
|
|
8
|
-
export declare function resolveMigrationsDirectory(): string
|
|
8
|
+
export declare function resolveMigrationsDirectory(): Promise<string>;
|
|
9
9
|
/**
|
|
10
10
|
* Reads migration files from directory and sorts them lexicographically.
|
|
11
11
|
*
|
|
@@ -14,4 +14,4 @@ export declare function resolveMigrationsDirectory(): string;
|
|
|
14
14
|
*
|
|
15
15
|
* @private function of runDatabaseMigrations
|
|
16
16
|
*/
|
|
17
|
-
export declare function readMigrationFiles(migrationsDirectory: string): Array<string
|
|
17
|
+
export declare function readMigrationFiles(migrationsDirectory: string): Promise<Array<string>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ServerRecord } from '../utils/serverRegistry';
|
|
2
|
+
import { type DatabaseMigrationExecutionLockMode } from './acquireMigrationExecutionLock';
|
|
2
3
|
/**
|
|
3
4
|
* Allowed values describing who applied a migration record.
|
|
4
5
|
*/
|
|
@@ -67,6 +68,10 @@ export type RunDatabaseMigrationsOptions = {
|
|
|
67
68
|
* If true, prints every SQL migration body before execution.
|
|
68
69
|
*/
|
|
69
70
|
readonly logSqlStatements?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Whether migration execution should wait for the advisory lock or skip when another process already owns it.
|
|
73
|
+
*/
|
|
74
|
+
readonly executionLockMode?: DatabaseMigrationExecutionLockMode;
|
|
70
75
|
};
|
|
71
76
|
/**
|
|
72
77
|
* Result of one prefix migration run.
|
|
@@ -97,6 +102,10 @@ export type RunDatabaseMigrationsResult = {
|
|
|
97
102
|
* Per-prefix summary.
|
|
98
103
|
*/
|
|
99
104
|
readonly perPrefix: ReadonlyArray<DatabaseMigrationPrefixResult>;
|
|
105
|
+
/**
|
|
106
|
+
* Whether migration execution was skipped because another process already held the advisory lock.
|
|
107
|
+
*/
|
|
108
|
+
readonly isSkippedDueToActiveMigrationLock: boolean;
|
|
100
109
|
};
|
|
101
110
|
/**
|
|
102
111
|
* Reads migration runtime configuration from environment variables and `_Server`.
|