@promptbook/cli 0.114.0-50 → 0.114.0-51

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.
Files changed (44) hide show
  1. package/apps/agents-server/README.md +2 -0
  2. package/apps/agents-server/src/app/AddAgentButton.tsx +4 -1
  3. package/apps/agents-server/src/app/dashboard/page.tsx +1 -0
  4. package/apps/agents-server/src/app/page.tsx +6 -7
  5. package/apps/agents-server/src/components/Header/Header.tsx +1 -0
  6. package/apps/agents-server/src/components/Header/useHeaderAgentMenus.tsx +5 -7
  7. package/apps/agents-server/src/components/Homepage/AgentsList.tsx +4 -1
  8. package/apps/agents-server/src/components/Homepage/AgentsListListView.tsx +4 -1
  9. package/apps/agents-server/src/components/Homepage/HomepagePrimarySections.tsx +4 -0
  10. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/ManGoNewAgentWizard.tsx +15 -7
  11. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/README.md +36 -0
  12. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/EmailTestRun.tsx +25 -53
  13. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/TestChat.tsx +23 -6
  14. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/steps/BookStep.tsx +16 -36
  15. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/steps/DoneStep.tsx +16 -55
  16. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/steps/KnowledgeStep.tsx +19 -48
  17. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/steps/TestStep.tsx +23 -88
  18. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/steps/ZadaniStep.tsx +11 -2
  19. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/agentEvalService.ts +9 -6
  20. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/agentTestService.ts +11 -7
  21. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/bookService.ts +15 -8
  22. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/postManGoOnboardingJson.ts +2 -0
  23. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/uploadService.ts +2 -2
  24. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/state/OnboardingProvider.tsx +24 -97
  25. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/state/createInitialOnboardingState.ts +28 -0
  26. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/state/createOnboardingActions.ts +262 -0
  27. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/state/createOnboardingSession.ts +168 -0
  28. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/state/retireLegacyOnboardingSnapshot.ts +14 -0
  29. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/state/runOnboardingOperation.ts +29 -0
  30. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/types.ts +27 -2
  31. package/apps/agents-server/src/components/NewAgentDialog/useNewAgentDialog.tsx +178 -58
  32. package/apps/agents-server/tests/e2e/e2eEnvironment.cjs +3 -0
  33. package/esm/index.es.js +36 -11
  34. package/esm/index.es.js.map +1 -1
  35. package/esm/scripts/verify-prompts/verify-prompts.d.ts +5 -0
  36. package/esm/src/version.d.ts +1 -1
  37. package/package.json +1 -1
  38. package/src/other/templates/getTemplatesPipelineCollection.ts +1133 -1530
  39. package/src/version.ts +2 -2
  40. package/src/versions.txt +1 -0
  41. package/umd/index.umd.js +36 -11
  42. package/umd/index.umd.js.map +1 -1
  43. package/umd/scripts/verify-prompts/verify-prompts.d.ts +5 -0
  44. package/umd/src/version.d.ts +1 -1
package/src/version.ts CHANGED
@@ -16,11 +16,11 @@ export const BOOK_LANGUAGE_VERSION: string_semantic_version = '2.0.0';
16
16
  * @generated
17
17
  * @see https://github.com/webgptorg/promptbook
18
18
  */
19
- export const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version = '0.114.0-50';
19
+ export const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version = '0.114.0-51';
20
20
 
21
21
  /**
22
22
  * Represents the version string of the Promptbook engine.
23
- * It follows semantic versioning (e.g., `0.114.0-49`).
23
+ * It follows semantic versioning (e.g., `0.114.0-50`).
24
24
  *
25
25
  * @generated
26
26
  */
package/src/versions.txt CHANGED
@@ -1225,3 +1225,4 @@
1225
1225
  0.114.0-48
1226
1226
  0.114.0-49
1227
1227
  0.114.0-50
1228
+ 0.114.0-51
package/umd/index.umd.js CHANGED
@@ -58,7 +58,7 @@
58
58
  * @generated
