@promptbook/deepseek 0.103.0-55 → 0.103.0-56
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 +43 -9
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +6 -8
- package/esm/typings/src/_packages/types.index.d.ts +1 -1
- package/esm/typings/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +5 -0
- package/esm/typings/src/commitments/META_COLOR/META_COLOR.d.ts +6 -0
- package/esm/typings/src/commitments/META_FONT/META_FONT.d.ts +42 -0
- package/esm/typings/src/commitments/USE/USE.d.ts +53 -0
- package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +38 -0
- package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.test.d.ts +1 -0
- package/esm/typings/src/commitments/{IMPORTANT/IMPORTANT.d.ts → USE_MCP/USE_MCP.d.ts} +16 -5
- package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +38 -0
- package/esm/typings/src/commitments/index.d.ts +93 -1
- package/esm/typings/src/playground/playground.d.ts +3 -0
- package/esm/typings/src/utils/color/Color.d.ts +8 -0
- package/esm/typings/src/utils/color/css-colors.d.ts +1 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +42 -8
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/commitments/registry.d.ts +0 -68
- package/esm/typings/src/playground/playground1.d.ts +0 -2
|
@@ -1,23 +1,34 @@
|
|
|
1
1
|
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
2
|
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* USE MCP commitment definition
|
|
5
5
|
*
|
|
6
|
-
* The
|
|
7
|
-
*
|
|
6
|
+
* The `USE MCP` commitment allows to specify an MCP server URL which the agent will connect to
|
|
7
|
+
* for retrieving additional instructions and actions.
|
|
8
|
+
*
|
|
9
|
+
* The content following `USE MCP` is the URL of the MCP server.
|
|
8
10
|
*
|
|
9
11
|
* Example usage in agent source:
|
|
10
12
|
*
|
|
11
13
|
* ```book
|
|
12
|
-
*
|
|
14
|
+
* USE MCP http://mcp-server-url.com
|
|
13
15
|
* ```
|
|
14
16
|
*
|
|
15
17
|
* @private [🪔] Maybe export the commitments through some package
|
|
16
18
|
*/
|
|
17
|
-
export declare class
|
|
19
|
+
export declare class UseMcpCommitmentDefinition extends BaseCommitmentDefinition<'USE MCP'> {
|
|
18
20
|
constructor();
|
|
21
|
+
/**
|
|
22
|
+
* Short one-line description of USE MCP.
|
|
23
|
+
*/
|
|
19
24
|
get description(): string;
|
|
25
|
+
/**
|
|
26
|
+
* Icon for this commitment.
|
|
27
|
+
*/
|
|
20
28
|
get icon(): string;
|
|
29
|
+
/**
|
|
30
|
+
* Markdown documentation for USE MCP commitment.
|
|
31
|
+
*/
|
|
21
32
|
get documentation(): string;
|
|
22
33
|
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
23
34
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements';
|
|
2
|
+
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
|
|
3
|
+
/**
|
|
4
|
+
* USE SEARCH ENGINE commitment definition
|
|
5
|
+
*
|
|
6
|
+
* The `USE SEARCH ENGINE` commitment indicates that the agent should utilize a search engine tool
|
|
7
|
+
* to access and retrieve up-to-date information from the internet when necessary.
|
|
8
|
+
*
|
|
9
|
+
* The content following `USE SEARCH ENGINE` is ignored (similar to NOTE).
|
|
10
|
+
*
|
|
11
|
+
* Example usage in agent source:
|
|
12
|
+
*
|
|
13
|
+
* ```book
|
|
14
|
+
* USE SEARCH ENGINE
|
|
15
|
+
* USE SEARCH ENGINE This will be ignored
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @private [🪔] Maybe export the commitments through some package
|
|
19
|
+
*/
|
|
20
|
+
export declare class UseSearchEngineCommitmentDefinition extends BaseCommitmentDefinition<'USE SEARCH ENGINE'> {
|
|
21
|
+
constructor();
|
|
22
|
+
/**
|
|
23
|
+
* Short one-line description of USE SEARCH ENGINE.
|
|
24
|
+
*/
|
|
25
|
+
get description(): string;
|
|
26
|
+
/**
|
|
27
|
+
* Icon for this commitment.
|
|
28
|
+
*/
|
|
29
|
+
get icon(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Markdown documentation for USE SEARCH ENGINE commitment.
|
|
32
|
+
*/
|
|
33
|
+
get documentation(): string;
|
|
34
|
+
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
38
|
+
*/
|
|
@@ -1 +1,93 @@
|
|
|
1
|
-
|
|
1
|
+
import type { BookCommitment } from './_base/BookCommitment';
|
|
2
|
+
import type { CommitmentDefinition } from './_base/CommitmentDefinition';
|
|
3
|
+
import { ActionCommitmentDefinition } from './ACTION/ACTION';
|
|
4
|
+
import { ClosedCommitmentDefinition } from './CLOSED/CLOSED';
|
|
5
|
+
import { ComponentCommitmentDefinition } from './COMPONENT/COMPONENT';
|
|
6
|
+
import { DeleteCommitmentDefinition } from './DELETE/DELETE';
|
|
7
|
+
import { FormatCommitmentDefinition } from './FORMAT/FORMAT';
|
|
8
|
+
import { FromCommitmentDefinition } from './FROM/FROM';
|
|
9
|
+
import { GoalCommitmentDefinition } from './GOAL/GOAL';
|
|
10
|
+
import { KnowledgeCommitmentDefinition } from './KNOWLEDGE/KNOWLEDGE';
|
|
11
|
+
import { LanguageCommitmentDefinition } from './LANGUAGE/LANGUAGE';
|
|
12
|
+
import { MemoryCommitmentDefinition } from './MEMORY/MEMORY';
|
|
13
|
+
import { AgentMessageCommitmentDefinition } from './MESSAGE/AgentMessageCommitmentDefinition';
|
|
14
|
+
import { InitialMessageCommitmentDefinition } from './MESSAGE/InitialMessageCommitmentDefinition';
|
|
15
|
+
import { MessageCommitmentDefinition } from './MESSAGE/MESSAGE';
|
|
16
|
+
import { UserMessageCommitmentDefinition } from './MESSAGE/UserMessageCommitmentDefinition';
|
|
17
|
+
import { MetaCommitmentDefinition } from './META/META';
|
|
18
|
+
import { MetaColorCommitmentDefinition } from './META_COLOR/META_COLOR';
|
|
19
|
+
import { MetaFontCommitmentDefinition } from './META_FONT/META_FONT';
|
|
20
|
+
import { MetaImageCommitmentDefinition } from './META_IMAGE/META_IMAGE';
|
|
21
|
+
import { MetaLinkCommitmentDefinition } from './META_LINK/META_LINK';
|
|
22
|
+
import { ModelCommitmentDefinition } from './MODEL/MODEL';
|
|
23
|
+
import { NoteCommitmentDefinition } from './NOTE/NOTE';
|
|
24
|
+
import { OpenCommitmentDefinition } from './OPEN/OPEN';
|
|
25
|
+
import { PersonaCommitmentDefinition } from './PERSONA/PERSONA';
|
|
26
|
+
import { RuleCommitmentDefinition } from './RULE/RULE';
|
|
27
|
+
import { SampleCommitmentDefinition } from './SAMPLE/SAMPLE';
|
|
28
|
+
import { ScenarioCommitmentDefinition } from './SCENARIO/SCENARIO';
|
|
29
|
+
import { StyleCommitmentDefinition } from './STYLE/STYLE';
|
|
30
|
+
import { UseCommitmentDefinition } from './USE/USE';
|
|
31
|
+
import { UseBrowserCommitmentDefinition } from './USE_BROWSER/USE_BROWSER';
|
|
32
|
+
import { UseMcpCommitmentDefinition } from './USE_MCP/USE_MCP';
|
|
33
|
+
import { UseSearchEngineCommitmentDefinition } from './USE_SEARCH_ENGINE/USE_SEARCH_ENGINE';
|
|
34
|
+
import { NotYetImplementedCommitmentDefinition } from './_base/NotYetImplementedCommitmentDefinition';
|
|
35
|
+
/**
|
|
36
|
+
* Registry of all available commitment definitions
|
|
37
|
+
* This array contains instances of all commitment definitions
|
|
38
|
+
* This is the single source of truth for all commitments in the system
|
|
39
|
+
*
|
|
40
|
+
* @private Use functions to access commitments instead of this array directly
|
|
41
|
+
*/
|
|
42
|
+
export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, MemoryCommitmentDefinition, MemoryCommitmentDefinition, StyleCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, LanguageCommitmentDefinition, LanguageCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, FormatCommitmentDefinition, FromCommitmentDefinition, ModelCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, ActionCommitmentDefinition, ComponentCommitmentDefinition, MetaImageCommitmentDefinition, MetaColorCommitmentDefinition, MetaFontCommitmentDefinition, MetaLinkCommitmentDefinition, MetaCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, InitialMessageCommitmentDefinition, UserMessageCommitmentDefinition, AgentMessageCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, OpenCommitmentDefinition, ClosedCommitmentDefinition, UseBrowserCommitmentDefinition, UseSearchEngineCommitmentDefinition, UseMcpCommitmentDefinition, UseCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
|
|
43
|
+
/**
|
|
44
|
+
* Gets a commitment definition by its type
|
|
45
|
+
* @param type The commitment type to look up
|
|
46
|
+
* @returns The commitment definition or null if not found
|
|
47
|
+
*
|
|
48
|
+
* @public exported from `@promptbook/core`
|
|
49
|
+
*/
|
|
50
|
+
export declare function getCommitmentDefinition(type: BookCommitment): CommitmentDefinition | null;
|
|
51
|
+
/**
|
|
52
|
+
* Gets all available commitment definitions
|
|
53
|
+
* @returns Array of all commitment definitions
|
|
54
|
+
*
|
|
55
|
+
* @public exported from `@promptbook/core`
|
|
56
|
+
*/
|
|
57
|
+
export declare function getAllCommitmentDefinitions(): ReadonlyArray<CommitmentDefinition>;
|
|
58
|
+
/**
|
|
59
|
+
* Gets all available commitment types
|
|
60
|
+
* @returns Array of all commitment types
|
|
61
|
+
*
|
|
62
|
+
* @public exported from `@promptbook/core`
|
|
63
|
+
*/
|
|
64
|
+
export declare function getAllCommitmentTypes(): ReadonlyArray<BookCommitment>;
|
|
65
|
+
/**
|
|
66
|
+
* Checks if a commitment type is supported
|
|
67
|
+
* @param type The commitment type to check
|
|
68
|
+
* @returns True if the commitment type is supported
|
|
69
|
+
*
|
|
70
|
+
* @public exported from `@promptbook/core`
|
|
71
|
+
*/
|
|
72
|
+
export declare function isCommitmentSupported(type: BookCommitment): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Grouped commitment definition
|
|
75
|
+
*
|
|
76
|
+
* @public exported from `@promptbook/core`
|
|
77
|
+
*/
|
|
78
|
+
export type GroupedCommitmentDefinition = {
|
|
79
|
+
primary: CommitmentDefinition;
|
|
80
|
+
aliases: string[];
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Gets all commitment definitions grouped by their aliases
|
|
84
|
+
*
|
|
85
|
+
* @returns Array of grouped commitment definitions
|
|
86
|
+
*
|
|
87
|
+
* @public exported from `@promptbook/core`
|
|
88
|
+
*/
|
|
89
|
+
export declare function getGroupedCommitmentDefinitions(): ReadonlyArray<GroupedCommitmentDefinition>;
|
|
90
|
+
/**
|
|
91
|
+
* TODO: [🧠] Maybe create through standardized $register
|
|
92
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
93
|
+
*/
|
|
@@ -24,6 +24,14 @@ export declare class Color {
|
|
|
24
24
|
* @returns Color object
|
|
25
25
|
*/
|
|
26
26
|
static from(color: string_color | Color): WithTake<Color>;
|
|
27
|
+
/**
|
|
28
|
+
* Creates a new Color instance from miscellaneous formats
|
|
29
|
+
* It just does not throw error when it fails, it returns PROMPTBOOK_COLOR instead
|
|
30
|
+
*
|
|
31
|
+
* @param color
|
|
32
|
+
* @returns Color object
|
|
33
|
+
*/
|
|
34
|
+
static fromSafe(color: string_color | Color): WithTake<Color>;
|
|
27
35
|
/**
|
|
28
36
|
* Creates a new Color instance from miscellaneous string formats
|
|
29
37
|
*
|
|
@@ -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-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.103.0-55`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/deepseek",
|
|
3
|
-
"version": "0.103.0-
|
|
3
|
+
"version": "0.103.0-56",
|
|
4
4
|
"description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"module": "./esm/index.es.js",
|
|
93
93
|
"typings": "./esm/typings/src/_packages/deepseek.index.d.ts",
|
|
94
94
|
"peerDependencies": {
|
|
95
|
-
"@promptbook/core": "0.103.0-
|
|
95
|
+
"@promptbook/core": "0.103.0-56"
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
98
|
"@ai-sdk/deepseek": "0.1.17",
|
package/umd/index.umd.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('colors'), require('spacetrim'), require('crypto')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(['exports', 'colors', 'spacetrim', 'crypto'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-deepseek"] = {}, global.colors, global.spaceTrim, global.crypto));
|
|
5
|
-
})(this, (function (exports, colors, spaceTrim, crypto) { 'use strict';
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-deepseek"] = {}, global.colors, global.spaceTrim$1, global.crypto));
|
|
5
|
+
})(this, (function (exports, colors, spaceTrim$1, crypto) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
9
9
|
var colors__default = /*#__PURE__*/_interopDefaultLegacy(colors);
|
|
10
|
-
var spaceTrim__default = /*#__PURE__*/_interopDefaultLegacy(spaceTrim);
|
|
10
|
+
var spaceTrim__default = /*#__PURE__*/_interopDefaultLegacy(spaceTrim$1);
|
|
11
11
|
|
|
12
12
|
// ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten
|
|
13
13
|
/**
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* @generated
|
|
24
24
|
* @see https://github.com/webgptorg/promptbook
|
|
25
25
|
*/
|
|
26
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-
|
|
26
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.103.0-56';
|
|
27
27
|
/**
|
|
28
28
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
29
29
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -614,6 +614,17 @@
|
|
|
614
614
|
return new Date().toISOString();
|
|
615
615
|
}
|
|
616
616
|
|
|
617
|
+
/**
|
|
618
|
+
* Trims string from all 4 sides
|
|
619
|
+
*
|
|
620
|
+
* Note: This is a re-exported function from the `spacetrim` package which is
|
|
621
|
+
* Developed by same author @hejny as this package
|
|
622
|
+
*
|
|
623
|
+
* @public exported from `@promptbook/utils`
|
|
624
|
+
* @see https://github.com/hejny/spacetrim#usage
|
|
625
|
+
*/
|
|
626
|
+
const spaceTrim = spaceTrim$1.spaceTrim;
|
|
627
|
+
|
|
617
628
|
/**
|
|
618
629
|
* @private util of `@promptbook/color`
|
|
619
630
|
* @de
|
|
@@ -662,6 +673,7 @@
|
|
|
662
673
|
* @public exported from `@promptbook/color`
|
|
663
674
|
*/
|
|
664
675
|
const CSS_COLORS = {
|
|
676
|
+
promptbook: '#79EAFD',
|
|
665
677
|
transparent: 'rgba(0,0,0,0)',
|
|
666
678
|
aliceblue: '#f0f8ff',
|
|
667
679
|
antiquewhite: '#faebd7',
|
|
@@ -877,6 +889,28 @@
|
|
|
877
889
|
throw new Error(`Can not create color from given object`);
|
|
878
890
|
}
|
|
879
891
|
}
|
|
892
|
+
/**
|
|
893
|
+
* Creates a new Color instance from miscellaneous formats
|
|
894
|
+
* It just does not throw error when it fails, it returns PROMPTBOOK_COLOR instead
|
|
895
|
+
*
|
|
896
|
+
* @param color
|
|
897
|
+
* @returns Color object
|
|
898
|
+
*/
|
|
899
|
+
static fromSafe(color) {
|
|
900
|
+
try {
|
|
901
|
+
return Color.from(color);
|
|
902
|
+
}
|
|
903
|
+
catch (error) {
|
|
904
|
+
// <- Note: Can not use `assertsError(error)` here because it causes circular dependency
|
|
905
|
+
console.warn(spaceTrim((block) => `
|
|
906
|
+
Color.fromSafe error:
|
|
907
|
+
${block(error.message)}
|
|
908
|
+
|
|
909
|
+
Returning default PROMPTBOOK_COLOR.
|
|
910
|
+
`));
|
|
911
|
+
return Color.fromString('promptbook');
|
|
912
|
+
}
|
|
913
|
+
}
|
|
880
914
|
/**
|
|
881
915
|
* Creates a new Color instance from miscellaneous string formats
|
|
882
916
|
*
|
|
@@ -1466,7 +1500,7 @@
|
|
|
1466
1500
|
*
|
|
1467
1501
|
* @public exported from `@promptbook/core`
|
|
1468
1502
|
*/
|
|
1469
|
-
const PROMPTBOOK_COLOR = Color.
|
|
1503
|
+
const PROMPTBOOK_COLOR = Color.fromString('promptbook');
|
|
1470
1504
|
// <- TODO: [🧠][🈵] Using `Color` here increases the package size approx 3kb, maybe remove it
|
|
1471
1505
|
/**
|
|
1472
1506
|
* Colors for syntax highlighting in the `<BookEditor/>`
|
|
@@ -1618,7 +1652,7 @@
|
|
|
1618
1652
|
*/
|
|
1619
1653
|
class UnexpectedError extends Error {
|
|
1620
1654
|
constructor(message) {
|
|
1621
|
-
super(spaceTrim.spaceTrim((block) => `
|
|
1655
|
+
super(spaceTrim$1.spaceTrim((block) => `
|
|
1622
1656
|
${block(message)}
|
|
1623
1657
|
|
|
1624
1658
|
Note: This error should not happen.
|
|
@@ -1644,7 +1678,7 @@
|
|
|
1644
1678
|
constructor(whatWasThrown) {
|
|
1645
1679
|
const tag = `[🤮]`;
|
|
1646
1680
|
console.error(tag, whatWasThrown);
|
|
1647
|
-
super(spaceTrim.spaceTrim(`
|
|
1681
|
+
super(spaceTrim$1.spaceTrim(`
|
|
1648
1682
|
Non-Error object was thrown
|
|
1649
1683
|
|
|
1650
1684
|
Note: Look for ${tag} in the console for more details
|
|
@@ -2513,7 +2547,7 @@
|
|
|
2513
2547
|
*/
|
|
2514
2548
|
class NotYetImplementedError extends Error {
|
|
2515
2549
|
constructor(message) {
|
|
2516
|
-
super(spaceTrim.spaceTrim((block) => `
|
|
2550
|
+
super(spaceTrim$1.spaceTrim((block) => `
|
|
2517
2551
|
${block(message)}
|
|
2518
2552
|
|
|
2519
2553
|
Note: This feature is not implemented yet but it will be soon.
|