@promptbook/wizard 0.104.0-10 → 0.104.0-11

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 (27) hide show
  1. package/esm/index.es.js +53 -2
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/typings/src/_packages/types.index.d.ts +6 -0
  4. package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +23 -0
  5. package/esm/typings/src/book-components/Chat/types/ChatMessage.d.ts +2 -2
  6. package/esm/typings/src/book-components/_common/Dropdown/Dropdown.d.ts +1 -1
  7. package/esm/typings/src/book-components/_common/HamburgerMenu/HamburgerMenu.d.ts +1 -1
  8. package/esm/typings/src/book-components/icons/AboutIcon.d.ts +1 -1
  9. package/esm/typings/src/book-components/icons/AttachmentIcon.d.ts +1 -1
  10. package/esm/typings/src/book-components/icons/CameraIcon.d.ts +1 -1
  11. package/esm/typings/src/book-components/icons/DownloadIcon.d.ts +1 -1
  12. package/esm/typings/src/book-components/icons/MenuIcon.d.ts +1 -1
  13. package/esm/typings/src/book-components/icons/SaveIcon.d.ts +1 -1
  14. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +2 -2
  15. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema.d.ts +0 -54
  16. package/esm/typings/src/llm-providers/_common/utils/count-total-usage/countUsage.d.ts +1 -1
  17. package/esm/typings/src/llm-providers/agent/Agent.d.ts +6 -1
  18. package/esm/typings/src/remote-server/ui/ServerApp.d.ts +1 -1
  19. package/esm/typings/src/search-engines/SearchEngine.d.ts +9 -0
  20. package/esm/typings/src/search-engines/SearchResult.d.ts +18 -0
  21. package/esm/typings/src/search-engines/bing/BingSearchEngine.d.ts +15 -0
  22. package/esm/typings/src/search-engines/dummy/DummySearchEngine.d.ts +15 -0
  23. package/esm/typings/src/utils/random/$randomAgentPersona.d.ts +3 -2
  24. package/esm/typings/src/version.d.ts +1 -1
  25. package/package.json +2 -2
  26. package/umd/index.umd.js +53 -2
  27. package/umd/index.umd.js.map +1 -1
package/esm/index.es.js CHANGED
@@ -36,7 +36,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
36
36
  * @generated
37
37
  * @see https://github.com/webgptorg/promptbook
38
38
  */
39
- const PROMPTBOOK_ENGINE_VERSION = '0.104.0-10';
39
+ const PROMPTBOOK_ENGINE_VERSION = '0.104.0-11';
40
40
  /**
41
41
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
42
42
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -9438,7 +9438,7 @@ function countUsage(llmTools) {
9438
9438
  * TODO: [🧠] Is there some meaningfull way how to test this util
9439
9439
  * TODO: [🧠][🌯] Maybe a way how to hide ability to `get totalUsage`
9440
9440
  * > const [llmToolsWithUsage,getUsage] = countTotalUsage(llmTools);
9441
- * TODO: [👷‍♂️] @@@ Manual about construction of llmTools
9441
+ * TODO: [👷‍♂️] Write a comprehensive manual explaining the construction and usage of LLM tools in the Promptbook ecosystem
9442
9442
  */
9443
9443
 
9444
9444
  /**
@@ -17933,7 +17933,57 @@ function parseAgentSource(agentSource) {
17933
17933
  }
17934
17934
  const meta = {};
17935
17935
  const links = [];
17936
+ const capabilities = [];
17936
17937
  for (const commitment of parseResult.commitments) {
17938
+ if (commitment.type === 'USE BROWSER') {
17939
+ capabilities.push({
17940
+ type: 'browser',
17941
+ label: 'Browser',
17942
+ iconName: 'Globe',
17943
+ });
17944
+ continue;
17945
+ }
17946
+ if (commitment.type === 'USE SEARCH ENGINE') {
17947
+ capabilities.push({
17948
+ type: 'search-engine',
17949
+ label: 'Search Internet',
17950
+ iconName: 'Search',
17951
+ });
17952
+ continue;
17953
+ }
17954
+ if (commitment.type === 'KNOWLEDGE') {
17955
+ const content = spaceTrim$2(commitment.content).split('\n')[0] || '';
17956
+ let label = content;
17957
+ let iconName = 'Book';
17958
+ if (content.startsWith('http://') || content.startsWith('https://')) {
17959
+ try {
17960
+ const url = new URL(content);
17961
+ if (url.pathname.endsWith('.pdf')) {
17962
+ label = url.pathname.split('/').pop() || 'Document.pdf';
17963
+ iconName = 'FileText';
17964
+ }
17965
+ else {
17966
+ label = url.hostname.replace(/^www\./, '');
17967
+ }
17968
+ }
17969
+ catch (e) {
17970
+ // Invalid URL, treat as text
17971
+ }
17972
+ }
17973
+ else {
17974
+ // Text content - take first few words
17975
+ const words = content.split(/\s+/);
17976
+ if (words.length > 4) {
17977
+ label = words.slice(0, 4).join(' ') + '...';
17978
+ }
17979
+ }
17980
+ capabilities.push({
17981
+ type: 'knowledge',
17982
+ label,
17983
+ iconName,
17984
+ });
17985
+ continue;
17986
+ }
17937
17987
  if (commitment.type === 'META LINK') {
17938
17988
  const linkValue = spaceTrim$2(commitment.content);
17939
17989
  links.push(linkValue);
@@ -17980,6 +18030,7 @@ function parseAgentSource(agentSource) {
17980
18030
  meta,
17981
18031
  links,
17982
18032
  parameters,
18033
+ capabilities,
17983
18034
  };
17984
18035
  }
17985
18036
  /**