59
59
  * @see https://github.com/webgptorg/promptbook
60
60
  */
61
- const PROMPTBOOK_ENGINE_VERSION = '0.114.0-50';
61
+ const PROMPTBOOK_ENGINE_VERSION = '0.114.0-51';
62
62
  /**
63
63
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
64
64
  * Note: [šŸ’ž] Ignore a discrepancy between file name and entity name
@@ -50202,7 +50202,7 @@
50202
50202
  }
50203
50203
  // Note: [šŸ’ž] Ignore a discrepancy between file name and exported helper names
50204
50204
 
50205
- /** Shared repository mutation lease, outside the working tree and therefore outside every commit scope. */
50205
+ /** Shared repository mutation lease kept in Promptbook-owned temporary storage. */
50206
50206
  const CODER_WORKSPACE_LOCK_FILENAME = 'ptbk-coder-workspace.lock';
50207
50207
  /** Nested common lifecycle services reuse only the lease owned by this asynchronous job. */
50208
50208
  const WORKSPACE_OWNERSHIP = new async_hooks.AsyncLocalStorage();
@@ -50213,11 +50213,13 @@
50213
50213
  */
50214
50214
  async function withCoderWorkspaceLock(project, operation, options) {
50215
50215
  const workspace = typeof project === 'string' ? await $resolveWorkspaceRepository(project) : project;
50216
- if (!workspace.gitDirectory) {
50216
+ if (!workspace.repositoryRoot) {
50217
50217
  // Direct-script callers retain their existing Git validation; CLI mutation preflight always supplies Git.
50218
50218
  return operation();
50219
50219
  }
50220
- const lockPath = path.join(workspace.gitDirectory, CODER_WORKSPACE_LOCK_FILENAME);
50220
+ // Projects in the same checkout share ownership; linked worktrees have their own checkout root.
50221
+ const lockDirectory = resolvePromptbookTemporaryPath(workspace.repositoryRoot, 'ptbk-coder');
50222
+ const lockPath = path.join(lockDirectory, CODER_WORKSPACE_LOCK_FILENAME);
50221
50223
  const ownedLocks = WORKSPACE_OWNERSHIP.getStore();
50222
50224
  const ownedLock = ownedLocks === null || ownedLocks === void 0 ? void 0 : ownedLocks.get(lockPath);
50223
50225
  if ((options === null || options === void 0 ? void 0 : options.isNestedOwnershipAllowed) && ownedLock) {
@@ -50233,6 +50235,7 @@
50233
50235
  }
50234
50236
  const token = crypto.randomBytes(16).toString('hex');
50235
50237
  let handle;
50238
+ await promises.mkdir(lockDirectory, { recursive: true });
50236
50239
  try {
50237
50240
  handle = await promises.open(lockPath, 'wx');
50238
50241
  }
@@ -50251,6 +50254,13 @@
50251
50254
  }
50252
50255
  try {
50253
50256
  await handle.writeFile(JSON.stringify({ token, processId: process.pid, projectPath: workspace.projectPath }));
50257
+ // Keep the lock out of clean-tree checks and commit scopes even without project-level ignore rules.
50258
+ // Initialize these rules only while owning the lease, so competing workers cannot rewrite them.
50259
+ await ensureProjectGitignoreFile({
50260
+ projectPath: lockDirectory,
50261
+ blockHeader: '# Promptbook Coder workspace lock',
50262
+ rules: [`/${CODER_WORKSPACE_LOCK_FILENAME}`, '/.gitignore'],
50263
+ });
50254
50264
  return await WORKSPACE_OWNERSHIP.run(new Map([...(ownedLocks !== null && ownedLocks !== void 0 ? ownedLocks : []), [lockPath, { isNestedActivityActive: false }]]), operation);
50255
50265
  }
50256
50266
  finally {
@@ -91233,12 +91243,17 @@
91233
91243
  continue;
91234
91244
  }
91235
91245
  // Second priority: process todo prompts
91236
- const nextPrompt = findNextTodoPrompt(promptFiles);
91246
+ const nextPrompt = findNextTodoPromptToVerify(promptFiles, skippedFiles);
91237
91247
  if (!nextPrompt) {
91238
- console.info(colors__default["default"].green('\nāœ… All prompts have been verified.'));
91248
+ console.info(colors__default["default"].green(skippedFiles.size === 0
91249
+ ? '\nāœ… All prompts have been verified.'
91250
+ : '\nāœ… All prompts have been verified, except the skipped ones.'));
91239
91251
  break;
91240
91252
  }
91241
91253
  const outcome = await resolvePrompt(nextPrompt);
91254
+ if (outcome.wasSkipped) {
91255
+ skippedFiles.add(nextPrompt.file.path);
91256
+ }
91242
91257
  await $commitVerificationOutcome(normalizedOptions.gitSync, commitScope, outcome);
91243
91258
  promptFiles = (await loadPromptFilesForVerification(normalizedOptions)).promptFiles;
91244
91259
  }
