@promptbook/wizard 0.104.0-4 โ†’ 0.104.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.
@@ -1,6 +1,6 @@
1
1
  import type { AvailableModel } from '../../execution/AvailableModel';
2
2
  import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
3
- import type { string_model_name } from '../../types/typeAliases';
3
+ import type { string_agent_name, string_model_name, string_system_message, string_url_image } from '../../types/typeAliases';
4
4
  import type { AgentModelRequirements } from './AgentModelRequirements';
5
5
  import type { string_book } from './string_book';
6
6
  /**
@@ -27,18 +27,18 @@ export declare function extractMcpServers(agentSource: string_book): string[];
27
27
  * @deprecated Use createAgentModelRequirements instead
28
28
  * @private
29
29
  */
30
- export declare function createAgentSystemMessage(agentSource: string_book): Promise<string>;
30
+ export declare function createAgentSystemMessage(agentSource: string_book): Promise<string_system_message>;
31
31
  /**
32
32
  * Extracts the agent name from the first line of the agent source
33
33
  * @deprecated Use parseAgentSource instead
34
34
  * @private
35
35
  */
36
- export declare function extractAgentName(agentSource: string_book): string;
36
+ export declare function extractAgentName(agentSource: string_book): string_agent_name;
37
37
  /**
38
- * Extracts the profile image URL from agent source or returns gravatar fallback
38
+ * Extracts the profile image URL from agent source or returns default avatar fallback
39
39
  * @param agentSource The agent source string that may contain META IMAGE line
40
- * @returns Profile image URL (from source or gravatar fallback)
40
+ * @returns Profile image URL (from source or default avatar fallback)
41
41
  * @deprecated Use parseAgentSource instead
42
42
  * @private
43
43
  */
44
- export declare function extractAgentProfileImage(agentSource: string_book): string;
44
+ export declare function extractAgentProfileImage(agentSource: string_book): string_url_image | null;
@@ -1,13 +1,13 @@
1
- import type { string_agent_name, string_url_image } from '../../types/typeAliases';
1
+ import type { string_agent_name, string_agent_permanent_id, string_url_image } from '../../types/typeAliases';
2
2
  /**
3
3
  * Generates an image for the agent to use as profile image
4
4
  *
5
- * @param agentName The agent name to generate avatar for
5
+ * @param agentId - The permanent ID of the agent
6
6
  * @returns The placeholder profile image URL for the agent
7
7
  *
8
8
  * @public exported from `@promptbook/core`
9
9
  */
10
- export declare function generatePlaceholderAgentProfileImageUrl(agentName?: string_agent_name): string_url_image;
10
+ export declare function generatePlaceholderAgentProfileImageUrl(agentIdOrName: string_agent_permanent_id | string_agent_name): string_url_image;
11
11
  /**
12
12
  * TODO: [๐Ÿคน] Figure out best placeholder image generator https://i.pravatar.cc/1000?u=568
13
13
  */
@@ -3,11 +3,12 @@
3
3
  * Source of truth: `/apps/agents-server/src/database/schema.sql` *(do not edit table structure here manually)*
4
4
  *
5
5
  * [๐Ÿ’ฝ] Prompt:
6
- * Re-generate this sub-schema
6
+ * Re-generate this sub-schema from `/apps/agents-server/src/database/schema.ts` *(which was generated from `/apps/agents-server/src/database/migrations/*.sql`)*
7
+ * `AgentsDatabaseSchema` is strict subset of `AgentsServerDatabase`
7
8
  * Generate Supabase TypeScript schema which is a subset of `AgentsServerDatabase`
8
9
  * containing only tables `Agent` and `AgentHistory`
9
10
  *
10
- * NOTE: This file intentionally omits all other tables (EnvironmentVariable, ChatHistory, ChatFeedback)
11
+ * NOTE: This file intentionally omits all other tables (`Metadata`, `ChatHistory`, `ChatFeedback`, `User`, `LlmCache`, etc.)
11
12
  * and any extra schemas (e.g. `graphql_public`) to remain a strict subset.
