@promptbook/remote-server 0.114.0-41 → 0.114.0-47

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 (103) hide show
  1. package/esm/index.es.js +43 -9
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/src/book-2.0/agent-source/CreateAgentModelRequirementsOptions.d.ts +2 -0
  4. package/esm/src/cli/cli-commands/coder/add.d.ts +16 -0
  5. package/esm/src/cli/cli-commands/coder/agentCliOptions.d.ts +3 -2
  6. package/esm/src/cli/cli-commands/coder/augmentCoderAgentTeam.d.ts +7 -0
  7. package/esm/src/cli/cli-commands/coder/coderAgentRole.d.ts +16 -0
  8. package/esm/src/cli/cli-commands/coder/coderReferencedArtifacts.d.ts +8 -7
  9. package/esm/src/cli/cli-commands/coder/ensureCoderDefaultAgentFiles.d.ts +8 -0
  10. package/esm/src/cli/cli-commands/coder/ensureCoderDefaultAgentFiles.test.d.ts +1 -0
  11. package/esm/src/cli/cli-commands/coder/ensureCoderRoleAgentFile.d.ts +12 -0
  12. package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +1 -1
  13. package/esm/src/cli/cli-commands/coder/getCoderInitializationCommitPaths.d.ts +9 -0
  14. package/esm/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +7 -5
  15. package/esm/src/cli/cli-commands/coder/plan.d.ts +7 -0
  16. package/esm/src/cli/cli-commands/coder/planning/assertPlanningCommitSafe.d.ts +6 -0
  17. package/esm/src/cli/cli-commands/coder/planning/assertPlanningPrdCommitScope.d.ts +7 -0
  18. package/esm/src/cli/cli-commands/coder/planning/assertPlanningRuntimePath.d.ts +6 -0
  19. package/esm/src/cli/cli-commands/coder/planning/createPlanningTerminal.d.ts +8 -0
  20. package/esm/src/cli/cli-commands/coder/planning/createPlanningTerminal.test.d.ts +1 -0
  21. package/esm/src/cli/cli-commands/coder/planning/createPlanningWorkspace.d.ts +11 -0
  22. package/esm/src/cli/cli-commands/coder/planning/discussPlanningTurn.d.ts +15 -0
  23. package/esm/src/cli/cli-commands/coder/planning/fixtures/snapshotPlanningProject.d.ts +5 -0
  24. package/esm/src/cli/cli-commands/coder/planning/planningGitSync.test.d.ts +1 -0
  25. package/esm/src/cli/cli-commands/coder/planning/planningPackagedCli.test.d.ts +1 -0
  26. package/esm/src/cli/cli-commands/coder/planning/planningProtocol.d.ts +152 -0
  27. package/esm/src/cli/cli-commands/coder/planning/planningTeam.test.d.ts +1 -0
  28. package/esm/src/cli/cli-commands/coder/planning/preparePlanningChanges.d.ts +16 -0
  29. package/esm/src/cli/cli-commands/coder/planning/readPlanningContext.d.ts +6 -0
  30. package/esm/src/cli/cli-commands/coder/planning/resolvePlanningPath.d.ts +7 -0
  31. package/esm/src/cli/cli-commands/coder/planning/runPlanningHarness.d.ts +30 -0
  32. package/esm/src/cli/cli-commands/coder/planning/runPlanningHarness.test.d.ts +1 -0
  33. package/esm/src/cli/cli-commands/coder/planning/runPlanningSession.d.ts +21 -0
  34. package/esm/src/cli/cli-commands/coder/planning/runPlanningSession.test.d.ts +1 -0
  35. package/esm/src/cli/cli-commands/coder/planning/savePlanningChanges.d.ts +7 -0
  36. package/esm/src/cli/cli-commands/coder/printInitializationSummary.d.ts +2 -1
  37. package/esm/src/cli/cli-commands/coder/promptsReadmeTemplate.d.ts +13 -0
  38. package/esm/src/cli/cli-commands/coder/promptsReadmeTemplate.test.d.ts +1 -0
  39. package/esm/src/cli/cli-commands/coder/readCoderAgentBook.d.ts +8 -0
  40. package/esm/src/cli/cli-commands/coder/workspacePreflight.test.d.ts +1 -0
  41. package/esm/src/cli/cli-commands/coder.d.ts +1 -0
  42. package/esm/src/cli/cli-commands/common/LocalAgentBookCollection.d.ts +4 -2
  43. package/esm/src/cli/cli-commands/common/coderGitSyncCliOptions.d.ts +1 -1
  44. package/esm/src/cli/cli-commands/common/resolveLocalAgentSource.d.ts +8 -1
  45. package/esm/src/cli/cli-commands/common/validateCoderRunOptions.d.ts +6 -0
  46. package/esm/src/cli/cli-commands/common/workspaceRepository.d.ts +36 -0
  47. package/esm/src/cli/cli-commands/common/workspaceRepository.test.d.ts +1 -0
  48. package/esm/src/cli/cli-commands/common/workspaceRepositoryCliOptions.d.ts +11 -0
  49. package/esm/src/commitments/TEAM/TEAM.test.d.ts +1 -0
  50. package/esm/src/conversion/archive/loadJsZipModule.d.ts +10 -0
  51. package/esm/src/version.d.ts +1 -1
  52. package/package.json +2 -2
  53. package/umd/index.umd.js +43 -9
  54. package/umd/index.umd.js.map +1 -1
  55. package/umd/src/book-2.0/agent-source/CreateAgentModelRequirementsOptions.d.ts +2 -0
  56. package/umd/src/cli/cli-commands/coder/add.d.ts +16 -0
  57. package/umd/src/cli/cli-commands/coder/agentCliOptions.d.ts +3 -2
  58. package/umd/src/cli/cli-commands/coder/augmentCoderAgentTeam.d.ts +7 -0
  59. package/umd/src/cli/cli-commands/coder/coderAgentRole.d.ts +16 -0
  60. package/umd/src/cli/cli-commands/coder/coderReferencedArtifacts.d.ts +8 -7
  61. package/umd/src/cli/cli-commands/coder/ensureCoderDefaultAgentFiles.d.ts +8 -0
  62. package/umd/src/cli/cli-commands/coder/ensureCoderDefaultAgentFiles.test.d.ts +1 -0
  63. package/umd/src/cli/cli-commands/coder/ensureCoderRoleAgentFile.d.ts +12 -0
  64. package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +1 -1
  65. package/umd/src/cli/cli-commands/coder/getCoderInitializationCommitPaths.d.ts +9 -0
  66. package/umd/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +7 -5
  67. package/umd/src/cli/cli-commands/coder/plan.d.ts +7 -0
  68. package/umd/src/cli/cli-commands/coder/planning/assertPlanningCommitSafe.d.ts +6 -0
  69. package/umd/src/cli/cli-commands/coder/planning/assertPlanningPrdCommitScope.d.ts +7 -0
  70. package/umd/src/cli/cli-commands/coder/planning/assertPlanningRuntimePath.d.ts +6 -0
  71. package/umd/src/cli/cli-commands/coder/planning/createPlanningTerminal.d.ts +8 -0
  72. package/umd/src/cli/cli-commands/coder/planning/createPlanningTerminal.test.d.ts +1 -0
  73. package/umd/src/cli/cli-commands/coder/planning/createPlanningWorkspace.d.ts +11 -0
  74. package/umd/src/cli/cli-commands/coder/planning/discussPlanningTurn.d.ts +15 -0
  75. package/umd/src/cli/cli-commands/coder/planning/fixtures/snapshotPlanningProject.d.ts +5 -0
  76. package/umd/src/cli/cli-commands/coder/planning/planningGitSync.test.d.ts +1 -0
  77. package/umd/src/cli/cli-commands/coder/planning/planningPackagedCli.test.d.ts +1 -0
  78. package/umd/src/cli/cli-commands/coder/planning/planningProtocol.d.ts +152 -0
  79. package/umd/src/cli/cli-commands/coder/planning/planningTeam.test.d.ts +1 -0
  80. package/umd/src/cli/cli-commands/coder/planning/preparePlanningChanges.d.ts +16 -0
  81. package/umd/src/cli/cli-commands/coder/planning/readPlanningContext.d.ts +6 -0
  82. package/umd/src/cli/cli-commands/coder/planning/resolvePlanningPath.d.ts +7 -0
  83. package/umd/src/cli/cli-commands/coder/planning/runPlanningHarness.d.ts +30 -0
  84. package/umd/src/cli/cli-commands/coder/planning/runPlanningHarness.test.d.ts +1 -0
  85. package/umd/src/cli/cli-commands/coder/planning/runPlanningSession.d.ts +21 -0
  86. package/umd/src/cli/cli-commands/coder/planning/runPlanningSession.test.d.ts +1 -0
  87. package/umd/src/cli/cli-commands/coder/planning/savePlanningChanges.d.ts +7 -0
  88. package/umd/src/cli/cli-commands/coder/printInitializationSummary.d.ts +2 -1
  89. package/umd/src/cli/cli-commands/coder/promptsReadmeTemplate.d.ts +13 -0
  90. package/umd/src/cli/cli-commands/coder/promptsReadmeTemplate.test.d.ts +1 -0
  91. package/umd/src/cli/cli-commands/coder/readCoderAgentBook.d.ts +8 -0
  92. package/umd/src/cli/cli-commands/coder/workspacePreflight.test.d.ts +1 -0
  93. package/umd/src/cli/cli-commands/coder.d.ts +1 -0
  94. package/umd/src/cli/cli-commands/common/LocalAgentBookCollection.d.ts +4 -2
  95. package/umd/src/cli/cli-commands/common/coderGitSyncCliOptions.d.ts +1 -1
  96. package/umd/src/cli/cli-commands/common/resolveLocalAgentSource.d.ts +8 -1
  97. package/umd/src/cli/cli-commands/common/validateCoderRunOptions.d.ts +6 -0
  98. package/umd/src/cli/cli-commands/common/workspaceRepository.d.ts +36 -0
  99. package/umd/src/cli/cli-commands/common/workspaceRepository.test.d.ts +1 -0
  100. package/umd/src/cli/cli-commands/common/workspaceRepositoryCliOptions.d.ts +11 -0
  101. package/umd/src/commitments/TEAM/TEAM.test.d.ts +1 -0
  102. package/umd/src/conversion/archive/loadJsZipModule.d.ts +10 -0
  103. package/umd/src/version.d.ts +1 -1
