@promptbook/cli 0.113.0-5 → 0.113.0-6

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 (36) hide show
  1. package/apps/agents-server/src/app/agents/[agentName]/api/book/route.ts +13 -1
  2. package/apps/agents-server/src/search/createDefaultServerSearchProviders/loadLocalOrganizationSearchDataset.ts +12 -1
  3. package/apps/agents-server/src/utils/agentOrganization/loadAgentOrganizationState.ts +13 -1
  4. package/apps/agents-server/src/utils/createLocalAgentSourceImporter.ts +159 -0
  5. package/apps/agents-server/src/utils/createMissingImportedAgentFallback.ts +60 -0
  6. package/apps/agents-server/src/utils/customDomainRouting.ts +157 -12
  7. package/apps/agents-server/src/utils/externalChatRunner/processExternalUserChatJob.ts +1 -1
  8. package/apps/agents-server/src/utils/importAgentWithFallback.ts +1 -58
  9. package/apps/agents-server/src/utils/localAgentRouteReferences.ts +167 -0
  10. package/apps/agents-server/src/utils/localChatRunner/processLocalUserChatJob.ts +1 -1
  11. package/apps/agents-server/src/utils/managementApi/managementApiAgents.ts +17 -3
  12. package/apps/agents-server/src/utils/resolveAgentStateFromSource.ts +7 -1
  13. package/apps/agents-server/src/utils/resolveInheritedAgentSource.ts +54 -5
  14. package/apps/agents-server/src/utils/resolveServerAgentContext.ts +12 -1
  15. package/apps/agents-server/src/utils/resolveStoredAgentState.ts +2 -1
  16. package/apps/agents-server/src/utils/userChat/userChatMessageLifecycle.ts +39 -9
  17. package/apps/agents-server/tests/e2e/support/ChatHistoryNavigationSupport.ts +5 -0
  18. package/esm/index.es.js +24 -36
  19. package/esm/index.es.js.map +1 -1
  20. package/esm/src/version.d.ts +1 -1
  21. package/package.json +1 -1
  22. package/src/avatars/avatarAnimationScheduler.ts +2 -1
  23. package/src/avatars/visuals/octopus3d3AvatarVisual.ts +6 -2
  24. package/src/avatars/visuals/octopus3d4AvatarVisual.ts +14 -18
  25. package/src/cli/cli-commands/agents-server/buildAgentsServer.ts +3 -1
  26. package/src/cli/cli-commands/coder/boilerplateTemplates.ts +14 -21
  27. package/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.ts +1 -4
  28. package/src/cli/cli-commands/coder/run.ts +2 -9
  29. package/src/commitments/TEAM/TEAM.ts +5 -5
  30. package/src/other/templates/getTemplatesPipelineCollection.ts +845 -662
  31. package/src/utils/ascii-art/convertImageDataToAsciiArt.ts +1 -4
  32. package/src/version.ts +2 -2
  33. package/src/versions.txt +1 -0
  34. package/umd/index.umd.js +24 -36
  35. package/umd/index.umd.js.map +1 -1
  36. package/umd/src/version.d.ts +1 -1
@@ -385,10 +385,7 @@ function mapColorToAnsi256(color: HalfCellColor): number {
385
385
  if (gray > ANSI_256_NEAR_WHITE_GRAY_LEVEL) {
386
386
  return ANSI_256_WHITE_INDEX; // <- Note: Pure white lives in the color cube
387
387
  }
388
- return (
389
- 232 +
390
- Math.round(((gray - 8) / ANSI_256_GRAYSCALE_RAMP_MAX_LEVEL) * ANSI_256_GRAYSCALE_RAMP_INDEX_SPAN)
391
- );
388
+ return 232 + Math.round(((gray - 8) / ANSI_256_GRAYSCALE_RAMP_MAX_LEVEL) * ANSI_256_GRAYSCALE_RAMP_INDEX_SPAN);
392
389
  }
393
390
 
394
391
  const redIndex = Math.round((red / 255) * 5);
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.113.0-5';
19
+ export const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version = '0.113.0-6';
20
20
 
21
21
  /**
22
22
  * Represents the version string of the Promptbook engine.
23
- * It follows semantic versioning (e.g., `0.113.0-4`).
23
+ * It follows semantic versioning (e.g., `0.113.0-5`).
24
24
  *
25
25
  * @generated
26
26
  */