12
13
  */
13
14
  export type Json = string | number | boolean | null | {
@@ -31,6 +32,7 @@ export type AgentsDatabaseSchema = {
31
32
  preparedModelRequirements: Json | null;
32
33
  preparedExternals: Json | null;
33
34
  deletedAt: string | null;
35
+ visibility: 'PUBLIC' | 'PRIVATE';
34
36
  };
35
37
  Insert: {
36
38
  id?: number;
@@ -46,6 +48,7 @@ export type AgentsDatabaseSchema = {
46
48
  preparedModelRequirements?: Json | null;
47
49
  preparedExternals?: Json | null;
48
50
  deletedAt?: string | null;
51
+ visibility?: 'PUBLIC' | 'PRIVATE';
49
52
  };
50
53
  Update: {
51
54
  id?: number;
@@ -61,6 +64,7 @@ export type AgentsDatabaseSchema = {
61
64
  preparedModelRequirements?: Json | null;
62
65
  preparedExternals?: Json | null;
63
66
  deletedAt?: string | null;
67
+ visibility?: 'PUBLIC' | 'PRIVATE';
64
68
  };
65
69
  Relationships: [];
66
70
  };
@@ -92,21 +96,20 @@ export type AgentsDatabaseSchema = {
92
96
  agentSource?: string;
93
97
  promptbookEngineVersion?: string;
94
98
  };
95
- Relationships: [];
99
+ Relationships: [
100
+ {
101
+ foreignKeyName: 'AgentHistory_agentName_fkey';
102
+ columns: ['agentName'];
103
+ referencedRelation: 'Agent';
104
+ referencedColumns: ['agentName'];
105
+ }
106
+ ];
96
107
  };
97
108
  };
98
- Views: {
99
- [_ in never]: never;
100
- };
101
- Functions: {
102
- [_ in never]: never;
103
- };
104
- Enums: {
105
- [_ in never]: never;
106
- };
107
- CompositeTypes: {
108
- [_ in never]: never;
109
- };
109
+ Views: Record<string, never>;
110
+ Functions: Record<string, never>;
111
+ Enums: Record<string, never>;
112
+ CompositeTypes: Record<string, never>;
110
113
  };
111
114
  };
112
115
  type PublicSchema = AgentsDatabaseSchema[Extract<keyof AgentsDatabaseSchema, 'public'>];
@@ -140,6 +140,8 @@ export type string_title = string;
140
140
  * Semantic helper
141
141
  *
142
142
  * For example `"My AI Assistant"`
143
+ *
144
+ * TODO: !!!! Brand the type
143
145
  */
144
146
  export type string_agent_name = string;
145
147
  /**
@@ -158,6 +160,8 @@ export type string_agent_hash = string_sha256;
158
160
  * Semantic helper
159
161
  *
160
162
  * For example `"3mJr7AoUXx2Wqd"`
163
+ *
164
+ * TODO: !!!! Brand the type
161
165
  */
162
166
  export type string_agent_permanent_id = string_base_58;
163
167
  /**
@@ -15,7 +15,7 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
15
15
  export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
16
16
  /**
17
17
  * Represents the version string of the Promptbook engine.
18
- * It follows semantic versioning (e.g., `0.104.0-3`).
18
+ * It follows semantic versioning (e.g., `0.104.0-5`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/wizard",
3
- "version": "0.104.0-4",
3
+ "version": "0.104.0-6",
4
4
  "description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -95,7 +95,7 @@
95
95
  "module": "./esm/index.es.js",
96
96
  "typings": "./esm/typings/src/_packages/wizard.index.d.ts",
97
97
  "peerDependencies": {
98
- "@promptbook/core": "0.104.0-4"
98
+ "@promptbook/core": "0.104.0-6"
99
99
  },
100
100
  "dependencies": {
101
101
  "@ai-sdk/deepseek": "0.1.17",
package/umd/index.umd.js CHANGED
@@ -48,7 +48,7 @@
48
48
  * @generated
49
49
  * @see https://github.com/webgptorg/promptbook
50
50
  */
