@promptbook/wizard 0.112.0-42 → 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 CHANGED
@@ -438,6 +438,7 @@ Prompts marked with `[-]` are not ready yet, prompts containing `@@@` are treate
438
438
  - **Reasoning control:** `--thinking-level low|medium|high|xhigh` for supported runners
439
439
  - **Interactive or unattended runs:** default wait mode, or `--no-wait` for batch execution
440
440
  - **Git safety:** clean working tree check by default, optional `--ignore-git-changes`
441
+ - **Opt-in remote pushes:** commits stay local unless you explicitly pass `--auto-push`
441
442
  - **Prompt triage:** `--priority` to process only more important tasks first
442
443
  - **Failure logging:** failed runs write a neighboring `.error.log`
443
444
  - **Line-ending normalization:** changed files are normalized back to LF by default
@@ -455,6 +456,8 @@ npx ts-node ./src/cli/test/ptbk.ts coder generate-boilerplates --template prompt
455
456
 
456
457
  npx ts-node ./src/cli/test/ptbk.ts coder run --agent github-copilot --model gpt-5.4 --thinking-level xhigh --context AGENTS.md
457
458
 
459
+ 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
460
+
458
461
  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
459
462
 
460
463
  npx ts-node ./src/cli/test/ptbk.ts coder find-refactor-candidates
@@ -477,9 +480,11 @@ npx ptbk coder generate-boilerplates
477
480
 
478
481
  npx ptbk coder generate-boilerplates --template prompts/templates/common.md
479
482
 
480
- npx ptbk coder run --agent github-copilot --model gpt-5.4 --thinking-level xhigh --context AGENTS.md
483
+ npx ptbk coder run --agent github-copilot --model gpt-5.4 --thinking-level xhigh --context AGENTS.md --test npm run test
484
+
485
+ npx ptbk coder run --agent github-copilot --model gpt-5.4 --thinking-level xhigh --context AGENTS.md --auto-push
481
486
 
482
- npx ptbk coder run --agent github-copilot --model gpt-5.4 --thinking-level xhigh --context AGENTS.md --ignore-git-changes --no-wait
487
+ 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
483
488
 
484
489
  npx ptbk coder find-refactor-candidates
485
490
 
@@ -496,7 +501,7 @@ npx ptbk coder verify
496
501
  | ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------ | ---- | ----- | ------------------------------------------------------------------------ |
497
502
  | `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/`. |
498
503
  | `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. |
499
- | `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. |
504
+ | `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. |
500
505
  | `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. |
501
506
  | `ptbk coder verify` | Walks through completed prompts, archives truly finished work, and adds follow-up repair prompts for unfinished results. |
502
507
 
@@ -507,12 +512,14 @@ npx ptbk coder verify
507
512
  | `--agent <name>` | Selects the coding backend. |
508
513
  | `--model <model>` | Chooses the runner model; required for `openai-codex` and `gemini`, optional for `github-copilot`. |
509
514
  | `--context <text-or-file>` | Appends extra instructions inline or from a file like `AGENTS.md`. |
515
+ | `--test <command>` | Runs a verification command after each prompt attempt and feeds failing output back for retries. |
510
516
  | `--thinking-level <level>` | Sets reasoning effort for supported runners. |
511
517
  | `--no-wait` | Skips interactive pauses between prompts for unattended execution. |
512
518
  | `--ignore-git-changes` | Disables the clean-working-tree guard. |
513
519
  | `--priority <n>` | Runs only prompts at or above the given priority. |
514
520
  | `--dry-run` | Prints which prompts are ready instead of executing them. |
515
521
  | `--allow-credits` | Lets OpenAI Codex spend credits when required. |
522
+ | `--auto-push` | Pushes each successful coding-agent commit to the configured remote. |
516
523
  | `--auto-migrate` | Runs testing-server database migrations after each successful prompt. |
517
524
 
518
525
  #### Typical usage pattern
package/esm/index.es.js CHANGED
@@ -38,7 +38,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
38
38
  * @generated
39
39
  * @see https://github.com/webgptorg/promptbook
40
40
  */
