@promptbook/color 0.112.0-41 → 0.112.0-43
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 +10 -3
- package/esm/index.es.js +1 -1
- package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +1 -1
- package/esm/src/cli/cli-commands/coder/getTypescriptModule.d.ts +19 -0
- package/esm/src/cli/cli-commands/coder/getTypescriptModule.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/mergeStringRecordJsonFile.test.d.ts +1 -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/llm-providers/agent/Agent.test.d.ts +1 -0
- package/esm/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +4 -0
- package/esm/src/llm-providers/agent/AgentOptions.d.ts +8 -0
- package/esm/src/llm-providers/agent/CreateAgentLlmExecutionToolsOptions.d.ts +9 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +1 -1
- package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +1 -1
- package/umd/src/cli/cli-commands/coder/getTypescriptModule.d.ts +19 -0
- package/umd/src/cli/cli-commands/coder/getTypescriptModule.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/mergeStringRecordJsonFile.test.d.ts +1 -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/llm-providers/agent/Agent.test.d.ts +1 -0
- package/umd/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +4 -0
- package/umd/src/llm-providers/agent/AgentOptions.d.ts +8 -0
- package/umd/src/llm-providers/agent/CreateAgentLlmExecutionToolsOptions.d.ts +9 -0
- package/umd/src/version.d.ts +1 -1
package/README.md
CHANGED
|
@@ -614,6 +614,7 @@ Prompts marked with `[-]` are not ready yet, prompts containing `@@@` are treate
|
|
|
614
614
|
- **Reasoning control:** `--thinking-level low|medium|high|xhigh` for supported runners
|
|
615
615
|
- **Interactive or unattended runs:** default wait mode, or `--no-wait` for batch execution
|
|
616
616
|
- **Git safety:** clean working tree check by default, optional `--ignore-git-changes`
|
|
617
|
+
- **Opt-in remote pushes:** commits stay local unless you explicitly pass `--auto-push`
|
|
617
618
|
- **Prompt triage:** `--priority` to process only more important tasks first
|
|
618
619
|
- **Failure logging:** failed runs write a neighboring `.error.log`
|
|
619
620
|
- **Line-ending normalization:** changed files are normalized back to LF by default
|
|
@@ -631,6 +632,8 @@ npx ts-node ./src/cli/test/ptbk.ts coder generate-boilerplates --template prompt
|
|
|
631
632
|
|
|
632
633
|
npx ts-node ./src/cli/test/ptbk.ts coder run --agent github-copilot --model gpt-5.4 --thinking-level xhigh --context AGENTS.md
|
|
633
634
|
|
|
635
|
+
npx ts-node ./src/cli/test/ptbk.ts coder run --agent github-copilot --model gpt-5.4 --thinking-level xhigh --context AGENTS.md --auto-push
|
|
636
|
+
|
|
634
637
|
npx ts-node ./src/cli/test/ptbk.ts coder run --agent github-copilot --model gpt-5.4 --thinking-level xhigh --context AGENTS.md --ignore-git-changes --no-wait
|
|
635
638
|
|
|
636
639
|
npx ts-node ./src/cli/test/ptbk.ts coder find-refactor-candidates
|
|
@@ -653,9 +656,11 @@ npx ptbk coder generate-boilerplates
|
|
|
653
656
|
|
|
654
657
|
npx ptbk coder generate-boilerplates --template prompts/templates/common.md
|
|
655
658
|
|
|
656
|
-
npx ptbk coder run --agent github-copilot --model gpt-5.4 --thinking-level xhigh --context AGENTS.md
|
|
659
|
+
npx ptbk coder run --agent github-copilot --model gpt-5.4 --thinking-level xhigh --context AGENTS.md --test npm run test
|
|
660
|
+
|
|
661
|
+
npx ptbk coder run --agent github-copilot --model gpt-5.4 --thinking-level xhigh --context AGENTS.md --auto-push
|
|
657
662
|
|
|
658
|
-
npx ptbk coder run --agent github-copilot --model gpt-5.4 --thinking-level xhigh --context AGENTS.md --ignore-git-changes --no-wait
|
|
663
|
+
npx ptbk coder run --agent github-copilot --model gpt-5.4 --thinking-level xhigh --context AGENTS.md --test npm run test --ignore-git-changes --no-wait
|
|
659
664
|
|
|
660
665
|
npx ptbk coder find-refactor-candidates
|
|
661
666
|
|
|
@@ -672,7 +677,7 @@ npx ptbk coder verify
|
|
|
672
677
|
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------ | ---- | ----- | ------------------------------------------------------------------------ |
|
|
673
678
|
| `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/`. |
|
|
674
679
|
| `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. |
|
|
675
|
-
| `ptbk coder run` | Picks the next ready prompt, appends optional context, runs it through the selected coding agent, marks success or failure,
|
|
680
|
+
| `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. |
|
|
676
681
|
| `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. |
|
|
677
682
|
| `ptbk coder verify` | Walks through completed prompts, archives truly finished work, and adds follow-up repair prompts for unfinished results. |
|
|
678
683
|
|
|
@@ -683,12 +688,14 @@ npx ptbk coder verify
|
|
|
683
688
|
| `--agent <name>` | Selects the coding backend. |
|
|
684
689
|
| `--model <model>` | Chooses the runner model; required for `openai-codex` and `gemini`, optional for `github-copilot`. |
|
|
685
690
|
| `--context <text-or-file>` | Appends extra instructions inline or from a file like `AGENTS.md`. |
|
|
691
|
+
| `--test <command>` | Runs a verification command after each prompt attempt and feeds failing output back for retries. |
|
|
686
692
|
| `--thinking-level <level>` | Sets reasoning effort for supported runners. |
|
|
687
693
|
| `--no-wait` | Skips interactive pauses between prompts for unattended execution. |
|
|
688
694
|
| `--ignore-git-changes` | Disables the clean-working-tree guard. |
|
|
689
695
|
| `--priority <n>` | Runs only prompts at or above the given priority. |
|
|
690
696
|
| `--dry-run` | Prints which prompts are ready instead of executing them. |
|
|
691
697
|
| `--allow-credits` | Lets OpenAI Codex spend credits when required. |
|
|
698
|
+
| `--auto-push` | Pushes each successful coding-agent commit to the configured remote. |
|
|
692
699
|
| `--auto-migrate` | Runs testing-server database migrations after each successful prompt. |
|
|
693
700
|
|
|
694
701
|
#### Typical usage pattern
|
package/esm/index.es.js
CHANGED
|
@@ -14,7 +14,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
14
14
|
* @generated
|
|
15
15
|
* @see https://github.com/webgptorg/promptbook
|
|
16
16
|
*/
|
|
17
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
17
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-43';
|
|
18
18
|
/**
|
|
19
19
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
20
20
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -745,7 +745,7 @@ export type ChatProps = {
|
|
|
745
745
|
* - `BUBBLE_MODE`: keeps the default bubble appearance for all messages.
|
|
746
746
|
* - `ARTICLE_MODE`: keeps user bubbles while rendering assistant replies as borderless article blocks.
|
|
747
747
|
*
|
|
748
|
-
* @default '
|
|
748
|
+
* @default 'ARTICLE_MODE'
|
|
749
749
|
*/
|
|
750
750
|
readonly CHAT_VISUAL_MODE?: ChatVisualMode;
|
|
751
751
|
/**
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Possible runtime shapes returned when importing the `typescript` package.
|
|
3
|
+
*/
|
|
4
|
+
type ImportedTypescriptModule = typeof import('typescript') | {
|
|
5
|
+
default: typeof import('typescript');
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Loads the TypeScript runtime used for parsing JSONC-style project files.
|
|
9
|
+
*
|
|
10
|
+
* @private internal utility of `coder init`
|
|
11
|
+
*/
|
|
12
|
+
export declare function getTypescriptModule(): Promise<typeof import('typescript')>;
|
|
13
|
+
/**
|
|
14
|
+
* Normalizes CommonJS-via-`default` and direct namespace imports of TypeScript.
|
|
15
|
+
*
|
|
16
|
+
* @private internal utility of `getTypescriptModule`
|
|
17
|
+
*/
|
|
18
|
+
export declare function normalizeImportedTypescriptModule(importedTypescriptModule: ImportedTypescriptModule): typeof import('typescript');
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,23 +4,11 @@ import type { string_book } from '../../../../book-2.0/agent-source/string_book'
|
|
|
4
4
|
import type { string_agent_name, string_agent_permanent_id } from '../../../../types/typeAliases';
|
|
5
5
|
import { AgentCollectionInSupabaseOptions } from './AgentCollectionInSupabaseOptions';
|
|
6
6
|
import type { AgentsDatabaseSchema } from './AgentsDatabaseSchema';
|
|
7
|
+
import { type CreateAgentPersistenceRecordsOptions } from './createAgentPersistenceRecords';
|
|
7
8
|
/**
|
|
8
9
|
* Options for creating a new agent entry.
|
|
9
10
|
*/
|
|
10
|
-
type CreateAgentOptions =
|
|
11
|
-
/**
|
|
12
|
-
* Visibility for the new agent.
|
|
13
|
-
*/
|
|
14
|
-
readonly visibility?: 'PRIVATE' | 'UNLISTED' | 'PUBLIC';
|
|
15
|
-
/**
|
|
16
|
-
* Folder identifier to assign the new agent to.
|
|
17
|
-
*/
|
|
18
|
-
readonly folderId?: number | null;
|
|
19
|
-
/**
|
|
20
|
-
* Sort order for the agent within its parent folder.
|
|
21
|
-
*/
|
|
22
|
-
readonly sortOrder?: number;
|
|
23
|
-
};
|
|
11
|
+
type CreateAgentOptions = CreateAgentPersistenceRecordsOptions;
|
|
24
12
|
/**
|
|
25
13
|
* Optional controls for persisting one source update.
|
|
26
14
|
*/
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { AgentBasicInformation } from '../../../../book-2.0/agent-source/AgentBasicInformation';
|
|
2
|
+
import type { string_book } from '../../../../book-2.0/agent-source/string_book';
|
|
3
|
+
import type { CreateAgentInput } from '../../CreateAgentInput';
|
|
4
|
+
import type { AgentsDatabaseSchema } from './AgentsDatabaseSchema';
|
|
5
|
+
/**
|
|
6
|
+
* Optional persistence overrides for one new agent row.
|
|
7
|
+
*
|
|
8
|
+
* @private shared persistence helper for `AgentCollectionInSupabase`
|
|
9
|
+
*/
|
|
10
|
+
export type CreateAgentPersistenceRecordsOptions = Omit<CreateAgentInput, 'source'>;
|
|
11
|
+
/**
|
|
12
|
+
* Prepared insert rows and returned profile for one newly persisted agent.
|
|
13
|
+
*
|
|
14
|
+
* @private shared persistence helper for `AgentCollectionInSupabase`
|
|
15
|
+
*/
|
|
16
|
+
export type CreateAgentPersistenceRecordsResult = {
|
|
17
|
+
/**
|
|
18
|
+
* Parsed created agent profile including the resolved permanent id.
|
|
19
|
+
*/
|
|
20
|
+
readonly createdAgent: AgentBasicInformation & Required<Pick<AgentBasicInformation, 'permanentId'>>;
|
|
21
|
+
/**
|
|
22
|
+
* Insert row for the `Agent` table.
|
|
23
|
+
*/
|
|
24
|
+
readonly agentInsertRecord: AgentsDatabaseSchema['public']['Tables']['Agent']['Insert'];
|
|
25
|
+
/**
|
|
26
|
+
* Insert row for the `AgentHistory` table.
|
|
27
|
+
*/
|
|
28
|
+
readonly agentHistoryInsertRecord: AgentsDatabaseSchema['public']['Tables']['AgentHistory']['Insert'];
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Builds normalized insert rows for a newly created persisted agent.
|
|
32
|
+
*
|
|
33
|
+
* @param agentSource - Source content of the agent.
|
|
34
|
+
* @param options - Optional folder placement, ordering, and visibility overrides.
|
|
35
|
+
* @param createdAt - Shared creation timestamp used across all persisted rows.
|
|
36
|
+
* @returns Insert rows and the created agent profile.
|
|
37
|
+
*
|
|
38
|
+
* @private shared persistence helper for `AgentCollectionInSupabase`
|
|
39
|
+
*/
|
|
40
|
+
export declare function createAgentPersistenceRecords(agentSource: string_book, options?: CreateAgentPersistenceRecordsOptions, createdAt?: string): CreateAgentPersistenceRecordsResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -44,6 +44,10 @@ export declare class AgentLlmExecutionTools implements LlmExecutionTools {
|
|
|
44
44
|
* Cached parsed agent information
|
|
45
45
|
*/
|
|
46
46
|
private _cachedAgentInfo;
|
|
47
|
+
/**
|
|
48
|
+
* Optional server-precomputed model requirements reused until the source changes.
|
|
49
|
+
*/
|
|
50
|
+
private precomputedModelRequirements;
|
|
47
51
|
/**
|
|
48
52
|
* Creates new AgentLlmExecutionTools
|
|
49
53
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { string_book } from '../../book-2.0/agent-source/string_book';
|
|
2
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
3
|
import type { CommonToolsOptions } from '../../execution/CommonToolsOptions';
|
|
3
4
|
import type { ExecutionTools } from '../../execution/ExecutionTools';
|
|
4
5
|
import type { Updatable } from '../../types/Updatable';
|
|
@@ -27,6 +28,13 @@ export type AgentOptions = CommonToolsOptions & {
|
|
|
27
28
|
* The source of the agent
|
|
28
29
|
*/
|
|
29
30
|
agentSource: Updatable<string_book>;
|
|
31
|
+
/**
|
|
32
|
+
* Optional precomputed model requirements reused until `agentSource` changes.
|
|
33
|
+
*
|
|
34
|
+
* This keeps the actual runtime prompt aligned with server-prepared requirements
|
|
35
|
+
* such as compact-reference-resolved `TEAM` tools.
|
|
36
|
+
*/
|
|
37
|
+
precomputedModelRequirements?: AgentModelRequirements;
|
|
30
38
|
/**
|
|
31
39
|
* Teacher agent for self-learning
|
|
32
40
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { string_book } from '../../book-2.0/agent-source/string_book';
|
|
2
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
3
|
import type { CommonToolsOptions } from '../../execution/CommonToolsOptions';
|
|
3
4
|
import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
4
5
|
import type { OpenAiAgentKitExecutionTools } from '../openai/OpenAiAgentKitExecutionTools';
|
|
@@ -25,4 +26,12 @@ export type CreateAgentLlmExecutionToolsOptions = CommonToolsOptions & {
|
|
|
25
26
|
* The agent source string that defines the agent's behavior
|
|
26
27
|
*/
|
|
27
28
|
agentSource: string_book;
|
|
29
|
+
/**
|
|
30
|
+
* Optional precomputed model requirements reused until `agentSource` changes.
|
|
31
|
+
*
|
|
32
|
+
* This is useful for runtimes such as Agents Server that already resolved compact
|
|
33
|
+
* references (for example in `TEAM`) and need the executed prompt to stay aligned
|
|
34
|
+
* with the server-prepared tool list.
|
|
35
|
+
*/
|
|
36
|
+
precomputedModelRequirements?: AgentModelRequirements;
|
|
28
37
|
};
|
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-42`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/color",
|
|
3
|
-
"version": "0.112.0-
|
|
3
|
+
"version": "0.112.0-43",
|
|
4
4
|
"description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"module": "./esm/index.es.js",
|
|
95
95
|
"typings": "./esm/typings/src/_packages/color.index.d.ts",
|
|
96
96
|
"peerDependencies": {
|
|
97
|
-
"@promptbook/core": "0.112.0-
|
|
97
|
+
"@promptbook/core": "0.112.0-43"
|
|
98
98
|
},
|
|
99
99
|
"dependencies": {
|
|
100
100
|
"spacetrim": "0.11.60"
|
package/umd/index.umd.js
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* @generated
|
|
19
19
|
* @see https://github.com/webgptorg/promptbook
|
|
20
20
|
*/
|
|
21
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
21
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-43';
|
|
22
22
|
/**
|
|
23
23
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
24
24
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -745,7 +745,7 @@ export type ChatProps = {
|
|
|
745
745
|
* - `BUBBLE_MODE`: keeps the default bubble appearance for all messages.
|
|
746
746
|
* - `ARTICLE_MODE`: keeps user bubbles while rendering assistant replies as borderless article blocks.
|
|
747
747
|
*
|
|
748
|
-
* @default '
|
|
748
|
+
* @default 'ARTICLE_MODE'
|
|
749
749
|
*/
|
|
750
750
|
readonly CHAT_VISUAL_MODE?: ChatVisualMode;
|
|
751
751
|
/**
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Possible runtime shapes returned when importing the `typescript` package.
|
|
3
|
+
*/
|
|
4
|
+
type ImportedTypescriptModule = typeof import('typescript') | {
|
|
5
|
+
default: typeof import('typescript');
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Loads the TypeScript runtime used for parsing JSONC-style project files.
|
|
9
|
+
*
|
|
10
|
+
* @private internal utility of `coder init`
|
|
11
|
+
*/
|
|
12
|
+
export declare function getTypescriptModule(): Promise<typeof import('typescript')>;
|
|
13
|
+
/**
|
|
14
|
+
* Normalizes CommonJS-via-`default` and direct namespace imports of TypeScript.
|
|
15
|
+
*
|
|
16
|
+
* @private internal utility of `getTypescriptModule`
|
|
17
|
+
*/
|
|
18
|
+
export declare function normalizeImportedTypescriptModule(importedTypescriptModule: ImportedTypescriptModule): typeof import('typescript');
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,23 +4,11 @@ import type { string_book } from '../../../../book-2.0/agent-source/string_book'
|
|
|
4
4
|
import type { string_agent_name, string_agent_permanent_id } from '../../../../types/typeAliases';
|
|
5
5
|
import { AgentCollectionInSupabaseOptions } from './AgentCollectionInSupabaseOptions';
|
|
6
6
|
import type { AgentsDatabaseSchema } from './AgentsDatabaseSchema';
|
|
7
|
+
import { type CreateAgentPersistenceRecordsOptions } from './createAgentPersistenceRecords';
|
|
7
8
|
/**
|
|
8
9
|
* Options for creating a new agent entry.
|
|
9
10
|
*/
|
|
10
|
-
type CreateAgentOptions =
|
|
11
|
-
/**
|
|
12
|
-
* Visibility for the new agent.
|
|
13
|
-
*/
|
|
14
|
-
readonly visibility?: 'PRIVATE' | 'UNLISTED' | 'PUBLIC';
|
|
15
|
-
/**
|
|
16
|
-
* Folder identifier to assign the new agent to.
|
|
17
|
-
*/
|
|
18
|
-
readonly folderId?: number | null;
|
|
19
|
-
/**
|
|
20
|
-
* Sort order for the agent within its parent folder.
|
|
21
|
-
*/
|
|
22
|
-
readonly sortOrder?: number;
|
|
23
|
-
};
|
|
11
|
+
type CreateAgentOptions = CreateAgentPersistenceRecordsOptions;
|
|
24
12
|
/**
|
|
25
13
|
* Optional controls for persisting one source update.
|
|
26
14
|
*/
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { AgentBasicInformation } from '../../../../book-2.0/agent-source/AgentBasicInformation';
|
|
2
|
+
import type { string_book } from '../../../../book-2.0/agent-source/string_book';
|
|
3
|
+
import type { CreateAgentInput } from '../../CreateAgentInput';
|
|
4
|
+
import type { AgentsDatabaseSchema } from './AgentsDatabaseSchema';
|
|
5
|
+
/**
|
|
6
|
+
* Optional persistence overrides for one new agent row.
|
|
7
|
+
*
|
|
8
|
+
* @private shared persistence helper for `AgentCollectionInSupabase`
|
|
9
|
+
*/
|
|
10
|
+
export type CreateAgentPersistenceRecordsOptions = Omit<CreateAgentInput, 'source'>;
|
|
11
|
+
/**
|
|
12
|
+
* Prepared insert rows and returned profile for one newly persisted agent.
|
|
13
|
+
*
|
|
14
|
+
* @private shared persistence helper for `AgentCollectionInSupabase`
|
|
15
|
+
*/
|
|
16
|
+
export type CreateAgentPersistenceRecordsResult = {
|
|
17
|
+
/**
|
|
18
|
+
* Parsed created agent profile including the resolved permanent id.
|
|
19
|
+
*/
|
|
20
|
+
readonly createdAgent: AgentBasicInformation & Required<Pick<AgentBasicInformation, 'permanentId'>>;
|
|
21
|
+
/**
|
|
22
|
+
* Insert row for the `Agent` table.
|
|
23
|
+
*/
|
|
24
|
+
readonly agentInsertRecord: AgentsDatabaseSchema['public']['Tables']['Agent']['Insert'];
|
|
25
|
+
/**
|
|
26
|
+
* Insert row for the `AgentHistory` table.
|
|
27
|
+
*/
|
|
28
|
+
readonly agentHistoryInsertRecord: AgentsDatabaseSchema['public']['Tables']['AgentHistory']['Insert'];
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Builds normalized insert rows for a newly created persisted agent.
|
|
32
|
+
*
|
|
33
|
+
* @param agentSource - Source content of the agent.
|
|
34
|
+
* @param options - Optional folder placement, ordering, and visibility overrides.
|
|
35
|
+
* @param createdAt - Shared creation timestamp used across all persisted rows.
|
|
36
|
+
* @returns Insert rows and the created agent profile.
|
|
37
|
+
*
|
|
38
|
+
* @private shared persistence helper for `AgentCollectionInSupabase`
|
|
39
|
+
*/
|
|
40
|
+
export declare function createAgentPersistenceRecords(agentSource: string_book, options?: CreateAgentPersistenceRecordsOptions, createdAt?: string): CreateAgentPersistenceRecordsResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -44,6 +44,10 @@ export declare class AgentLlmExecutionTools implements LlmExecutionTools {
|
|
|
44
44
|
* Cached parsed agent information
|
|
45
45
|
*/
|
|
46
46
|
private _cachedAgentInfo;
|
|
47
|
+
/**
|
|
48
|
+
* Optional server-precomputed model requirements reused until the source changes.
|
|
49
|
+
*/
|
|
50
|
+
private precomputedModelRequirements;
|
|
47
51
|
/**
|
|
48
52
|
* Creates new AgentLlmExecutionTools
|
|
49
53
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { string_book } from '../../book-2.0/agent-source/string_book';
|
|
2
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
3
|
import type { CommonToolsOptions } from '../../execution/CommonToolsOptions';
|
|
3
4
|
import type { ExecutionTools } from '../../execution/ExecutionTools';
|
|
4
5
|
import type { Updatable } from '../../types/Updatable';
|
|
@@ -27,6 +28,13 @@ export type AgentOptions = CommonToolsOptions & {
|
|
|
27
28
|
* The source of the agent
|
|
28
29
|
*/
|
|
29
30
|
agentSource: Updatable<string_book>;
|
|
31
|
+
/**
|
|
32
|
+
* Optional precomputed model requirements reused until `agentSource` changes.
|
|
33
|
+
*
|
|
34
|
+
* This keeps the actual runtime prompt aligned with server-prepared requirements
|
|
35
|
+
* such as compact-reference-resolved `TEAM` tools.
|
|
36
|
+
*/
|
|
37
|
+
precomputedModelRequirements?: AgentModelRequirements;
|
|
30
38
|
/**
|
|
31
39
|
* Teacher agent for self-learning
|
|
32
40
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { string_book } from '../../book-2.0/agent-source/string_book';
|
|
2
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
3
|
import type { CommonToolsOptions } from '../../execution/CommonToolsOptions';
|
|
3
4
|
import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
|
|
4
5
|
import type { OpenAiAgentKitExecutionTools } from '../openai/OpenAiAgentKitExecutionTools';
|
|
@@ -25,4 +26,12 @@ export type CreateAgentLlmExecutionToolsOptions = CommonToolsOptions & {
|
|
|
25
26
|
* The agent source string that defines the agent's behavior
|
|
26
27
|
*/
|
|
27
28
|
agentSource: string_book;
|
|
29
|
+
/**
|
|
30
|
+
* Optional precomputed model requirements reused until `agentSource` changes.
|
|
31
|
+
*
|
|
32
|
+
* This is useful for runtimes such as Agents Server that already resolved compact
|
|
33
|
+
* references (for example in `TEAM`) and need the executed prompt to stay aligned
|
|
34
|
+
* with the server-prepared tool list.
|
|
35
|
+
*/
|
|
36
|
+
precomputedModelRequirements?: AgentModelRequirements;
|
|
28
37
|
};
|
package/umd/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-42`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|