51
- const PROMPTBOOK_ENGINE_VERSION = '0.104.0-4';
51
+ const PROMPTBOOK_ENGINE_VERSION = '0.104.0-6';
52
52
  /**
53
53
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
54
54
  * Note: [๐Ÿ’ž] Ignore a discrepancy between file name and entity name
@@ -17543,44 +17543,6 @@
17543
17543
  * TODO: [๐ŸŒบ] Use some intermediate util splitWords
17544
17544
  */
17545
17545
 
17546
- /**
17547
- * Generates a gravatar URL based on agent name for fallback avatar
17548
- *
17549
- * @param agentName The agent name to generate avatar for
17550
- * @returns Gravatar URL
17551
- *
17552
- * @private - [๐Ÿคน] The fact that profile image is Gravatar is just implementation detail which should be hidden for consumer
17553
- */
17554
- function generateGravatarUrl(agentName) {
17555
- // Use a default name if none provided
17556
- const safeName = agentName || 'Anonymous Agent';
17557
- // Create a simple hash from the name for consistent avatar
17558
- let hash = 0;
17559
- for (let i = 0; i < safeName.length; i++) {
17560
- const char = safeName.charCodeAt(i);
17561
- hash = (hash << 5) - hash + char;
17562
- hash = hash & hash; // Convert to 32bit integer
17563
- }
17564
- const avatarId = Math.abs(hash).toString();
17565
- return `https://www.gravatar.com/avatar/${avatarId}?default=robohash&size=200&rating=x`;
17566
- }
17567
-
17568
- /**
17569
- * Generates an image for the agent to use as profile image
17570
- *
17571
- * @param agentName The agent name to generate avatar for
17572
- * @returns The placeholder profile image URL for the agent
17573
- *
17574
- * @public exported from `@promptbook/core`
17575
- */
17576
- function generatePlaceholderAgentProfileImageUrl(agentName) {
17577
- // Note: [๐Ÿคน] The fact that profile image is Gravatar is just implementation detail which should be hidden for consumer
17578
- return generateGravatarUrl(agentName);
17579
- }
17580
- /**
17581
- * TODO: [๐Ÿคน] Figure out best placeholder image generator https://i.pravatar.cc/1000?u=568
17582
- */
17583
-
17584
17546
  /**
17585
17547
  * Computes SHA-256 hash of the given object
17586
17548
  *
@@ -18005,10 +17967,6 @@
18005
17967
  const metaType = normalizeTo_camelCase(metaTypeRaw);
18006
17968
  meta[metaType] = spaceTrim__default["default"](commitment.content.substring(metaTypeRaw.length));
18007
17969
  }
18008
- // Generate gravatar fallback if no meta image specified
18009
- if (!meta.image) {
18010
- meta.image = generatePlaceholderAgentProfileImageUrl(parseResult.agentName || '!!');
18011
- }
18012
17970
  // Generate fullname fallback if no meta fullname specified
18013
17971
  if (!meta.fullname) {
18014
17972
  meta.fullname = parseResult.agentName || createDefaultAgentName(agentSource);
@@ -19182,12 +19140,13 @@
19182
19140
  }
19183
19141
  }
19184
19142
  catch (error) {
19143
+ assertsError(error);
19185
19144
  // If validation throws an unexpected error, don't cache
19186
19145
  shouldCache = false;
19187
19146
  if (isVerbose) {
19188
19147
  console.info('Not caching result due to validation error for key:', key, {
19189
19148
  content: promptResult.content,
19190
- validationError: error instanceof Error ? error.message : String(error),
19149
+ validationError: serializeError(error),
19191
19150
  });
19192
19151
  }
19193
19152
  }