@promptbook/legacy-documents 0.103.0-54 → 0.103.0-55

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.
package/esm/index.es.js CHANGED
@@ -26,7 +26,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
26
26
  * @generated
27
27
  * @see https://github.com/webgptorg/promptbook
28
28
  */
29
- const PROMPTBOOK_ENGINE_VERSION = '0.103.0-54';
29
+ const PROMPTBOOK_ENGINE_VERSION = '0.103.0-55';
30
30
  /**
31
31
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
32
32
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -21,12 +21,13 @@ import { pipelineCollectionToJson } from '../collection/pipeline-collection/pipe
21
21
  import { createEmptyAgentModelRequirements } from '../commitments/_base/createEmptyAgentModelRequirements';
22
22
  import { createBasicAgentModelRequirements } from '../commitments/_base/createEmptyAgentModelRequirements';
23
23
  import { NotYetImplementedCommitmentDefinition } from '../commitments/_base/NotYetImplementedCommitmentDefinition';
24
- import { getCommitmentDefinition } from '../commitments/index';
25
- import { getAllCommitmentDefinitions } from '../commitments/index';
26
- import { getAllCommitmentTypes } from '../commitments/index';
27
- import { isCommitmentSupported } from '../commitments/index';
28
- import type { GroupedCommitmentDefinition } from '../commitments/index';
29
- import { getGroupedCommitmentDefinitions } from '../commitments/index';
24
+ import { registerCommitment } from '../commitments/registry';
25
+ import { getCommitmentDefinition } from '../commitments/registry';
26
+ import { getAllCommitmentDefinitions } from '../commitments/registry';
27
+ import { getAllCommitmentTypes } from '../commitments/registry';
28
+ import { isCommitmentSupported } from '../commitments/registry';
29
+ import type { GroupedCommitmentDefinition } from '../commitments/registry';
30
+ import { getGroupedCommitmentDefinitions } from '../commitments/registry';
30
31
  import { NAME } from '../config';
31
32
  import { ADMIN_EMAIL } from '../config';
32
33
  import { ADMIN_GITHUB_NAME } from '../config';
@@ -216,6 +217,7 @@ export { pipelineCollectionToJson };
216
217
  export { createEmptyAgentModelRequirements };
217
218
  export { createBasicAgentModelRequirements };
218
219
  export { NotYetImplementedCommitmentDefinition };
220
+ export { registerCommitment };
219
221
  export { getCommitmentDefinition };
220
222
  export { getAllCommitmentDefinitions };
221
223
  export { getAllCommitmentTypes };
@@ -57,7 +57,7 @@ import type { InstrumentCommand } from '../commands/X_INSTRUMENT/InstrumentComma
57
57
  import type { BookCommitment } from '../commitments/_base/BookCommitment';
58
58
  import type { CommitmentDefinition } from '../commitments/_base/CommitmentDefinition';
59
59
  import type { ParsedCommitment } from '../commitments/_base/ParsedCommitment';
60
- import type { GroupedCommitmentDefinition } from '../commitments/index';
60
+ import type { GroupedCommitmentDefinition } from '../commitments/registry';
61
61
  import type { PrettifyOptions } from '../conversion/prettify/PrettifyOptions';
62
62
  import type { renderPipelineMermaidOptions } from '../conversion/prettify/renderPipelineMermaidOptions';
63
63
  import type { CallbackInterfaceToolsOptions } from '../dialogs/callback/CallbackInterfaceToolsOptions';
@@ -18,6 +18,10 @@ export type AgentModelRequirements = {
18
18
  * Optional list of MCP servers that the agent can connect to
19
19
  */
20
20
  readonly mcpServers?: ReadonlyArray<string>;
21
+ /**
22
+ * Optional link to the parent agent from which this agent inherits
23
+ */
24
+ readonly parentAgentUrl?: string_knowledge_source_link;
21
25
  /**
22
26
  * Optional list of knowledge source links that the agent can use
23
27
  */