41
- const PROMPTBOOK_ENGINE_VERSION = '0.112.0-42';
41
+ const PROMPTBOOK_ENGINE_VERSION = '0.112.0-43';
42
42
  /**
43
43
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
44
44
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -18784,7 +18784,7 @@ function createEmptyAgentModelRequirements() {
18784
18784
  systemMessage: '',
18785
18785
  promptSuffix: '',
18786
18786
  // modelName: 'gpt-5',
18787
- modelName: 'gemini-2.5-flash-lite',
18787
+ modelName: 'gpt-5.4-mini',
18788
18788
  temperature: 0.7,
18789
18789
  topP: 0.9,
18790
18790
  topK: 50,
@@ -23230,6 +23230,15 @@ const teamToolFunctions = {};
23230
23230
  * Map of team tool titles.
23231
23231
  */
23232
23232
  const teamToolTitles = {};
23233
+ /**
23234
+ * Shared TEAM usage rules appended ahead of teammate listings.
23235
+ *
23236
+ * @private
23237
+ */
23238
+ const TEAM_SYSTEM_MESSAGE_GUIDANCE_LINES = [
23239
+ '- If a teammate is relevant to the request, consult that teammate using the matching tool.',
23240
+ '- Do not ask the user for information that a listed teammate can provide directly.',
23241
+ ];
23233
23242
  /**
23234
23243
  * Constant for remote agents by Url.
23235
23244
  */