package/src/versions.txt CHANGED
@@ -1171,3 +1171,4 @@
1171
1171
  0.113.0-3
1172
1172
  0.113.0-4
1173
1173
  0.113.0-5
1174
+ 0.113.0-6
package/umd/index.umd.js CHANGED
@@ -63,7 +63,7 @@
63
63
  * @generated
64
64
  * @see https://github.com/webgptorg/promptbook
65
65
  */
66
- const PROMPTBOOK_ENGINE_VERSION = '0.113.0-5';
66
+ const PROMPTBOOK_ENGINE_VERSION = '0.113.0-6';
67
67
  /**
68
68
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
69
69
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -14668,7 +14668,7 @@
14668
14668
  isAnimated: true,
14669
14669
  supportsPointerTracking: true,
14670
14670
  render({ context, size, palette, createRandom, timeMs, interaction }) {
14671
- const { morphologyProfile, animationPhase, leftEyePhaseOffset, rightEyePhaseOffset, tentacleProfiles, skinSpots } = getOctopus3d4StableState(createRandom);
14671
+ const { morphologyProfile, animationPhase, leftEyePhaseOffset, rightEyePhaseOffset, tentacleProfiles, skinSpots, } = getOctopus3d4StableState(createRandom);
14672
14672
  const sceneCenterX = size * 0.5;
14673
14673
  const sceneCenterY = size * 0.535;
14674
14674
  const bob = Math.sin(timeMs / 980 + animationPhase) * size * 0.013;
@@ -15016,10 +15016,7 @@
15016
15016
  Math.max(0, Math.cos(effectiveLongitude)) * 0.12 +
15017
15017
  lowerBlend * tentacleInfluence.core * (0.12 + tentacleInfluence.depthScale * 0.07) -
15018
15018
  Math.max(0, -Math.cos(effectiveLongitude)) * 0.05;
15019
- const tentacleTubeRadius = lowerBlend *
15020
- tentacleInfluence.core *
15021
- (0.12 + tipBlend * 0.07 + tentacleInfluence.widthScale * 0.028) *
15022
- radiusX;
15019
+ const tentacleTubeRadius = lowerBlend * tentacleInfluence.core * (0.12 + tipBlend * 0.07 + tentacleInfluence.widthScale * 0.028) * radiusX;
15023
15020
  const planarRadiusX = cosineLatitude * radiusX * horizontalScale + tentacleTubeRadius;
15024
15021
  const planarRadiusZ = cosineLatitude * radiusZ * depthScale + tentacleTubeRadius * 0.74;
15025
15022
  const lowerDrop = lowerBlend *
@@ -15031,9 +15028,7 @@
15031
15028
  (morphologyProfile.tentacles.flowLengthScale - 1) * 0.1));
15032
15029
  const combinedTentacleSway = (primaryTentacleWave + secondaryTentacleWave) * radiusX * (0.06 + tipBlend * 0.06);
15033
15030
  return {
15034
- x: Math.sin(effectiveLongitude) * planarRadiusX +
15035
- combinedTentacleSway +
15036
- tentacleCurl * radiusX * 0.18,
15031
+ x: Math.sin(effectiveLongitude) * planarRadiusX + combinedTentacleSway + tentacleCurl * radiusX * 0.18,
15037
15032
  y: Math.sin(latitude) * radiusY * (1 + upperBlend * 0.14) -
15038
15033
  upperBlend * radiusY * 0.12 +
15039
15034
  lowerDrop +
@@ -18292,10 +18287,10 @@
18292
18287
  *
18293
18288
  * @private
18294
18289
  */
18295
- const TEAM_SYSTEM_MESSAGE_GUIDANCE_LINES = [
18296
- '- If a teammate is relevant to the request, consult that teammate using the matching tool.',
18297
- '- Do not ask the user for information that a listed teammate can provide directly.',
18298
- ];
18290
+ const TEAM_SYSTEM_MESSAGE_GUIDANCE = _spaceTrim.spaceTrim(`
18291
+ - If a teammate is relevant to the request, consult that teammate using the matching tool.
18292
+ - Do not ask the user for information that a listed teammate can provide directly.
18293
+ `);
18299
18294
  /**
18300
18295
  * Constant for remote agents by Url.
18301
18296
  */