package/esm/index.es.js CHANGED
@@ -34,7 +34,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
34
34
  * @generated
35
35
  * @see https://github.com/webgptorg/promptbook
36
36
  */
37
- const PROMPTBOOK_ENGINE_VERSION = '0.114.0-41';
37
+ const PROMPTBOOK_ENGINE_VERSION = '0.114.0-47';
38
38
  /**
39
39
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
40
40
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -20215,6 +20215,18 @@ class TeamCommitmentDefinition extends BaseCommitmentDefinition {
20215
20215
 
20216
20216
  Registers teammate agents that the current agent can consult via tools.
20217
20217
 
20218
+ The primary agent sends a question and relevant context to a teammate and receives an attributed answer.
20219
+ Each teammate uses its own Book. Declaring a team makes advisers available when relevant; it does not
20220
+ merge their rules into the primary agent or start every teammate automatically.
20221
+
20222
+ In \`ptbk coder run\` and \`ptbk coder plan\`, TEAM entries in the selected Book, its ancestors and imports
20223
+ use the existing reference rules: \`@Name\`, \`{Agent Name}\`, \`{./lawyer.book}\`, project paths such as
20224
+ \`{agents/lawyer.book}\`, and HTTP(S) Book URLs. Local advisers require no Agents Server. A remote Book
20225
+ must be readable through its normal endpoint; private or inaccessible sources return errors.
20226
+ Coding harnesses expose scoped command tools; planning uses restricted host tools and currently requires
20227
+ OpenAI Codex. Planning restrictions apply to every adviser, including custom Developer Books.
20228
+ The primary agent retains responsibility for the task, PRD proposals and final output.
20229
+
20218
20230
  ## Examples
20219
20231
 
20220
20232
  \`\`\`book
@@ -20226,7 +20238,7 @@ class TeamCommitmentDefinition extends BaseCommitmentDefinition {
20226
20238
  `);
20227
20239
  }
20228
20240
  applyToAgentModelRequirements(requirements, content) {
20229
- var _a, _b, _c;
20241
+ var _a, _b, _c, _d;
20230
20242
  const trimmedContent = content.trim();
20231
20243
  if (!trimmedContent) {
20232
20244
  return requirements;
@@ -20240,20 +20252,30 @@ class TeamCommitmentDefinition extends BaseCommitmentDefinition {
20240
20252
  const existingTeammates = ((_b = requirements._metadata) === null || _b === void 0 ? void 0 : _b.teammates) || [];
20241
20253
  const preResolvedProfiles = (((_c = requirements._metadata) === null || _c === void 0 ? void 0 : _c.preResolvedTeammateProfiles) || {});
20242
20254
  const resolvedTeammates = resolveTeamTeammateLabels(trimmedContent, teammates);
20255
+ const toolUrls = new Map(existingTeammates.map((teammate) => [teammate.toolName, teammate.url]));
20243
20256
  const teamEntries = resolvedTeammates.map((teammate) => {
20244
20257
  const profile = preResolvedProfiles[teammate.url];
20245
20258
  const resolvedLabel = (profile === null || profile === void 0 ? void 0 : profile.agentName) || teammate.label;
20246
20259
  const existingTeammate = existingTeammates.find((entry) => entry.url === teammate.url);
20260
+ const baseToolName = (existingTeammate === null || existingTeammate === void 0 ? void 0 : existingTeammate.toolName) || createTeamToolName(teammate.url, resolvedLabel);
20261
+ let toolName = baseToolName;
20262
+ let suffix = 1;
20263
+ // Explicit paths can identify distinct Books with the same display name or normalized label.
20264
+ while (toolUrls.has(toolName) && toolUrls.get(toolName) !== teammate.url) {
20265
+ toolName = `${baseToolName}_${++suffix}`;
20266
+ }
20267
+ toolUrls.set(toolName, teammate.url);
20247
20268
  return {
20248
- toolName: ((existingTeammate === null || existingTeammate === void 0 ? void 0 : existingTeammate.toolName) ||
20249
- createTeamToolName(teammate.url, resolvedLabel)),
20269
+ toolName: toolName,
20250
20270
  teammate: { ...teammate, label: resolvedLabel },
20251
20271
  agentName,
20252
20272
  description: (profile === null || profile === void 0 ? void 0 : profile.personaDescription) || null,
20253
20273
  };
20254
20274
  });
20255
- for (const entry of teamEntries) {
20256
- registerTeamTool(entry);
20275
+ if (!((_d = requirements._metadata) === null || _d === void 0 ? void 0 : _d.isTeamToolRegistrationDisabled)) {
20276
+ for (const entry of teamEntries) {
20277
+ registerTeamTool(entry);
20278
+ }
20257
20279
  }
20258
20280
  const existingTools = requirements.tools || [];
20259
20281
  const updatedTools = [...existingTools];
@@ -30441,9 +30463,15 @@ async function preResolveTeammateProfilesForTeamCommitment(requirements, commitm
30441
30463
  if (preResolvedTeammateProfiles[teammate.url]) {
30442
30464
  continue;
30443
30465
  }
30444
- const profile = await profileResolver.resolveTeammateProfile(teammate.url);
30445
- if (profile) {
30446
- preResolvedTeammateProfiles[teammate.url] = profile;
30466
+ try {
30467
+ const profile = await profileResolver.resolveTeammateProfile(teammate.url);
30468
+ if (profile) {
30469
+ preResolvedTeammateProfiles[teammate.url] = profile;
30470
+ }
30471
+ }
30472
+ catch (error) {
30473
+ // One inaccessible adviser must not erase the names and roles of other callable teammates.
30474
+ console.warn(`Failed to resolve TEAM profile for ${teammate.url}:`, error);
30447
30475
  }
30448
30476
  }
30449
30477
  return {
@@ -31390,6 +31418,12 @@ async function createAgentModelRequirementsWithCommitments(agentSource, modelNam
31390
31418
  const parseResult = parseAgentSourceWithCommitments(agentSource);
31391
31419
  const filteredCommitments = filterCommitmentsForAgentModelRequirements(parseResult.commitments);
31392
31420
  let requirements = createInitialAgentModelRequirements(parseResult.agentName, modelName);
31421
+ if (options === null || options === void 0 ? void 0 : options.isTeamToolRegistrationDisabled) {
31422
+ requirements = {
31423
+ ...requirements,
31424
+ _metadata: { ...requirements._metadata, isTeamToolRegistrationDisabled: true },
31425
+ };
31426
+ }
31393
31427
  requirements = await applyCommitmentsToAgentModelRequirements(requirements, filteredCommitments, options);
31394
31428
  requirements = await augmentAgentModelRequirementsFromSource(requirements, parseResult, agentSource);
31395
31429
  requirements = await materializeInlineKnowledgeSources(requirements, options === null || options === void 0 ? void 0 : options.inlineKnowledgeSourceUploader);