@@ -23319,12 +23328,9 @@ class TeamCommitmentDefinition extends BaseCommitmentDefinition {
23319
23328
  if (updatedTools.some((tool) => tool.name === entry.toolName)) {
23320
23329
  continue;
23321
23330
  }
23322
- const toolDescription = entry.description
23323
- ? `Consult teammate ${entry.teammate.label}\n${entry.description}`
23324
- : `Consult teammate ${entry.teammate.label}`;
23325
23331
  updatedTools.push({
23326
23332
  name: entry.toolName,
23327
- description: toolDescription,
23333
+ description: buildTeamToolDescription(entry),
23328
23334
  parameters: {
23329
23335
  type: 'object',
23330
23336
  properties: {
@@ -23393,22 +23399,72 @@ function resolveTeamTeammateLabels(teamContent, teammates) {
23393
23399
  /**
23394
23400
  * Builds the textual TEAM section body for the final system message.
23395
23401
  *
23396
- * Each teammate is listed with its tool name and, when available, a one-line description.
23397
- * Uses `spaceTrim` to ensure consistent whitespace and indentation.
23402
+ * Each teammate is listed with its tool name, TEAM instructions, and optional profile hints.
23398
23403
  */
23399
23404
  function buildTeamSystemMessageBody(teamEntries) {
23400
- const lines = teamEntries.map((entry, index) => {
23401
- const toolLine = `${index + 1}) ${entry.teammate.label} tool \`${entry.toolName}\``;
23402
- if (!entry.description) {
23403
- return toolLine;
23404
- }
23405
- return spaceTrim$1(`
23406
- ${toolLine}
23407
- ${entry.description}
23408
- `);
23409
- });
23405
+ const lines = [
23406
+ ...TEAM_SYSTEM_MESSAGE_GUIDANCE_LINES,
23407
+ '',
23408
+ ...teamEntries.map((entry, index) => {
23409
+ const toolLine = `${index + 1}) ${entry.teammate.label} tool \`${entry.toolName}\``;
23410
+ const detailLines = collectTeamEntryDetails(entry).map(formatTeamEntryDetailLine);
23411
+ return [toolLine, ...detailLines].join('\n');
23412
+ }),
23413
+ ];
23410
23414
  return lines.join('\n');
23411
23415
  }
23416
+ /**
23417
+ * Builds the model-visible description for one teammate tool.
23418
+ *
23419
+ * @private
23420
+ */
23421
+ function buildTeamToolDescription(entry) {
23422
+ const detailLines = collectTeamEntryDetails(entry).map(({ label, content }) => `${label}: ${content}`);
23423
+ return [`Consult teammate ${entry.teammate.label}`, ...detailLines].join('\n');
23424
+ }
23425
+ /**
23426
+ * Collects structured teammate details that should stay visible to the model.
23427
+ *
23428
+ * @private
23429
+ */
23430
+ function collectTeamEntryDetails(entry) {
23431
+ var _a;
23432
+ const details = [];
23433
+ const instructions = entry.teammate.instructions.trim();
23434
+ const description = ((_a = entry.description) === null || _a === void 0 ? void 0 : _a.trim()) || '';
23435
+ if (instructions) {
23436
+ details.push({
23437
+ label: 'TEAM instructions',
23438
+ content: instructions,
23439
+ });
23440
+ }
23441
+ if (description) {
23442
+ details.push({
23443
+ label: 'Profile',
23444
+ content: description,
23445
+ });
23446
+ }
23447
+ return details;
23448
+ }
23449
+ /**
23450
+ * Formats one teammate detail line for the TEAM system-message section.
23451
+ *
23452
+ * @private
23453
+ */
23454
+ function formatTeamEntryDetailLine(detail) {
23455
+ return indentMultilineText(`${detail.label}: ${detail.content}`, ' ');
23456
+ }
23457
+ /**
23458
+ * Indents all lines of one potentially multi-line text block.
23459
+ *
23460
+ * @private
23461
+ */
23462
+ function indentMultilineText(text, prefix) {
23463
+ return text
23464
+ .split('\n')
23465
+ .map((line) => `${prefix}${line}`)
23466
+ .join('\n');
23467
+ }
23412
23468
  /**
23413
23469
  * Registers tool function and title for a teammate tool.
23414
23470
  */
@@ -39033,7 +39089,7 @@ function promptbookifyAiText(text) {
39033
39089
  /**
39034
39090
  * Constant for default agent kit model name.
39035
39091
  */
39036
- const DEFAULT_AGENT_KIT_MODEL_NAME = 'gpt-5.4-nano';
39092
+ const DEFAULT_AGENT_KIT_MODEL_NAME = 'gpt-5.4-mini';
39037
39093
  /**
39038
39094
  * Creates one structured log entry for streamed tool-call updates.
39039
39095
  *
@@ -40083,6 +40139,7 @@ class AgentLlmExecutionTools {
40083
40139
  * @param agentSource The agent source string that defines the agent's behavior
40084
40140
  */
40085
40141
  constructor(options) {
40142
+ var _a;
40086
40143
  this.options = options;
40087
40144
  /**
40088
40145
  * Cached model requirements to avoid re-parsing the agent source
@@ -40092,6 +40149,7 @@ class AgentLlmExecutionTools {
40092
40149
  * Cached parsed agent information
40093
40150
  */
40094
40151
  this._cachedAgentInfo = null;
40152
+ this.precomputedModelRequirements = (_a = options.precomputedModelRequirements) !== null && _a !== void 0 ? _a : null;
40095
40153
  }
40096
40154
  /**
40097
40155
  * Updates the agent source and clears the cache
@@ -40099,9 +40157,13 @@ class AgentLlmExecutionTools {
40099
40157
  * @param agentSource The new agent source string
40100
40158
  */
40101
40159
  updateAgentSource(agentSource) {
40160
+ if (this.options.agentSource === agentSource) {
40161
+ return;
40162
+ }
40102
40163
  this.options.agentSource = agentSource;
40103
40164
  this._cachedAgentInfo = null;
40104
40165
  this._cachedModelRequirements = null;
40166
+ this.precomputedModelRequirements = null;
40105
40167
  }
40106
40168
  /**
40107
40169
  * Get cached or parse agent information
@@ -40118,6 +40180,16 @@ class AgentLlmExecutionTools {
40118
40180
  * Note: [🐤] This is names `getModelRequirements` *(not `getAgentModelRequirements`)* because in future these two will be united
40119
40181
  */
40120
40182
  async getModelRequirements() {
40183
+ var _a, _b;
40184
+ if (this.precomputedModelRequirements !== null) {
40185
+ if (this.options.isVerbose) {
40186
+ console.info('[🤰]', 'Using precomputed agent model requirements', {
40187
+ agent: this.title,
40188
+ toolCount: (_b = (_a = this.precomputedModelRequirements.tools) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0,
40189
+ });
40190
+ }
40191
+ return this.precomputedModelRequirements;
40192
+ }
40121
40193
  if (this._cachedModelRequirements === null) {
40122
40194
  const preparationStartedAtMs = Date.now();
40123
40195
  if (this.options.isVerbose) {
@@ -40227,6 +40299,7 @@ class AgentLlmExecutionTools {
40227
40299
  * Resolves agent requirements, attachments, and runtime overrides into one forwarded chat prompt.
40228
40300
  */
40229
40301
  async prepareChatPrompt(prompt) {
40302
+ var _a;
40230
40303
  const chatPrompt = this.requireChatPrompt(prompt);
40231
40304
  const { sanitizedRequirements, promptSuffix } = await this.getSanitizedAgentModelRequirements();
40232
40305
  const attachments = normalizeChatAttachments(chatPrompt.attachments);
@@ -40244,7 +40317,16 @@ class AgentLlmExecutionTools {
40244
40317
  mergedTools,
40245
40318
  knowledgeSourcesForAgent,
40246
40319
  });
40247
- console.log('!!!! promptWithAgentModelRequirements:', forwardedPrompt);
40320
+ if (this.options.isVerbose) {
40321
+ console.info('[🤰]', 'Prepared agent chat prompt', {
40322
+ agent: this.title,
40323
+ usedPrecomputedModelRequirements: this.precomputedModelRequirements !== null,
40324
+ toolNames: mergedTools.map((tool) => tool.name),
40325
+ knowledgeSourcesCount: (_a = knowledgeSourcesForAgent === null || knowledgeSourcesForAgent === void 0 ? void 0 : knowledgeSourcesForAgent.length) !== null && _a !== void 0 ? _a : 0,
40326
+ promptSuffixLength: promptSuffix.length,
40327
+ systemMessageLength: sanitizedRequirements.systemMessage.length,
40328
+ });
40329
+ }
40248
40330
  return {
40249
40331
  forwardedPrompt,
40250
40332
  sanitizedRequirements,
@@ -40431,6 +40513,7 @@ class AgentLlmExecutionTools {
40431
40513
  * Runs one prepared prompt through the deprecated OpenAI Assistant backend.
40432
40514
  */
40433
40515
  async callOpenAiAssistantChatModelStream(options) {
40516
+ var _a, _b, _c, _d;
40434
40517
  const assistant = await this.getOrPrepareOpenAiAssistant({
40435
40518
  llmTools: options.llmTools,
40436
40519
  originalPrompt: options.originalPrompt,
@@ -40438,7 +40521,14 @@ class AgentLlmExecutionTools {
40438
40521
  onProgress: options.onProgress,
40439
40522
  });
40440
40523
  const promptWithAgentModelRequirementsForOpenAiAssistantExecutionTools = createOpenAiAssistantPrompt(options.preparedChatPrompt.forwardedPrompt);
40441
- console.log('!!!! promptWithAgentModelRequirementsForOpenAiAssistantExecutionTools:', promptWithAgentModelRequirementsForOpenAiAssistantExecutionTools);
40524
+ if (this.options.isVerbose) {
40525
+ console.info('[🤰]', 'Prepared OpenAI Assistant prompt', {
40526
+ agent: this.title,
40527
+ toolNames: (_b = (_a = promptWithAgentModelRequirementsForOpenAiAssistantExecutionTools.modelRequirements.tools) === null || _a === void 0 ? void 0 : _a.map((tool) => tool.name)) !== null && _b !== void 0 ? _b : [],
40528
+ knowledgeSourcesCount: (_d = (_c = promptWithAgentModelRequirementsForOpenAiAssistantExecutionTools.modelRequirements
40529
+ .knowledgeSources) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0,
40530
+ });
40531
+ }
40442
40532
  return assistant.callChatModelStream(promptWithAgentModelRequirementsForOpenAiAssistantExecutionTools, options.onProgress, options.streamOptions);
40443
40533
  }
40444
40534
  /**
@@ -41129,7 +41219,8 @@ class Agent extends AgentLlmExecutionTools {
41129
41219
  isVerbose: options.isVerbose,
41130
41220
  llmTools: getSingleLlmExecutionTools(options.executionTools.llm),
41131
41221
  assistantPreparationMode: options.assistantPreparationMode,
41132
- agentSource: agentSource.value, // <- TODO: [🐱‍🚀] Allow to pass BehaviorSubject<string_book> OR refresh llmExecutionTools.callChat on agentSource change
41222
+ agentSource: agentSource.value,
41223
+ precomputedModelRequirements: options.precomputedModelRequirements,
41133
41224
  });
41134
41225
  this._agentName = undefined;
41135
41226
  /**