@@ -91578,6 +91593,12 @@
91578
91593
  console.info(colors__default["default"].green(' All files have been verified!'));
91579
91594
  }
91580
91595
  }
91596
+ /**
91597
+ * Finds the next todo prompt to ask about, excluding files that have been skipped in this session.
91598
+ */
91599
+ function findNextTodoPromptToVerify(promptFiles, skippedFiles) {
91600
+ return findNextTodoPrompt(promptFiles.filter((file) => !skippedFiles.has(file.path)));
91601
+ }
91581
91602
  /**
91582
91603
  * Resolves a single prompt section by asking the user for its status.
91583
91604
  */
@@ -91588,8 +91609,11 @@
91588
91609
  await archivePromptFile(selection.file);
91589
91610
  return { wasSkipped: false, commitMessage: buildArchiveCommitMessage(selection.file) };
91590
91611
  }
91591
- await appendRepairPrompt(selection.file, selection.section);
91592
- return { wasSkipped: false, commitMessage: buildRepairCommitMessage(selection.file) };
91612
+ // Note: A `[ ]` section has not been run yet, so a `Fix` prompt for it would describe work that never happened.
91613
+ // The section stays in the queue unchanged and its file is skipped for the rest of this run,
91614
+ // otherwise the same section is offered again on every iteration of the loop
91615
+ console.info(colors__default["default"].gray('\nā© Kept in the queue, no changes made.'));
91616
+ return { wasSkipped: true, commitMessage: null };
91593
91617
  }
91594
91618
  /**
91595
91619
  * Presents the interactive decision menu for the current prompt section.
@@ -91608,9 +91632,9 @@
91608
91632
  // description: 'Move this file under prompts/done',
91609
91633
  },
91610
91634
  {
91611
- title: 'šŸ› ļø Not done - add follow-up prompt',
91635
+ title: 'ā© Not done - keep it in the queue',
91612
91636
  value: 'not-done',
91613
- // description: 'Append a Fix prompt referencing the previous section',
91637
+ // description: 'Leave the prompt unchanged and skip this file for the rest of the run',
91614
91638
  },
91615
91639
  ],
91616
91640
  initial: 0,
@@ -91747,7 +91771,8 @@
91747
91771
  var verifyPrompts$1 = /*#__PURE__*/Object.freeze({
91748
91772
  __proto__: null,
91749
91773
  verifyPrompts: verifyPrompts,
91750
- partitionPromptFilesByIgnore: partitionPromptFilesByIgnore
91774
+ partitionPromptFilesByIgnore: partitionPromptFilesByIgnore,
91775
+ findNextTodoPromptToVerify: findNextTodoPromptToVerify
91751
91776
  });
91752
91777
 
91753
91778
  exports.BOOK_LANGUAGE_VERSION = BOOK_LANGUAGE_VERSION;