@@ -18477,7 +18472,7 @@
18477
18472
  `);
18478
18473
  });
18479
18474
  return _spaceTrim.spaceTrim((block) => `
18480
- ${block(TEAM_SYSTEM_MESSAGE_GUIDANCE_LINES.join('\n'))}
18475
+ ${block(TEAM_SYSTEM_MESSAGE_GUIDANCE)}
18481
18476
 
18482
18477
  ${block(teammateSections.join('\n\n'))}
18483
18478
  `);
@@ -40404,26 +40399,26 @@
40404
40399
  id: 'common',
40405
40400
  relativeFilePath: path.join(PROMPTS_TEMPLATES_DIRECTORY_PATH, 'common.md'),
40406
40401
  slugPrefix: null,
40407
- content: buildCoderPromptTemplateContent([
40408
- '- @@@',
40409
- "- Keep in mind the DRY _(don't repeat yourself)_ principle.",
40410
- '- Do a proper analysis of the current functionality before you start implementing.',
40411
- '- Add the changes into the [changelog](changelog/_current-preversion.md)',
40412
- ]),
40402
+ content: _spaceTrim.spaceTrim(`
40403
+ - @@@
40404
+ - Keep in mind the DRY _(don't repeat yourself)_ principle.
40405
+ - Do a proper analysis of the current functionality before you start implementing.
40406
+ - Add the changes into the [changelog](changelog/_current-preversion.md)
40407
+ `),
40413
40408
  isDefaultProjectTemplate: true,
40414
40409
  },
40415
40410
  {
40416
40411
  id: 'agents-server',
40417
40412
  relativeFilePath: path.join(PROMPTS_TEMPLATES_DIRECTORY_PATH, 'agents-server.md'),
40418
40413
  slugPrefix: 'agents-server',
40419
- content: buildCoderPromptTemplateContent([
40420
- '- @@@',
40421
- "- Keep in mind the DRY _(don't repeat yourself)_ principle.",
40422
- '- Do a proper analysis of the current functionality before you start implementing.',
40423
- '- You are working with the [Agents Server](apps/agents-server)',
40424
- '- If you need to do the database migration, do it',
40425
- '- Add the changes into the [changelog](changelog/_current-preversion.md)',
40426
- ]),
40414
+ content: _spaceTrim.spaceTrim(`
40415
+ - @@@
40416
+ - Keep in mind the DRY _(don't repeat yourself)_ principle.
40417
+ - Do a proper analysis of the current functionality before you start implementing.
40418
+ - You are working with the [Agents Server](apps/agents-server)
40419
+ - If you need to do the database migration, do it
40420
+ - Add the changes into the [changelog](changelog/_current-preversion.md)
40421
+ `),
40427
40422
  isDefaultProjectTemplate: false,
40428
40423
  },
40429
40424
  ];
@@ -40543,12 +40538,6 @@
40543
40538
  function getDefaultCoderPromptTemplateDefinitionOrUndefined(template) {
40544
40539
  return DEFAULT_CODER_PROMPT_TEMPLATE_DEFINITIONS.find((definition) => definition.id === template);
40545
40540
  }
40546
- /**
40547
- * Builds stable markdown content for one coder prompt template without indentation drift.
40548
- */
40549
- function buildCoderPromptTemplateContent(lines) {
40550
- return lines.join('\n');
40551
- }
40552
40541
  /**
40553
40542
  * Creates a fully resolved template payload from one built-in definition.
40554
40543
  */
@@ -71942,8 +71931,7 @@
71942
71931
  if (gray > ANSI_256_NEAR_WHITE_GRAY_LEVEL) {
71943
71932
  return ANSI_256_WHITE_INDEX; // <- Note: Pure white lives in the color cube
71944
71933
  }
71945
- return (232 +
71946
- Math.round(((gray - 8) / ANSI_256_GRAYSCALE_RAMP_MAX_LEVEL) * ANSI_256_GRAYSCALE_RAMP_INDEX_SPAN));
71934
+ return 232 + Math.round(((gray - 8) / ANSI_256_GRAYSCALE_RAMP_MAX_LEVEL) * ANSI_256_GRAYSCALE_RAMP_INDEX_SPAN);
71947
71935
  }
71948
71936
  const redIndex = Math.round((red / 255) * 5);
71949
71937
  const greenIndex = Math.round((green / 255) * 5);