@promptbook/components 0.104.0-8 → 0.104.0-9

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,7 +1,7 @@
1
1
  import type { SupabaseClient } from '@supabase/supabase-js';
2
2
  import type { AgentBasicInformation } from '../../../../book-2.0/agent-source/AgentBasicInformation';
3
3
  import type { string_book } from '../../../../book-2.0/agent-source/string_book';
4
- import type { string_agent_name } from '../../../../types/typeAliases';
4
+ import type { string_agent_name, string_agent_permanent_id } from '../../../../types/typeAliases';
5
5
  import { AgentCollectionInSupabaseOptions } from './AgentCollectionInSupabaseOptions';
6
6
  import type { AgentsDatabaseSchema } from './AgentsDatabaseSchema';
7
7
  /**
@@ -28,7 +28,11 @@ export declare class AgentCollectionInSupabase {
28
28
  /**
29
29
  * [🐱‍🚀]@@@
30
30
  */
31
- getAgentSource(agentName: string_agent_name): Promise<string_book>;
31
+ getAgentPermanentId(agentNameOrPermanentId: string_agent_name | string_agent_permanent_id): Promise<string_agent_permanent_id>;
32
+ /**
33
+ * [🐱‍🚀]@@@
34
+ */
35
+ getAgentSource(agentNameOrPermanentId: string_agent_name | string_agent_permanent_id): Promise<string_book>;
32
36
  /**
33
37
  * Creates a new agent in the collection
34
38
  *
@@ -38,7 +42,7 @@ export declare class AgentCollectionInSupabase {
38
42
  /**
39
43
  * Updates an existing agent in the collection
40
44
  */
41
- updateAgentSource(agentName: string_agent_name, agentSource: string_book): Promise<void>;
45
+ updateAgentSource(permanentId: string_agent_permanent_id, agentSource: string_book): Promise<void>;
42
46
  /**
43
47
  * List agents that are soft deleted (deletedAt IS NOT NULL)
44
48
  */
@@ -46,7 +50,7 @@ export declare class AgentCollectionInSupabase {
46
50
  /**
47
51
  * List history of an agent
48
52
  */
49
- listAgentHistory(agentName: string_agent_name): Promise<ReadonlyArray<{
53
+ listAgentHistory(permanentId: string_agent_permanent_id): Promise<ReadonlyArray<{
50
54
  id: number;
51
55
  createdAt: string;
52
56
  agentHash: string;
@@ -55,7 +59,7 @@ export declare class AgentCollectionInSupabase {
55
59
  /**
56
60
  * Restore a soft-deleted agent by setting deletedAt to NULL
57
61
  */
58
- restoreAgent(agentIdentifier: string): Promise<void>;
62
+ restoreAgent(permanentId: string_agent_permanent_id): Promise<void>;
59
63
  /**
60
64
  * Restore an agent from a specific history entry
61
65
  *
@@ -65,7 +69,7 @@ export declare class AgentCollectionInSupabase {
65
69
  /**
66
70
  * Soft delete an agent by setting deletedAt to current timestamp
67
71
  */
68
- deleteAgent(agentIdentifier: string): Promise<void>;
72
+ deleteAgent(permanentId: string_agent_permanent_id): Promise<void>;
69
73
  /**
70
74
  * Get the Supabase table name with prefix
71
75
  *
@@ -73,6 +73,7 @@ export type AgentsDatabaseSchema = {
73
73
  id: number;
74
74
  createdAt: string;
75
75
  agentName: string;
76
+ permanentId: string;
76
77
  agentHash: string;
77
78
  previousAgentHash: string | null;
78
79
  agentSource: string;
@@ -82,6 +83,7 @@ export type AgentsDatabaseSchema = {
82
83
  id?: number;
83
84
  createdAt: string;
84
85
  agentName: string;
86
+ permanentId: string;
85
87
  agentHash: string;
86
88
  previousAgentHash?: string | null;
87
89
  agentSource: string;
@@ -91,6 +93,7 @@ export type AgentsDatabaseSchema = {
91
93
  id?: number;
92
94
  createdAt?: string;
93
95
  agentName?: string;
96
+ permanentId?: string;
94
97
  agentHash?: string;
95
98
  previousAgentHash?: string | null;
96
99
  agentSource?: string;
@@ -98,10 +101,10 @@ export type AgentsDatabaseSchema = {
98
101
  };
99
102
  Relationships: [
100
103
  {
101
- foreignKeyName: 'AgentHistory_agentName_fkey';
102
- columns: ['agentName'];
104
+ foreignKeyName: 'AgentHistory_permanentId_fkey';
105
+ columns: ['permanentId'];
103
106
  referencedRelation: 'Agent';
104
- referencedColumns: ['agentName'];
107
+ referencedColumns: ['permanentId'];
105
108
  }
106
109
  ];
107
110
  };
@@ -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-7`).
18
+ * It follows semantic versioning (e.g., `0.104.0-8`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/components",
3
- "version": "0.104.0-8",
3
+ "version": "0.104.0-9",
4
4
  "description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
5
5
  "private": false,
6
6
  "sideEffects": false,
package/umd/index.umd.js CHANGED
@@ -30,7 +30,7 @@
30
30
  * @generated
31
31
  * @see https://github.com/webgptorg/promptbook
32
32
  */
33
- const PROMPTBOOK_ENGINE_VERSION = '0.104.0-8';
33
+ const PROMPTBOOK_ENGINE_VERSION = '0.104.0-9';
34
34
  /**
35
35
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
36
36
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -15324,7 +15324,12 @@
15324
15324
  };
15325
15325
  }
15326
15326
  // Apply each commitment in order using reduce-like pattern
15327
- for (const commitment of filteredCommitments) {
15327
+ for (let i = 0; i < filteredCommitments.length; i++) {
15328
+ const commitment = filteredCommitments[i];
15329
+ // CLOSED commitment should work only if its the last commitment in the book
15330
+ if (commitment.type === 'CLOSED' && i !== filteredCommitments.length - 1) {
15331
+ continue;
15332
+ }
15328
15333
  const definition = getCommitmentDefinition(commitment.type);
15329
15334
  if (definition) {
15330
15335
  try {