@@ -0,0 +1,35 @@
1
+ import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
2
+ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
3
+ /**
4
+ * CLOSED commitment definition
5
+ *
6
+ * The CLOSED commitment specifies that the agent CANNOT be modified by conversation.
7
+ * It prevents the agent from learning from interactions and updating its source code.
8
+ *
9
+ * Example usage in agent source:
10
+ *
11
+ * ```book
12
+ * CLOSED
13
+ * ```
14
+ *
15
+ * @private [🪔] Maybe export the commitments through some package
16
+ */
17
+ export declare class ClosedCommitmentDefinition extends BaseCommitmentDefinition<'CLOSED'> {
18
+ constructor();
19
+ /**
20
+ * Short one-line description of CLOSED.
21
+ */
22
+ get description(): string;
23
+ /**
24
+ * Icon for this commitment.
25
+ */
26
+ get icon(): string;
27
+ /**
28
+ * Markdown documentation for CLOSED commitment.
29
+ */
30
+ get documentation(): string;
31
+ applyToAgentModelRequirements(requirements: AgentModelRequirements, _content: string): AgentModelRequirements;
32
+ }
33
+ /**
34
+ * Note: [💞] Ignore a discrepancy between file name and entity name
35
+ */
@@ -0,0 +1,28 @@
1
+ import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
2
+ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
3
+ /**
4
+ * COMPONENT commitment definition
5
+ *
6
+ * The COMPONENT commitment defines a UI component that the agent can render in the chat.
7
+ *
8
+ * @private [🪔] Maybe export the commitments through some package
9
+ */
10
+ export declare class ComponentCommitmentDefinition extends BaseCommitmentDefinition<'COMPONENT'> {
11
+ constructor();
12
+ /**
13
+ * Short one-line description of COMPONENT.
14
+ */
15
+ get description(): string;
16
+ /**
17
+ * Icon for this commitment.
18
+ */
19
+ get icon(): string;
20
+ /**
21
+ * Markdown documentation for COMPONENT commitment.
22
+ */
23
+ get documentation(): string;
24
+ applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
25
+ }
26
+ /**
27
+ * Note: [💞] Ignore a discrepancy between file name and entity name
28
+ */
@@ -0,0 +1,34 @@
1
+ import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
2
+ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
3
+ /**
4
+ * FROM commitment definition
5
+ *
6
+ * The FROM commitment tells the agent that its `agentSource` is inherited from another agent.
7
+ *
8
+ * Example usage in agent source:
9
+ *
10
+ * ```book
11
+ * FROM https://s6.ptbk.io/benjamin-white
12
+ * ```
13
+ *
14
+ * @private [🪔] Maybe export the commitments through some package
15
+ */
16
+ export declare class FromCommitmentDefinition extends BaseCommitmentDefinition<'FROM'> {
17
+ constructor(type?: 'FROM');
18
+ /**
19
+ * Short one-line description of FROM.
20
+ */
21
+ get description(): string;
22
+ /**
23
+ * Icon for this commitment.
24
+ */
25
+ get icon(): string;
26
+ /**
27
+ * Markdown documentation for FROM commitment.
28
+ */
29
+ get documentation(): string;
30
+ applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
31
+ }
32
+ /**
33
+ * Note: [💞] Ignore a discrepancy between file name and entity name
34
+ */
@@ -0,0 +1,26 @@
1
+ import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
2
+ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
3
+ /**
4
+ * IMPORTANT co-commitment definition
5
+ *
6
+ * The IMPORTANT co-commitment modifies another commitment to emphasize its importance.
7
+ * It is typically used with RULE to mark it as critical.
8
+ *
9
+ * Example usage in agent source:
10
+ *
11
+ * ```book
12
+ * IMPORTANT RULE Never provide medical advice
13
+ * ```
14
+ *
15
+ * @private [🪔] Maybe export the commitments through some package
16
+ */
17
+ export declare class ImportantCommitmentDefinition extends BaseCommitmentDefinition<'IMPORTANT'> {
18
+ constructor();
19
+ get description(): string;
20
+ get icon(): string;
21
+ get documentation(): string;
22
+ applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
23
+ }
24
+ /**
25
+ * Note: [💞] Ignore a discrepancy between file name and entity name
26
+ */
@@ -0,0 +1,35 @@
1
+ import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
2
+ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
3
+ /**
4
+ * LANGUAGE commitment definition
5
+ *
6
+ * The LANGUAGE/LANGUAGES commitment specifies the language(s) the agent should use in its responses.
7
+ *
8
+ * Example usage in agent source:
9
+ *
10
+ * ```book
11
+ * LANGUAGE English
12
+ * LANGUAGE French, English and Czech
13
+ * ```
14
+ *
15
+ * @private [🪔] Maybe export the commitments through some package
16
+ */
17
+ export declare class LanguageCommitmentDefinition extends BaseCommitmentDefinition<'LANGUAGE' | 'LANGUAGES'> {
18
+ constructor(type?: 'LANGUAGE' | 'LANGUAGES');
19
+ /**
20
+ * Short one-line description of LANGUAGE/LANGUAGES.
21
+ */
22
+ get description(): string;
23
+ /**
24
+ * Icon for this commitment.
25
+ */
26
+ get icon(): string;
27
+ /**
28
+ * Markdown documentation for LANGUAGE/LANGUAGES commitment.
29
+ */
30
+ get documentation(): string;
31
+ applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
32
+ }
33
+ /**
34
+ * Note: [💞] Ignore a discrepancy between file name and entity name
35
+ */
@@ -0,0 +1,35 @@
1
+ import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
2
+ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
3
+ /**
4
+ * OPEN commitment definition
5
+ *
6
+ * The OPEN commitment specifies that the agent can be modified by conversation.
7
+ * This is the default behavior.
8
+ *
9
+ * Example usage in agent source:
10
+ *
11
+ * ```book
12
+ * OPEN
13
+ * ```
14
+ *
15
+ * @private [🪔] Maybe export the commitments through some package
16
+ */
17
+ export declare class OpenCommitmentDefinition extends BaseCommitmentDefinition<'OPEN'> {
18
+ constructor();
19
+ /**
20
+ * Short one-line description of OPEN.
21
+ */
22
+ get description(): string;
23
+ /**
24
+ * Icon for this commitment.
25
+ */
26
+ get icon(): string;
27
+ /**
28
+ * Markdown documentation for OPEN commitment.
29
+ */
30
+ get documentation(): string;
31
+ applyToAgentModelRequirements(requirements: AgentModelRequirements, _content: string): AgentModelRequirements;
32
+ }
33
+ /**
34
+ * Note: [💞] Ignore a discrepancy between file name and entity name
35
+ */
@@ -1,82 +1 @@
1
- import type { BookCommitment } from './_base/BookCommitment';
2
- import type { CommitmentDefinition } from './_base/CommitmentDefinition';
3
- import { ActionCommitmentDefinition } from './ACTION/ACTION';
4
- import { DeleteCommitmentDefinition } from './DELETE/DELETE';
5
- import { FormatCommitmentDefinition } from './FORMAT/FORMAT';
6
- import { GoalCommitmentDefinition } from './GOAL/GOAL';
7
- import { KnowledgeCommitmentDefinition } from './KNOWLEDGE/KNOWLEDGE';
8
- import { MemoryCommitmentDefinition } from './MEMORY/MEMORY';
9
- import { AgentMessageCommitmentDefinition } from './MESSAGE/AgentMessageCommitmentDefinition';
10
- import { InitialMessageCommitmentDefinition } from './MESSAGE/InitialMessageCommitmentDefinition';
11
- import { MessageCommitmentDefinition } from './MESSAGE/MESSAGE';
12
- import { UserMessageCommitmentDefinition } from './MESSAGE/UserMessageCommitmentDefinition';
13
- import { MetaCommitmentDefinition } from './META/META';
14
- import { MetaColorCommitmentDefinition } from './META_COLOR/META_COLOR';
15
- import { MetaImageCommitmentDefinition } from './META_IMAGE/META_IMAGE';
16
- import { ModelCommitmentDefinition } from './MODEL/MODEL';
17
- import { NoteCommitmentDefinition } from './NOTE/NOTE';
18
- import { PersonaCommitmentDefinition } from './PERSONA/PERSONA';
19
- import { RuleCommitmentDefinition } from './RULE/RULE';
20
- import { SampleCommitmentDefinition } from './SAMPLE/SAMPLE';
21
- import { ScenarioCommitmentDefinition } from './SCENARIO/SCENARIO';
22
- import { StyleCommitmentDefinition } from './STYLE/STYLE';
23
- import { NotYetImplementedCommitmentDefinition } from './_base/NotYetImplementedCommitmentDefinition';
24
- /**
25
- * Registry of all available commitment definitions
26
- * This array contains instances of all commitment definitions
27
- * This is the single source of truth for all commitments in the system
28
- *
29
- * @private Use functions to access commitments instead of this array directly
30
- */
31
- export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, MemoryCommitmentDefinition, MemoryCommitmentDefinition, StyleCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, FormatCommitmentDefinition, ModelCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, ActionCommitmentDefinition, MetaImageCommitmentDefinition, MetaColorCommitmentDefinition, MetaCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, InitialMessageCommitmentDefinition, UserMessageCommitmentDefinition, AgentMessageCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
32
- /**
33
- * Gets a commitment definition by its type
34
- * @param type The commitment type to look up
35
- * @returns The commitment definition or null if not found
36
- *
37
- * @public exported from `@promptbook/core`
38
- */
39
- export declare function getCommitmentDefinition(type: BookCommitment): CommitmentDefinition | null;
40
- /**
41
- * Gets all available commitment definitions
42
- * @returns Array of all commitment definitions
43
- *
44
- * @public exported from `@promptbook/core`
45
- */
46
- export declare function getAllCommitmentDefinitions(): ReadonlyArray<CommitmentDefinition>;
47
- /**
48
- * Gets all available commitment types
49
- * @returns Array of all commitment types
50
- *
51
- * @public exported from `@promptbook/core`
52
- */
53
- export declare function getAllCommitmentTypes(): ReadonlyArray<BookCommitment>;
54
- /**
55
- * Checks if a commitment type is supported
56
- * @param type The commitment type to check
57
- * @returns True if the commitment type is supported
58
- *
59
- * @public exported from `@promptbook/core`
60
- */
61
- export declare function isCommitmentSupported(type: BookCommitment): boolean;
62
- /**
63
- * Grouped commitment definition
64
- *
65
- * @public exported from `@promptbook/core`
66
- */
67
- export type GroupedCommitmentDefinition = {
68
- primary: CommitmentDefinition;
69
- aliases: string[];
70
- };
71
- /**
72
- * Gets all commitment definitions grouped by their aliases
73
- *
74
- * @returns Array of grouped commitment definitions
75
- *
76
- * @public exported from `@promptbook/core`
77
- */
78
- export declare function getGroupedCommitmentDefinitions(): ReadonlyArray<GroupedCommitmentDefinition>;
79
- /**
80
- * TODO: [🧠] Maybe create through standardized $register
81
- * Note: [💞] Ignore a discrepancy between file name and entity name
82
- */
1
+ export * from './registry';
@@ -0,0 +1,68 @@
1
+ import type { BookCommitment } from './_base/BookCommitment';
2
+ import type { CommitmentDefinition } from './_base/CommitmentDefinition';
3
+ /**
4
+ * Registry of all available commitment definitions
5
+ * This array contains instances of all commitment definitions
6
+ * This is the single source of truth for all commitments in the system
7
+ *
8
+ * @private Use functions to access commitments instead of this array directly
9
+ */
10
+ export declare const COMMITMENT_REGISTRY: CommitmentDefinition[];
11
+ /**
12
+ * Registers a new commitment definition
13
+ * @param definition The commitment definition to register
14
+ *
15
+ * @public exported from `@promptbook/core`
16
+ */
17
+ export declare function registerCommitment(definition: CommitmentDefinition): void;
18
+ /**
19
+ * Gets a commitment definition by its type
20
+ * @param type The commitment type to look up
21
+ * @returns The commitment definition or null if not found
22
+ *
23
+ * @public exported from `@promptbook/core`
24
+ */
25
+ export declare function getCommitmentDefinition(type: BookCommitment): CommitmentDefinition | null;
26
+ /**
27
+ * Gets all available commitment definitions
28
+ * @returns Array of all commitment definitions
29
+ *
30
+ * @public exported from `@promptbook/core`
31
+ */
32
+ export declare function getAllCommitmentDefinitions(): ReadonlyArray<CommitmentDefinition>;
33
+ /**
34
+ * Gets all available commitment types
35
+ * @returns Array of all commitment types
36
+ *
37
+ * @public exported from `@promptbook/core`
38
+ */
39
+ export declare function getAllCommitmentTypes(): ReadonlyArray<BookCommitment>;
40
+ /**
41
+ * Checks if a commitment type is supported
42
+ * @param type The commitment type to check
43
+ * @returns True if the commitment type is supported
44
+ *
45
+ * @public exported from `@promptbook/core`
46
+ */
47
+ export declare function isCommitmentSupported(type: BookCommitment): boolean;
48
+ /**
49
+ * Grouped commitment definition
50
+ *
51
+ * @public exported from `@promptbook/core`
52
+ */
53
+ export type GroupedCommitmentDefinition = {
54
+ primary: CommitmentDefinition;
55
+ aliases: string[];
56
+ };
57
+ /**
58
+ * Gets all commitment definitions grouped by their aliases
59
+ *
60
+ * @returns Array of grouped commitment definitions
61
+ *
62
+ * @public exported from `@promptbook/core`
63
+ */
64
+ export declare function getGroupedCommitmentDefinitions(): ReadonlyArray<GroupedCommitmentDefinition>;
65
+ /**
66
+ * TODO: !!!! Proofread this file
67
+ * Note: [💞] Ignore a discrepancy between file name and entity name
68
+ */
@@ -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.103.0-53`).
18
+ * It follows semantic versioning (e.g., `0.103.0-54`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/legacy-documents",
3
- "version": "0.103.0-54",
3
+ "version": "0.103.0-55",
4
4
  "description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -88,14 +88,14 @@
88
88
  },
89
89
  "homepage": "https://ptbk.io/",
90
90
  "engines": {
91
- "node": ">=16.0.0",
91
+ "node": ">=18.18.0",
92
92
  "npm": ">=8.0.0"
93
93
  },
94
94
  "main": "./umd/index.umd.js",
95
95
  "module": "./esm/index.es.js",
96
96
  "typings": "./esm/typings/src/_packages/legacy-documents.index.d.ts",
97
97
  "peerDependencies": {
98
- "@promptbook/core": "0.103.0-54"
98
+ "@promptbook/core": "0.103.0-55"
99
99
  },
100
100
  "dependencies": {
101
101
  "colors": "1.4.0",
package/umd/index.umd.js CHANGED
@@ -25,7 +25,7 @@
25
25
  * @generated
26
26
  * @see https://github.com/webgptorg/promptbook
27
27
  */
28
- const PROMPTBOOK_ENGINE_VERSION = '0.103.0-54';
28
+ const PROMPTBOOK_ENGINE_VERSION = '0.103.0-55';
29
29
  /**
30
30
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
31
31
  * Note: [💞] Ignore a discrepancy between file name and entity name